- Inherits:
- Gateway
- Object
- Gateway
- ActiveMerchant::Billing::EwayRapidGateway
- Defined in:
- lib/active_merchant/billing/gateways/eway_rapid.rb
Constant Summary
Constants inheritedfrom Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
#options
Instance Method Summarycollapse
- #authorize(amount, payment_method, options = {}) ⇒ Object
- #capture(amount, identification, options = {}) ⇒ Object
- #initialize(options = {}) ⇒ EwayRapidGateway constructor
A new instance of EwayRapidGateway.
- #purchase(amount, payment_method, options = {}) ⇒ Object
Public: Run a purchase transaction.
- #refund(amount, identification, options = {}) ⇒ Object
Public: Refund a transaction.
- #scrub(transcript) ⇒ Object
- #store(payment_method, options = {}) ⇒ Object
Public: Store card details and return a valid token.
- #supports_scrubbing ⇒ Object
- #update(customer_token, payment_method, options = {}) ⇒ Object
Public: Update a customer’s data.
- #void(identification, options = {}) ⇒ 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
#expdate, #format
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ EwayRapidGateway
Returns a new instance of EwayRapidGateway.
18192021 | # File 'lib/active_merchant/billing/gateways/eway_rapid.rb', line 18def initialize(options = {}) requires!(options, :login, :password) superend |
Instance Method Details
#authorize(amount, payment_method, options = {}) ⇒ Object
616263646566676869 | # File 'lib/active_merchant/billing/gateways/eway_rapid.rb', line 61def authorize(amount, payment_method, options = {}) params = {} add_metadata(params, options) add_invoice(params, amount, options) add_customer_data(params, options, payment_method) add_credit_card(params, payment_method, options) params['Method'] = 'Authorise' commit(url_for('Authorisation'), params)end |
#capture(amount, identification, options = {}) ⇒ Object
71727374757677 | # File 'lib/active_merchant/billing/gateways/eway_rapid.rb', line 71def capture(amount, identification, options = {}) params = {} add_metadata(params, options) add_invoice(params, amount, options) add_reference(params, identification) commit(url_for('CapturePayment'), params)end |
#purchase(amount, payment_method, options = {}) ⇒ Object
Public: Run a purchase transaction.
amount - The monetary amount of the transaction in cents. payment_method - The payment method or authorization token returned from store. options - A standard ActiveMerchant options hash:
:transaction_type - One of: Purchase (default), MOTO or Recurring. For stored card payments (aka - TokenPayments), this must be either MOTO or Recurring.:invoice - The merchant’s invoice number for this transaction (optional).:order_id - A merchant-supplied identifier for the transaction (optional).:description - A merchant-supplied description of the transaction (optional).:currency - Three letter currency code for the transaction (default: "AUD"):billing_address - Standard ActiveMerchant address hash (optional).:shipping_address - Standard ActiveMerchant address hash (optional).:ip - The ip of the consumer initiating the transaction (optional).:application_id - A string identifying the application submitting the transaction (default: "https://github.com/activemerchant/active_merchant")
Returns an ActiveMerchant::Billing::Response object where authorization is the Transaction ID on success
50515253545556575859 | # File 'lib/active_merchant/billing/gateways/eway_rapid.rb', line 50def purchase(amount, payment_method, options = {}) params = {} add_metadata(params, options) add_invoice(params, amount, options) add_customer_data(params, options, payment_method) add_credit_card(params, payment_method, options) add_3ds_authenticated_data(params, options) if options[:three_d_secure] params['Method'] = payment_method.respond_to?(:number) ? 'ProcessPayment' : 'TokenPayment' commit(url_for('Transaction'), params)end |
#refund(amount, identification, options = {}) ⇒ Object
Public: Refund a transaction.
amount - The monetary amount of the transaction in cents identification - The transaction id which is returned in the
authorization of the successful purchase transaction
options - A standard ActiveMerchant options hash:
:invoice - The merchant’s invoice number for this transaction (optional).:order_id - A merchant-supplied identifier for the transaction (optional).:description - A merchant-supplied description of the transaction (optional).:currency - Three letter currency code for the transaction (default: "AUD"):billing_address - Standard ActiveMerchant address hash (optional).:shipping_address - Standard ActiveMerchant address hash (optional).:ip - The ip of the consumer initiating the transaction (optional).:application_id - A string identifying the application submitting the transaction (default: "https://github.com/activemerchant/active_merchant")
Returns an ActiveMerchant::Billing::Response object
110111112113114115116117 | # File 'lib/active_merchant/billing/gateways/eway_rapid.rb', line 110def refund(amount, identification, options = {}) params = {} add_metadata(params, options) add_invoice(params, amount, options, 'Refund') add_reference(params['Refund'], identification) add_customer_data(params, options) commit(url_for("Transaction/#{identification}/Refund"), params)end |
#scrub(transcript) ⇒ Object
181182183184185186 | # File 'lib/active_merchant/billing/gateways/eway_rapid.rb', line 181def scrub(transcript) transcript. gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]'). gsub(%r(("Number\\?":\\?")[^"]*)i, '\1[FILTERED]'). gsub(%r(("CVN\\?":\\?"?)[^",]*)i, '\1[FILTERED]')end |
#store(payment_method, options = {}) ⇒ Object
Public: Store card details and return a valid token
payment_method - The payment method or nil if :customer_token is provided options - A supplemented ActiveMerchant options hash:
:order_id - A merchant-supplied identifier for the transaction (optional).:description - A merchant-supplied description of the transaction (optional).:billing_address - Standard ActiveMerchant address hash (required).:ip - The ip of the consumer initiating the transaction (optional).:application_id - A string identifying the application submitting the transaction (default: "https://github.com/activemerchant/active_merchant")
Returns an ActiveMerchant::Billing::Response object where the authorization is the customer_token on success
136137138139140141142143144145 | # File 'lib/active_merchant/billing/gateways/eway_rapid.rb', line 136def store(payment_method, options = {}) requires!(options, :billing_address) params = {} add_metadata(params, options) add_invoice(params, 0, options) add_customer_data(params, options, payment_method) add_credit_card(params, payment_method, options) params['Method'] = 'CreateTokenCustomer' commit(url_for('Transaction'), params)end |
#supports_scrubbing ⇒ Object
177178179 | # File 'lib/active_merchant/billing/gateways/eway_rapid.rb', line 177def supports_scrubbing trueend |
#update(customer_token, payment_method, options = {}) ⇒ Object
Public: Update a customer’s data
customer_token - The customer token returned in the authorization of
a successful store transaction.
payment_method - The payment method or nil if :customer_token is provided options - A supplemented ActiveMerchant options hash:
:order_id - A merchant-supplied identifier for the transaction (optional).:description - A merchant-supplied description of the transaction (optional).:billing_address - Standard ActiveMerchant address hash (optional).:ip - The ip of the consumer initiating the transaction (optional).:application_id - A string identifying the application submitting the transaction (default: "https://github.com/activemerchant/active_merchant")
Returns an ActiveMerchant::Billing::Response object where the authorization is the customer_token on success
166167168169170171172173174175 | # File 'lib/active_merchant/billing/gateways/eway_rapid.rb', line 166def update(customer_token, payment_method, options = {}) params = {} add_metadata(params, options) add_invoice(params, 0, options) add_customer_data(params, options, payment_method) add_credit_card(params, payment_method, options) add_customer_token(params, customer_token) params['Method'] = 'UpdateTokenCustomer' commit(url_for('Transaction'), params)end |
#void(identification, options = {}) ⇒ Object
7980818283 | # File 'lib/active_merchant/billing/gateways/eway_rapid.rb', line 79def void(identification, options = {}) params = {} add_reference(params, identification) commit(url_for('CancelAuthorisation'), params)end |