Class: ActiveMerchant::Billing::MerchantOneGateway
- Defined in:
- lib/active_merchant/billing/gateways/merchant_one.rb
Defined Under Namespace
Classes: MerchantOneSslConnection
Constant Summary collapse
- BASE_URL =
'https://secure.merchantonegateway.com/api/transact.php'
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(money, creditcard, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ MerchantOneGateway
constructor
A new instance of MerchantOneGateway.
- #new_connection(endpoint) ⇒ Object
- #purchase(money, creditcard, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?, #test?
Methods included from CreditCardFormatting
Constructor Details
#initialize(options = {}) ⇒ MerchantOneGateway
Returns a new instance of MerchantOneGateway.
23 24 25 26 |
# File 'lib/active_merchant/billing/gateways/merchant_one.rb', line 23 def initialize( = {}) requires!(, :username, :password) super end |
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/active_merchant/billing/gateways/merchant_one.rb', line 28 def (money, creditcard, = {}) post = {} add_customer_data(post, ) add_creditcard(post, creditcard) add_address(post, creditcard, ) add_customer_data(post, ) add_amount(post, money, ) commit('auth', money, post) end |
#capture(money, authorization, options = {}) ⇒ Object
48 49 50 51 52 53 |
# File 'lib/active_merchant/billing/gateways/merchant_one.rb', line 48 def capture(money, , = {}) post = {} post.merge!(:transactionid => ) add_amount(post, money, ) commit('capture', money, post) end |
#new_connection(endpoint) ⇒ Object
55 56 57 |
# File 'lib/active_merchant/billing/gateways/merchant_one.rb', line 55 def new_connection(endpoint) MerchantOneSslConnection.new(endpoint) end |
#purchase(money, creditcard, options = {}) ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'lib/active_merchant/billing/gateways/merchant_one.rb', line 38 def purchase(money, creditcard, = {}) post = {} add_customer_data(post, ) add_creditcard(post, creditcard) add_address(post, creditcard, ) add_customer_data(post, ) add_amount(post, money, ) commit('sale', money, post) end |