Class: ActiveMerchant::Billing::QbmsGateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::QbmsGateway
- Defined in:
- lib/active_merchant/billing/gateways/qbms.rb
Constant Summary
- API_VERSION =
'4.0'- TYPES =
{ :authorize => 'CustomerCreditCardAuth', :capture => 'CustomerCreditCardCapture', :purchase => 'CustomerCreditCardCharge', :refund => 'CustomerCreditCardTxnVoidOrRefund', :void => 'CustomerCreditCardTxnVoid', :query => 'MerchantAccountQuery', }
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)
-
- (Object) authorize(money, creditcard, options = {})
Performs an authorization, which reserves the funds on the customer's credit card, but does not charge the card.
-
- (Object) capture(money, authorization, options = {})
Captures the funds from an authorized transaction.
-
- (Object) credit(money, identification, options = {})
Credit an account.
-
- (QbmsGateway) initialize(options = {})
constructor
Creates a new QbmsGateway.
-
- (Object) purchase(money, creditcard, options = {})
Perform a purchase, which is essentially an authorization and capture in a single operation.
-
- (Object) query
Query the merchant account status.
- - (Object) refund(money, identification, options = {})
- - (Boolean) test?
-
- (Object) void(authorization, options = {})
Void a previous transaction.
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?
Methods included from CreditCardFormatting
Constructor Details
- (QbmsGateway) initialize(options = {})
Creates a new QbmsGateway
The gateway requires that a valid app id, app login, and ticket be passed in the options hash.
Options
-
:login ??? The App Login (REQUIRED)
-
:ticket ??? The Connection Ticket. (REQUIRED)
-
:pem ??? The PEM-encoded SSL client key and certificate. (REQUIRED)
-
:test ??? true or false. If true, perform transactions against the test server. Otherwise, perform transactions against the production server.
39 40 41 42 43 44 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 39 def initialize( = {}) requires!(, :login, :ticket) test_mode = [:test] || false @options = super end |
Instance Method Details
- (Object) authorize(money, creditcard, options = {})
Performs an authorization, which reserves the funds on the customer's credit card, but does not charge the card.
Parameters
-
money ??? The amount to be authorized as an Integer value in cents.
-
creditcard ??? The CreditCard details for the transaction.
-
options ??? A hash of optional parameters.
55 56 57 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 55 def (money, creditcard, = {}) commit(:authorize, money, .merge(:credit_card => creditcard)) end |
- (Object) capture(money, authorization, options = {})
Captures the funds from an authorized transaction.
Parameters
-
money ??? The amount to be captured as an Integer value in cents.
-
authorization ??? The authorization returned from the previous authorize request.
78 79 80 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 78 def capture(money, , = {}) commit(:capture, money, .merge(:transaction_id => )) end |
- (Object) credit(money, identification, options = {})
Credit an account.
This transaction is also referred to as a Refund and indicates to the gateway that money should flow from the merchant to the customer.
Parameters
-
money ??? The amount to be credited to the customer as an Integer value in cents.
-
identification ??? The ID of the original transaction against which the credit is being issued.
-
options ??? A hash of parameters.
104 105 106 107 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 104 def credit(money, identification, = {}) deprecated CREDIT_DEPRECATION_MESSAGE refund(money, identification, = {}) end |
- (Object) purchase(money, creditcard, options = {})
Perform a purchase, which is essentially an authorization and capture in a single operation.
Parameters
-
money ??? The amount to be purchased as an Integer value in cents.
-
creditcard ??? The CreditCard details for the transaction.
-
options ??? A hash of optional parameters.
67 68 69 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 67 def purchase(money, creditcard, = {}) commit(:purchase, money, .merge(:credit_card => creditcard)) end |
- (Object) query
Query the merchant account status
114 115 116 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 114 def query commit(:query, nil, {}) end |
- (Object) refund(money, identification, options = {})
109 110 111 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 109 def refund(money, identification, = {}) commit(:refund, money, .merge(:transaction_id => identification)) end |
- (Boolean) test?
118 119 120 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 118 def test? @options[:test] || super end |
- (Object) void(authorization, options = {})
Void a previous transaction
Parameters
-
authorization - The authorization returned from the previous authorize request.
88 89 90 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 88 def void(, = {}) commit(:void, nil, .merge(:transaction_id => )) end |