# File lib/active_merchant/billing/gateways/eway_managed.rb, line 24 def initialize(options = {}) requires!(options, :login, :username, :password) @options = options # eWay returns 500 code for faults, which AM snaffles. # So, we tell it to allow them. @options[:ignore_http_status]=true super end
Process a payment in the given amount against the stored credit card given by billing_id
money -- The amount to be purchased as an Integer value in cents.
billing_id -- The eWay provided card/customer token to charge (managedCustomerID)
options -- A hash of optional parameters.
:order_id -- The order number, passed to eWay as the "Invoice Reference"
:invoice -- The invoice number, passed to eWay as the "Invoice Reference" unless :order_id is also given
:description -- A description of the payment, passed to eWay as the "Invoice Description"
# File lib/active_merchant/billing/gateways/eway_managed.rb, line 84 def purchase(money, billing_id, options={}) post = {} post[:managedCustomerID] = billing_id.to_s post[:amount]=money add_invoice(post, options) commit("ProcessPayment", post) end
add a new customer CC to your eway account and return unique ManagedCustomerID supports storing details required by eway see “add_creditcard” and “add_address”
# File lib/active_merchant/billing/gateways/eway_managed.rb, line 36 def store(creditcard, options = {}) post = {} # Handle our required fields requires!(options, :billing_address) # Handle eWay specific required fields. billing_address = options[:billing_address] eway_requires!(billing_address) add_creditcard(post, creditcard) add_address(post, billing_address) add_misc_fields(post, options) commit("CreateCustomer", post) end
TODO: eWay API also provides QueryCustomer TODO: eWay API also provides QueryPayment
# File lib/active_merchant/billing/gateways/eway_managed.rb, line 96 def test? @options[:test] || Base.gateway_mode == :test end
# File lib/active_merchant/billing/gateways/eway_managed.rb, line 53 def update(billing_id, creditcard, options={}) post = {} # Handle our required fields requires!(options, :billing_address) # Handle eWay specific required fields. billing_address = options[:billing_address] eway_requires!(billing_address) post[:managedCustomerID]=billing_id add_creditcard(post, creditcard) add_address(post, billing_address) add_misc_fields(post, options) commit("UpdateCustomer", post) end
Generated with the Darkfish Rdoc Generator 2.