Class: ActiveMerchant::Billing::InstapayGateway

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

Constant Summary collapse

SUCCESS =
"Accepted"
SUCCESS_MESSAGE =
"The transaction has been approved"

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, 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, #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 = {}) ⇒ InstapayGateway

Returns a new instance of InstapayGateway.



22
23
24
25
# File 'lib/active_merchant/billing/gateways/instapay.rb', line 22

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

Instance Method Details

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



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/active_merchant/billing/gateways/instapay.rb', line 27

def authorize(money, creditcard, options = {})
  post = {}
  post[:authonly] = 1
  add_amount(post, money)
  add_invoice(post, options)
  add_creditcard(post, creditcard)
  add_address(post, options)
  add_customer_data(post, options)

  commit('ns_quicksale_cc', post)
end

#capture(money, authorization, options = {}) ⇒ Object



50
51
52
53
54
55
# File 'lib/active_merchant/billing/gateways/instapay.rb', line 50

def capture(money, authorization, options = {})
  post = {}
  add_amount(post, money)
  add_reference(post, authorization)
  commit('ns_quicksale_cc', post)
end

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



39
40
41
42
43
44
45
46
47
48
# File 'lib/active_merchant/billing/gateways/instapay.rb', line 39

def purchase(money, creditcard, options = {})
  post = {}
  add_amount(post, money)
  add_invoice(post, options)
  add_creditcard(post, creditcard)
  add_address(post, options)
  add_customer_data(post, options)

  commit('ns_quicksale_cc', post)
end