Class: ActiveMerchant::Billing::ModernPaymentsCimGateway
- Defined in:
- lib/active_merchant/billing/gateways/modern_payments_cim.rb
Overview
:nodoc:
Constant Summary collapse
- LIVE_XMLNS =
"https://secure.modpay.com/ws/"
- TEST_XMLNS =
"https://secure.modpay.com/netservices/test/"
- SUCCESS_MESSAGE =
"Transaction accepted"
- FAILURE_MESSAGE =
"Transaction failed"
- ERROR_MESSAGE =
"Transaction error"
- PAYMENT_METHOD =
{ :check => 1, :credit_card => 2 }
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
- #authorize_credit_card_payment(customer_id, amount) ⇒ Object
- #create_customer(options = {}) ⇒ Object
- #create_payment(customer_id, amount, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ ModernPaymentsCimGateway
constructor
A new instance of ModernPaymentsCimGateway.
- #modify_customer_credit_card(customer_id, credit_card) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?, #test?
Methods included from CreditCardFormatting
Constructor Details
#initialize(options = {}) ⇒ ModernPaymentsCimGateway
Returns a new instance of ModernPaymentsCimGateway.
24 25 26 27 28 |
# File 'lib/active_merchant/billing/gateways/modern_payments_cim.rb', line 24 def initialize( = {}) requires!(, :login, :password) @options = super end |
Instance Method Details
#authorize_credit_card_payment(customer_id, amount) ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/active_merchant/billing/gateways/modern_payments_cim.rb', line 48 def (customer_id, amount) raise ArgumentError, "The customer_id cannot be blank" if customer_id.blank? post = {} add_customer_id(post, customer_id) add_amount(post, amount) commit('AuthorizeCreditCardPayment', post) end |
#create_customer(options = {}) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/active_merchant/billing/gateways/modern_payments_cim.rb', line 30 def create_customer( = {}) post = {} add_customer_data(post, ) add_address(post, ) commit('CreateCustomer', post) end |
#create_payment(customer_id, amount, options = {}) ⇒ Object
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/active_merchant/billing/gateways/modern_payments_cim.rb', line 58 def create_payment(customer_id, amount, = {}) raise ArgumentError, "The customer_id cannot be blank" if customer_id.blank? post = {} add_customer_id(post, customer_id) add_amount(post, amount) add_payment_details(post, ) commit('CreatePayment', post) end |
#modify_customer_credit_card(customer_id, credit_card) ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'lib/active_merchant/billing/gateways/modern_payments_cim.rb', line 38 def modify_customer_credit_card(customer_id, credit_card) raise ArgumentError, "The customer_id cannot be blank" if customer_id.blank? post = {} add_customer_id(post, customer_id) add_credit_card(post, credit_card) commit('ModifyCustomerCreditCard', post) end |