Class: ActiveMerchant::Billing::ConektaGateway
- Defined in:
- lib/active_merchant/billing/gateways/conekta.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_source, options = {}) ⇒ Object
- #capture(money, identifier, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ ConektaGateway
constructor
A new instance of ConektaGateway.
- #purchase(money, payment_source, options = {}) ⇒ Object
- #refund(money, identifier, 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 = {}) ⇒ ConektaGateway
Returns a new instance of ConektaGateway.
13 14 15 16 17 |
# File 'lib/active_merchant/billing/gateways/conekta.rb', line 13 def initialize( = {}) requires!(, :key) [:version] ||= '0.3.0' super end |
Instance Method Details
#authorize(money, payment_source, options = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/active_merchant/billing/gateways/conekta.rb', line 29 def (money, payment_source, = {}) post = {} add_order(post, money, ) add_payment_source(post, payment_source, ) add_details_data(post, ) post[:capture] = false commit(:post, "charges", post) end |
#capture(money, identifier, options = {}) ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/active_merchant/billing/gateways/conekta.rb', line 40 def capture(money, identifier, = {}) post = {} post[:order_id] = identifier add_order(post, money, ) commit(:post, "charges/#{identifier}/capture", post) end |
#purchase(money, payment_source, options = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/active_merchant/billing/gateways/conekta.rb', line 19 def purchase(money, payment_source, = {}) post = {} add_order(post, money, ) add_payment_source(post, payment_source, ) add_details_data(post, ) commit(:post, 'charges', post) end |
#refund(money, identifier, options) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/active_merchant/billing/gateways/conekta.rb', line 49 def refund(money, identifier, ) post = {} post[:order_id] = identifier add_order(post, money, ) commit(:post, "charges/#{identifier}/refund", post) end |