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, = {}) parameters = { amount: amount(money) } add_order_id(parameters, ) add_aggregator(parameters, ) add_customer_data(parameters, ) add_payment_source(parameters, creditcard_or_billing_id) add_addresses(parameters, ) add_custom_fields(parameters, ) commit('sale', parameters) end |