Class: ActiveMerchant::Billing::SecurePayTechGateway

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

Defined Under Namespace

Classes: SecurePayTechPostData

Constant Summary collapse

PAYMENT_GATEWAY_RESPONSES =
{
  1 => 'Transaction OK',
  2 => 'Insufficient funds',
  3 => 'Card expired',
  4 => 'Card declined',
  5 => 'Server error',
  6 => 'Communications error',
  7 => 'Unsupported transaction type',
  8 => 'Bad or malformed request',
  9 => 'Invalid card number'
}

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, #strftime_yyyymm

Methods included from PostsData

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

Constructor Details

#initialize(options = {}) ⇒ SecurePayTechGateway

Returns a new instance of SecurePayTechGateway.



28
29
30
31
# File 'lib/active_merchant/billing/gateways/secure_pay_tech.rb', line 28

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

Instance Method Details

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



33
34
35
36
37
38
39
40
# File 'lib/active_merchant/billing/gateways/secure_pay_tech.rb', line 33

def purchase(money, creditcard, options = {})
  post = SecurePayTechPostData.new

  add_invoice(post, money, options)
  add_creditcard(post, creditcard)

  commit(:purchase, post)
end