Class: ActiveMerchant::Billing::CertoDirectGateway

Inherits:
Gateway
  • Object
show all
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

#options

Instance Method Summary collapse

Methods inherited from Gateway

#card_brand, card_brand, inherited, supports?, #test?

Methods included from CreditCardFormatting

#format

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)

  • :testtrue or false. 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(options = {})
  requires!(options, :login, :password)
  @options = 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 authorize(money, credit_card, options = {})
  requires!(options, :email, :currency, :ip, :description)

  commit(build_authorize_request(money, credit_card, options))
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, options = {})
  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, options = {})
  requires!(options, :email, :currency, :ip, :description)

  commit(build_sale_request(money, credit_card, options))
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, options={})
  commit(build_recurring_request(identification, options))
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, options = {})
  requires!(options, :reason)

  commit(build_refund_request(money, identification, options))
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, options = {})
  commit(build_void_request(money, identification))
end