Class: ActiveMerchant::Billing::FinixGateway
- Includes:
- Empty
- Defined in:
- lib/active_merchant/billing/gateways/finix.rb
Constant Summary collapse
- SUCCESS_CODES =
[200, 201].freeze
- SOFT_DECLINE_CODES =
%w[ INSUFFICIENT_FUNDS EXCEEDS_APPROVAL_LIMIT CARD_VELOCITY_EXCEEDED PROCESSOR_TIMEOUT TRANSACTION_NOT_ALLOWED ].freeze
- COUNTRY_CODE =
{ 'US' => 'USA', 'CA' => 'CAN' }.freeze
- API_VERSION =
'2018-01-01'.freeze
- BASIC_AUTH_PREFIX =
'Basic '.freeze
- CONTENT_TYPE =
'application/json'.freeze
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 = {}) ⇒ FinixGateway
constructor
A new instance of FinixGateway.
- #purchase(amount, payment_source, options = {}) ⇒ Object
- #refund(amount, authorization, 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, #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 = {}) ⇒ FinixGateway
Returns a new instance of FinixGateway.
31 32 33 34 35 36 37 |
# File 'lib/active_merchant/billing/gateways/finix.rb', line 31 def initialize( = {}) requires!(, :username, :password, :merchant_id) super @username = [:username] @password = [:password] @merchant_id = [:merchant_id] end |
Instance Method Details
#purchase(amount, payment_source, options = {}) ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'lib/active_merchant/billing/gateways/finix.rb', line 39 def purchase(amount, payment_source, = {}) post = {} add_invoice(post, amount, ) add_payment_source(post, payment_source, ) add_idempotency_id(post, ) verification_data = [:verification_data] || {} commit('transaction', post, verification_data, ) end |
#refund(amount, authorization, options = {}) ⇒ Object
49 50 51 52 53 54 |
# File 'lib/active_merchant/billing/gateways/finix.rb', line 49 def refund(amount, , = {}) post = {} add_refund_data(post, amount, , ) commit('reversals', post, ) end |