Module: AuthorizeNet::ARB::Fields

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

Overview

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

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}
  ]}
]}
CREATE_FIELDS =

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

[
  {:refId => :reference_id},
  SUBSCRIPTION_FIELDS
]
UPDATE_FIELDS =

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

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

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

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

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

[
  {:refId => :reference_id},
  {:subscriptionId => :subscription_id}
]
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
}