module PayCertify::Gateway::AttributeMapping

Public Instance Methods

charge() click to toggle source
# File lib/paycertify/gateway/attribute_mapping.rb, line 57
def charge
  {
    'CardToken' => :credit_card_id,
    'Amount' => :amount,
    'PNRef' => :transaction_id
  }
end
credit_card() click to toggle source
# File lib/paycertify/gateway/attribute_mapping.rb, line 48
def credit_card
  {
    'CardNum' => :card_number,
    'NameOnCard' => :name_on_card,
    'CustomerKey' => :customer_id,
    'PostalCode' => :zip
  }
end
customer() click to toggle source
# File lib/paycertify/gateway/attribute_mapping.rb, line 32
def customer
  {
    'CustomerID' => :app_customer_id,
    'CustomerKey' => :customer_id,
    'CustomerName' => :name,
    'Street1' => :address,
    'City' => :city,
    'StateID' => :state,
    'Zip' => :zip,
    'MobilePhone' => :phone,
    'Fax' => :fax,
    'Email' => :email,
    'Status' => :status
  }
end
expiration_date(transaction) click to toggle source
# File lib/paycertify/gateway/attribute_mapping.rb, line 65
def expiration_date(transaction)
  { 'ExpDate' => [transaction.expiration_month, transaction.expiration_year].join }
end
status(customer) click to toggle source
# File lib/paycertify/gateway/attribute_mapping.rb, line 80
def status(customer)
  object.status.to_s.upcase
end
transaction() click to toggle source
# File lib/paycertify/gateway/attribute_mapping.rb, line 5
def transaction
  {
    'Amount' => :amount,
    'Currency' => :currency,
    'CardNum' => :card_number,
    'NameOnCard' => :name_on_card,
    'CVNum' => :cvv,
    'InvNum' => :transaction_id,
    'PNRef' => :transaction_id,
    'Street' => :billing_address,
    'City' => :billing_city,
    'State' => :billing_state,
    'Zip' => :billing_zip,
    'Country' => :billing_country,
    'ShippingStreet' => :billing_address,
    'ShippingCity' => :billing_city,
    'ShippingState' => :billing_state,
    'ShippingZip' => :billing_zip,
    'ShippingCountry' => :billing_country,
    'MobilePhone' => :phone,
    'Email' => :email,
    'Description' => :order_description,
    'CustomerID' => :customer_id,
    'ServerID' => :ip
  }
end
type(object) click to toggle source
# File lib/paycertify/gateway/attribute_mapping.rb, line 69
def type(object)
  case object.class.name
  when /.*Transaction.*/, /.*Charge.*/
    { 'TransType' => object.type.to_s.capitalize }
  when /.*Customer.*/
    { 'TransType' => object.type.to_s.upcase }
  else
    {}
  end
end