Creates a new SageGateway
The gateway requires that a valid login and password be passed in the options hash.
:login - The Sage Payment Solutions Merchant ID Number.
:password - The Sage Payment Solutions Merchant Key Number.
# File lib/active_merchant/billing/gateways/sage.rb, line 19 19: def initialize(options = {}) 20: requires!(options, :login, :password) 21: @options = options 22: super 23: end
Captures authorized funds.
money - The amount to be authorized as an integer value in cents. Sage doesn’t support changing the capture amount, so the full amount of the initial transaction will be captured.
reference - The authorization reference string returned by the original transaction’s Response#authorization.
# File lib/active_merchant/billing/gateways/sage.rb, line 104 104: def capture(money, reference, options = {}) 105: bankcard.capture(money, reference, options) 106: end
Performs a credit transaction. (Sage Credit transaction).
money - The amount to be authorized as an integer value in cents.
source - The CreditCard or Check object to be used as the target for the credit.
# File lib/active_merchant/billing/gateways/sage.rb, line 127 127: def credit(money, source, options = {}) 128: if card_brand(source) == "check" 129: virtual_check.credit(money, source, options) 130: else 131: bankcard.credit(money, source, options) 132: end 133: end
Performs a purchase, which is essentially an authorization and capture in a single operation.
money - The amount to be authorized as an integer value in cents.
source - The CreditCard or Check object to be used as the funding source for the transaction.
options - A hash of optional parameters.
:order_id - A unique reference for this order. (maximum of 20 characters).
:email - The customer’s email address
:customer - The Customer Number for Purchase Card Level II Transactions
:billing_address - The customer’s billing address as a hash of address information.
:address1 - The billing address street
:city - The billing address city
:state - The billing address state
:country - The 2 digit ISO billing address country code
:zip - The billing address zip code
:phone - The billing address phone number
:fax - The billing address fax number
:shipping_address - The customer’s shipping address as a hash of address information.
:name - The name at the shipping address
:address1 - The shipping address street
:city - The shipping address city
:state - The shipping address state code
:country - The 2 digit ISO shipping address country code
:zip - The shipping address zip code
:tax - The tax amount for the transaction as an integer value in cents. Maps to Sage T_tax.
:shipping - The shipping amount for the transaction as an integer value in cents. Maps to Sage T_shipping.
:originator_id - 10 digit originator. If not provided, Sage will use the default Originator ID for the specific customer type.
:addenda - Transaction addenda.
:ssn - The customer’s Social Security Number.
:drivers_license_state - The customer’s drivers license state code.
:drivers_license_number - The customer’s drivers license number.
:date_of_birth - The customer’s date of birth as a Time or Date object or a string in the format mm/dd/yyyy.
# File lib/active_merchant/billing/gateways/sage.rb, line 90 90: def purchase(money, source, options = {}) 91: if card_brand(source) == "check" 92: virtual_check.purchase(money, source, options) 93: else 94: bankcard.purchase(money, source, options) 95: end 96: end
Voids a prior transaction. Works for both CreditCard and Check transactions.
reference - The authorization reference string returned by the original transaction’s Response#authorization.
# File lib/active_merchant/billing/gateways/sage.rb, line 113 113: def void(reference, options = {}) 114: if reference.split(";").last == "virtual_check" 115: virtual_check.void(reference, options) 116: else 117: bankcard.void(reference, options) 118: end 119: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.