Class: ActiveMerchant::Billing::CertoDirectGateway
- Defined in:
- lib/active_merchant/billing/gateways/certo_direct.rb
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
-
#authorize(money, credit_card, options = {}) ⇒ Object
Performs an authorization, which reserves the funds on the customer’s credit card, but does not charge the card.
-
#capture(money, identification, options = {}) ⇒ Object
Captures the funds from an authorized transaction.
-
#initialize(options = {}) ⇒ CertoDirectGateway
constructor
Creates a new CertoDirectGateway.
-
#purchase(money, credit_card, options = {}) ⇒ Object
Perform a purchase, which is essentially an authorization and capture in a single operation.
-
#recurring(identification, options = {}) ⇒ Object
Create a recurring payment.
-
#refund(money, identification, options = {}) ⇒ Object
Refund a transaction.
-
#void(money, identification, options = {}) ⇒ Object
Void a previous transaction.
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?, #test?
Methods included from CreditCardFormatting
Constructor Details
#initialize(options = {}) ⇒ CertoDirectGateway
Creates a new CertoDirectGateway
The gateway requires that a valid login and password be passed in the options
hash.
Options
-
:login
– The CertoDirect Shop ID (REQUIRED) -
:password
– The CertoDirect Shop Password. (REQUIRED) -
:test
–true
orfalse
. If true, perform transactions against the test server. Otherwise, perform transactions against the production server.
28 29 30 31 32 |
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 28 def initialize( = {}) requires!(, :login, :password) @options = super end |
Instance Method Details
#authorize(money, credit_card, 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. -
credit_card
– The CreditCard details for the transaction. -
options
– A hash of optional parameters.
71 72 73 74 75 |
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 71 def (money, credit_card, = {}) requires!(, :email, :currency, :ip, :description) commit((money, credit_card, )) end |
#capture(money, identification, options = {}) ⇒ Object
Captures the funds from an authorized transaction.
Parameters
-
money
– The amount to be captured as an Integer value in cents. -
identification
– The authorization returned from the previous authorize request.
83 84 85 |
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 83 def capture(money, identification, = {}) commit(build_capture_request(money, identification)) end |
#purchase(money, credit_card, 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. -
credit_card
– The CreditCard details for the transaction. -
options
– A hash of optional parameters.
41 42 43 44 45 |
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 41 def purchase(money, credit_card, = {}) requires!(, :email, :currency, :ip, :description) commit(build_sale_request(money, credit_card, )) end |
#recurring(identification, options = {}) ⇒ Object
Create a recurring payment.
Parameters
-
options
– A hash of parameters.
Options
105 106 107 |
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 105 def recurring(identification, ={}) commit(build_recurring_request(identification, )) end |
#refund(money, identification, options = {}) ⇒ Object
Refund a transaction.
This transaction 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 order against which the refund is being issued. -
options
– A hash of parameters.
57 58 59 60 61 |
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 57 def refund(money, identification, = {}) requires!(, :reason) commit(build_refund_request(money, identification, )) end |
#void(money, identification, options = {}) ⇒ Object
Void a previous transaction
Parameters
-
money
– The amount to be captured as an Integer value in cents. -
identification
- The authorization returned from the previous authorize request.
93 94 95 |
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 93 def void(money, identification, = {}) commit(build_void_request(money, identification)) end |