Class: ActiveMerchant::Billing::SecurePayGateway

Inherits:
Gateway
  • Object
show all
Defined in:
lib/active_merchant/billing/gateways/secure_pay.rb

Constant Summary collapse

API_VERSION =
'3.1'
CARD_CODE_ERRORS =
%w(N S)
AVS_ERRORS =
%w(A E N R W Z)
AVS_REASON_CODES =
%w(27 45)
TRANSACTION_ALREADY_ACTIONED =
%w(310 311)

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#add_field_to_post_if_present, #add_fields_to_post_if_present, card_brand, #card_brand, #generate_unique_id, inherited, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #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 = {}) ⇒ SecurePayGateway

Returns a new instance of SecurePayGateway.



29
30
31
32
# File 'lib/active_merchant/billing/gateways/secure_pay.rb', line 29

def initialize(options = {})
  requires!(options, :login, :password)
  super
end

Instance Method Details

#purchase(money, paysource, options = {}) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/active_merchant/billing/gateways/secure_pay.rb', line 34

def purchase(money, paysource, options = {})
  post = {}
  add_currency_code(post, money, options)
  add_invoice(post, options)
  add_payment_source(post, paysource, options)
  add_address(post, options)
  add_customer_data(post, options)
  add_duplicate_window(post)

  commit('AUTH_CAPTURE', money, post)
end