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::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
- #scrub(transcript) ⇒ Object
- #supports_scrubbing ⇒ Object
Methods inherited from Gateway
#add_field_to_post_if_present, #add_fields_to_post_if_present, #card_brand, card_brand, #generate_unique_id, inherited, #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 |
#scrub(transcript) ⇒ Object
59 60 61 62 63 64 |
# File 'lib/active_merchant/billing/gateways/eway.rb', line 59 def scrub(transcript) transcript. gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]'). gsub(%r((<ewayCardNumber>)\d+(</ewayCardNumber>))i, '\1[FILTERED]\2'). gsub(%r((<ewayCVN>)\d+(</ewayCVN>))i, '\1[FILTERED]\2') end |
#supports_scrubbing ⇒ Object
55 56 57 |
# File 'lib/active_merchant/billing/gateways/eway.rb', line 55 def supports_scrubbing true end |