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, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#card_brand, card_brand, #generate_unique_id, inherited, non_fractional_currency?, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_scrubbing?, #test?

Methods included from CreditCardFormatting

#expdate, #format

Methods included from PostsData

included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request

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.



27
28
29
30
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 27

def initialize(options = {})
  requires!(options, :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 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.



81
82
83
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 81

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.



39
40
41
42
43
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 39

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



103
104
105
106
107
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 103

def recurring(identification, options={})
  ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE

  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.



55
56
57
58
59
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 55

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.



91
92
93
# File 'lib/active_merchant/billing/gateways/certo_direct.rb', line 91

def void(money, identification, options = {})
  commit(build_void_request(money, identification))
end