Module: AuthorizeNet::ARB::Fields

Included in:
Transaction
Defined in:
lib/authorize_net/fields.rb,
lib/authorize_net/arb/fields.rb

Overview

Contains the various lists of fields needed by the ARB API.

Defined Under Namespace

Classes: EntityDescription

Constant Summary collapse

SUBSCRIPTION_FIELDS =

Describes the order and nesting of fields in the ARB Subscription XML.

{ subscription: [
  { name: :subscription_name },
  { paymentSchedule: [
    { interval: [
      { length: :subscription_length },
      { unit: :subscription_unit }
    ] },
    { startDate: :subscription_start_date },
    { totalOccurrences: :subscription_total_occurrences },
    { trialOccurrences: :subscription_trial_occurrences }
  ] },
  { amount: :subscription_amount },
  { trialAmount: :subscription_trial_amount },
  { payment: [
    { creditCard: [
      { cardNumber: :card_num },
      { expirationDate: :exp_date },
      { cardCode: :card_code }
    ] },
    { bankAccount: [
      { accountType: :bank_acct_type },
      { routingNumber: :bank_aba_code },
      { accountNumber: :bank_acct_num },
      { nameOnAccount: :bank_acct_name },
      { echeckType: :echeck_type },
      { bankName: :bank_name }
    ] }
  ] },
  { order: [
    { invoiceNumber: :invoice_num },
    { description: :description }
  ] },
  { customer: [
    { id_: :cust_id },
    { email: :email },
    { phoneNumber: :phone },
    { faxNumber: :fax }
  ] },
  { billTo: [
    { firstName: :first_name },
    { lastName: :last_name },
    { company: :company },
    { address: :address },
    { city: :city },
    { state: :state },
    { zip: :zip },
    { country: :country }
  ] },
  { shipTo: [
    { firstName: :ship_to_first_name },
    { lastName: :ship_to_last_name },
    { company: :ship_to_company },
    { address: :ship_to_address },
    { city: :ship_to_city },
    { state: :ship_to_state },
    { zip: :ship_to_zip },
    { country: :ship_to_country }
  ] }
] }.freeze
CREATE_FIELDS =

Describes the order and nesting of fields in the ARB ARBCreateSubscriptionRequest XML.

[
  { refId: :reference_id },
  SUBSCRIPTION_FIELDS
].freeze
UPDATE_FIELDS =

Describes the order and nesting of fields in the ARB ARBUpdateSubscriptionRequest XML.

[
  { refId: :reference_id },
  { subscriptionId: :subscription_id },
  SUBSCRIPTION_FIELDS
].freeze
GET_STATUS_FIELDS =

Describes the order and nesting of fields in the ARB ARBGetSubscriptionStatusRequest XML.

[
  { refId: :reference_id },
  { subscriptionId: :subscription_id }
].freeze
CANCEL_FIELDS =

Describes the order and nesting of fields in the ARB ARBCancelSubscriptionRequest XML.

[
  { refId: :reference_id },
  { subscriptionId: :subscription_id }
].freeze
GET_SUBSCRIPTION_LIST_FIELDS =

Describes the order and nesting of fields in the ARB ARBGetSubscriptionListRequest XML.

[
  { refId: :reference_id },
  { searchType: :search_type },
  { sorting: [
    { orderBy: :order_by },
    { orderDescending: :order_descending }
  ] },
  { paging: [
    { limit: :limit },
    { offset: :offset }
  ] }
].freeze
FIELDS =
{
  AuthorizeNet::XmlTransaction::Type::ARB_CREATE => CREATE_FIELDS,
  AuthorizeNet::XmlTransaction::Type::ARB_UPDATE => UPDATE_FIELDS,
  AuthorizeNet::XmlTransaction::Type::ARB_GET_STATUS => GET_STATUS_FIELDS,
  AuthorizeNet::XmlTransaction::Type::ARB_CANCEL => CANCEL_FIELDS,
  AuthorizeNet::XmlTransaction::Type::ARB_GET_SUBSCRIPTION_LIST => GET_SUBSCRIPTION_LIST_FIELDS
}.freeze
SUBSCRIPTION_DETAIL_ENTITY_DESCRIPTION =
EntityDescription.new(
  [
    { id: :id },
    { name: :name },
    { status: :status },
    { createTimeStampUTC: :create_time_stamp_utc },
    { firstName: :first_name },
    { lastName: :last_name },
    { totalOccurrences: :total_occurrences },
    { pastOccurrences: :past_occurrences },
    { paymentMethod: :payment_method },
    { accountNumber: :account_number },
    { invoice: :invoice },
    { amount: :amount },
    { currencyId: :currency_id }
  ],
  AuthorizeNet::ARB::SubscriptionDetail
)