Class: ActiveMerchant::Billing::QbmsGateway
- Defined in:
- lib/active_merchant/billing/gateways/qbms.rb
Constant Summary collapse
- 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
-
#authorize(money, creditcard, options = {}) ⇒ Object
Performs an authorization, which reserves the funds on the customer’s credit card, but does not charge the card.
-
#capture(money, authorization, options = {}) ⇒ Object
Captures the funds from an authorized transaction.
-
#credit(money, identification, options = {}) ⇒ Object
Credit an account.
-
#initialize(options = {}) ⇒ QbmsGateway
constructor
Creates a new QbmsGateway.
-
#purchase(money, creditcard, options = {}) ⇒ Object
Perform a purchase, which is essentially an authorization and capture in a single operation.
-
#query ⇒ Object
Query the merchant account status.
- #refund(money, identification, options = {}) ⇒ Object
-
#void(authorization, options = {}) ⇒ Object
Void a previous transaction.
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?, #test?
Methods included from Utils
#deprecated, generate_unique_id
Methods included from CreditCardFormatting
Methods included from RequiresParameters
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ QbmsGateway
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
orfalse
. If true, perform transactions against the test server. Otherwise, perform transactions against the production server.
41 42 43 44 45 46 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 41 def initialize( = {}) requires!(, :login, :ticket) test_mode = [:test] || false @options = super end |
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
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.
57 58 59 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 57 def (money, creditcard, = {}) commit(:authorize, money, .merge(:credit_card => creditcard)) end |
#capture(money, authorization, options = {}) ⇒ Object
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.
80 81 82 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 80 def capture(money, , = {}) commit(:capture, money, .merge(:transaction_id => )) end |
#credit(money, identification, options = {}) ⇒ Object
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.
106 107 108 109 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 106 def credit(money, identification, = {}) deprecated CREDIT_DEPRECATION_MESSAGE refund(money, identification, = {}) end |
#purchase(money, creditcard, options = {}) ⇒ Object
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.
69 70 71 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 69 def purchase(money, creditcard, = {}) commit(:purchase, money, .merge(:credit_card => creditcard)) end |
#query ⇒ Object
Query the merchant account status
116 117 118 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 116 def query commit(:query, nil, {}) end |
#refund(money, identification, options = {}) ⇒ Object
111 112 113 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 111 def refund(money, identification, = {}) commit(:refund, money, .merge(:transaction_id => identification)) end |
#void(authorization, options = {}) ⇒ Object
Void a previous transaction
Parameters
-
authorization
- The authorization returned from the previous authorize request.
90 91 92 |
# File 'lib/active_merchant/billing/gateways/qbms.rb', line 90 def void(, = {}) commit(:void, nil, .merge(:transaction_id => )) end |