Class: ActiveMerchant::Billing::ModernPaymentsGateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::ModernPaymentsGateway
- Defined in:
- lib/active_merchant/billing/gateways/modern_payments.rb
Constant Summary
Constant Summary
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary (collapse)
-
- (ModernPaymentsGateway) initialize(options = {})
constructor
A new instance of ModernPaymentsGateway.
- - (Object) purchase(money, credit_card, options = {})
Methods inherited from Gateway
card_brand, #card_brand, inherited, supports?, #test?
Methods included from CreditCardFormatting
Constructor Details
- (ModernPaymentsGateway) initialize(options = {})
A new instance of ModernPaymentsGateway
11 12 13 14 15 |
# File 'lib/active_merchant/billing/gateways/modern_payments.rb', line 11 def initialize( = {}) requires!(, :login, :password) @options = super end |
Instance Method Details
- (Object) purchase(money, credit_card, options = {})
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/active_merchant/billing/gateways/modern_payments.rb', line 17 def purchase(money, credit_card, = {}) customer_response = cim.create_customer() return customer_response unless customer_response.success? customer_id = customer_response.params["create_customer_result"] card_response = cim.modify_customer_credit_card(customer_id, credit_card) return card_response unless card_response.success? cim.(customer_id, money) end |