Class: ActiveMerchant::Billing::App55Gateway
- Defined in:
- lib/active_merchant/billing/gateways/app55.rb
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
-
#authorize(money, payment_method, options = {}) ⇒ Object
Authorize a transaction.
-
#capture(money, authorization, options = {}) ⇒ Object
Commit a pre-authorized transaction.
-
#initialize(options = {}) ⇒ App55Gateway
constructor
Create gateway.
-
#purchase(money, payment_method, options = {}) ⇒ Object
Make a purchase (authorize and commit).
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 = {}) ⇒ App55Gateway
Create gateway
options:
:api_key - merchants App55 API Key
:api_secret - merchants App55 Secret Key
19 20 21 22 23 24 |
# File 'lib/active_merchant/billing/gateways/app55.rb', line 19 def initialize( = {}) requires!(, :api_key, :api_secret) @api_key = [:api_key] @api_secret = [:api_secret] super end |
Instance Method Details
#authorize(money, payment_method, options = {}) ⇒ Object
Authorize a transaction.
money - The monetary amount of the transaction in cents. payment_method - The CreditCard or the App55 card token. options - A standard ActiveMerchant options hash
40 41 42 43 44 45 46 |
# File 'lib/active_merchant/billing/gateways/app55.rb', line 40 def (money, payment_method, = {}) post = {} add_creditcard(post, payment_method, ) add_transaction(post, money, ) commit(:post, 'transaction', post) end |
#capture(money, authorization, options = {}) ⇒ Object
Commit a pre-authorized transaction.
money - The monetary amount of the transaction in cents. authorization - The App55 transaction id string. options - A standard ActiveMerchant options hash
53 54 55 |
# File 'lib/active_merchant/billing/gateways/app55.rb', line 53 def capture(money, , = {}) commit(:post, "transaction/#{}") end |
#purchase(money, payment_method, options = {}) ⇒ Object
Make a purchase (authorize and commit)
money - The monetary amount of the transaction in cents. payment_method - The CreditCard or the App55 card token. options - A standard ActiveMerchant options hash
31 32 33 |
# File 'lib/active_merchant/billing/gateways/app55.rb', line 31 def purchase(money, payment_method, = {}) (money, payment_method, .merge(commit: true)) end |