Class: ActiveMerchant::Billing::EwayGateway
- Defined in:
- lib/active_merchant/billing/gateways/eway.rb
Overview
Public: For more information on the Eway Gateway please visit their Developers Area
Constant Summary
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ EwayGateway
constructor
Public: Create a new Eway Gateway.
- #purchase(money, creditcard, options = {}) ⇒ Object
- #refund(money, authorization, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, #generate_unique_id, inherited, non_fractional_currency?, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?
Methods included from CreditCardFormatting
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ EwayGateway
Public: Create a new Eway Gateway. options - A hash of options:
:login - Your Customer ID.
:password - Your XML Refund Password that you
specified on the Eway site. (optional)
21 22 23 24 |
# File 'lib/active_merchant/billing/gateways/eway.rb', line 21 def initialize( = {}) requires!(, :login) super end |
Instance Method Details
#purchase(money, creditcard, options = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/active_merchant/billing/gateways/eway.rb', line 26 def purchase(money, creditcard, = {}) requires_address!() post = {} add_creditcard(post, creditcard) add_address(post, ) add_customer_id(post) add_invoice_data(post, ) add_non_optional_data(post) add_amount(post, money) post[:CustomerEmail] = [:email] commit(purchase_url(post[:CVN]), money, post) end |
#refund(money, authorization, options = {}) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/active_merchant/billing/gateways/eway.rb', line 41 def refund(money, , ={}) post = {} add_customer_id(post) add_amount(post, money) add_non_optional_data(post) post[:OriginalTrxnNumber] = post[:RefundPassword] = @options[:password] post[:CardExpiryMonth] = nil post[:CardExpiryYear] = nil commit(refund_url, money, post) end |