Method: ActiveMerchant::Billing::TrustCommerceGateway#purchase

Defined in:
lib/active_merchant/billing/gateways/trust_commerce.rb

#purchase(money, creditcard_or_billing_id, options = {}) ⇒ Object

purchase() is a simple sale. This is one of the most common types of transactions, and is extremely simple. All that you need to process a purchase are an amount in cents or a money object and a creditcard object or billingid string.



169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/active_merchant/billing/gateways/trust_commerce.rb', line 169

def purchase(money, creditcard_or_billing_id, options = {})
  parameters = {
    amount: amount(money)
  }

  add_order_id(parameters, options)
  add_aggregator(parameters, options)
  add_customer_data(parameters, options)
  add_payment_source(parameters, creditcard_or_billing_id)
  add_addresses(parameters, options)
  add_custom_fields(parameters, options)

  commit('sale', parameters)
end