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.
27 28 29 30 |
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 27 def initialize( = {}) requires!(, :login, :password) 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.
69 70 71 72 73 |
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 69 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.
81 82 83 |
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 81 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.
39 40 41 42 43 |
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 39 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
103 104 105 |
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 103 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.
55 56 57 58 59 |
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 55 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.
91 92 93 |
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 91 def void(money, identification, = {}) commit(build_void_request(money, identification)) end |