Class: ActiveMerchant::Billing::NetbanxGateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::NetbanxGateway
show all
- Defined in:
- lib/active_merchant/billing/gateways/netbanx.rb
Constant Summary
collapse
- STANDARD_ERROR_CODE_MAPPING =
{}
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
-
#authorize(money, payment, options = {}) ⇒ Object
-
#capture(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ NetbanxGateway
constructor
A new instance of NetbanxGateway.
-
#purchase(money, payment, options = {}) ⇒ Object
-
#refund(money, authorization, options = {}) ⇒ Object
-
#scrub(transcript) ⇒ Object
-
#store(credit_card, options = {}) ⇒ Object
note: when passing options we only attempt to add the card to the profile_id passed as the options.
-
#supports_scrubbing? ⇒ Boolean
-
#unstore(identification, options = {}) ⇒ Object
-
#verify(credit_card, options = {}) ⇒ Object
-
#void(authorization, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, #generate_unique_id, inherited, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #test?
#format
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
Returns a new instance of NetbanxGateway.
18
19
20
21
|
# File 'lib/active_merchant/billing/gateways/netbanx.rb', line 18
def initialize(options={})
requires!(options, :account_number, :api_key)
super
end
|
Instance Method Details
#authorize(money, payment, options = {}) ⇒ Object
32
33
34
35
36
37
38
|
# File 'lib/active_merchant/billing/gateways/netbanx.rb', line 32
def authorize(money, payment, options={})
post = {}
add_invoice(post, money, options)
add_payment(post, payment)
commit(:post, 'auths', post)
end
|
#capture(money, authorization, options = {}) ⇒ Object
40
41
42
43
44
45
|
# File 'lib/active_merchant/billing/gateways/netbanx.rb', line 40
def capture(money, authorization, options={})
post = {}
add_invoice(post, money, options)
commit(:post, "auths/#{authorization}/settlements", post)
end
|
#purchase(money, payment, options = {}) ⇒ Object
23
24
25
26
27
28
29
30
|
# File 'lib/active_merchant/billing/gateways/netbanx.rb', line 23
def purchase(money, payment, options={})
post = {}
add_invoice(post, money, options)
add_settle_with_auth(post)
add_payment(post, payment)
commit(:post, 'auths', post)
end
|
#refund(money, authorization, options = {}) ⇒ Object
47
48
49
50
51
52
|
# File 'lib/active_merchant/billing/gateways/netbanx.rb', line 47
def refund(money, authorization, options={})
post = {}
add_invoice(post, money, options)
commit(:post, "settlements/#{authorization}/refunds", post)
end
|
#scrub(transcript) ⇒ Object
97
98
99
100
101
102
|
# File 'lib/active_merchant/billing/gateways/netbanx.rb', line 97
def scrub(transcript)
transcript.
gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
gsub(%r(("card\\?":{\\?"cardNum\\?":\\?")\d+), '\1[FILTERED]').
gsub(%r(("cvv\\?":\\?")\d+), '\1[FILTERED]')
end
|
#store(credit_card, options = {}) ⇒ Object
note: when passing options we only attempt to add the
card to the profile_id passed as the options[:customer]
71
72
73
74
75
76
77
78
79
|
# File 'lib/active_merchant/billing/gateways/netbanx.rb', line 71
def store(credit_card, options={})
requires!(options, :locale)
post = {}
add_credit_card(post, credit_card, options)
add_customer_data(post, options)
commit(:post, 'customervault/v1/profiles', post)
end
|
#supports_scrubbing? ⇒ Boolean
93
94
95
|
# File 'lib/active_merchant/billing/gateways/netbanx.rb', line 93
def supports_scrubbing?
true
end
|
#unstore(identification, options = {}) ⇒ Object
81
82
83
84
85
86
87
88
89
90
91
|
# File 'lib/active_merchant/billing/gateways/netbanx.rb', line 81
def unstore(identification, options = {})
customer_id, card_id = identification.split('|')
if card_id.nil?
commit(:delete, "customervault/v1/profiles/#{CGI.escape(customer_id)}", nil)
else
commit(:delete, "customervault/v1/profiles/#{CGI.escape(customer_id)}/cards/#{CGI.escape(card_id)}", nil)
end
end
|
#verify(credit_card, options = {}) ⇒ Object
61
62
63
64
65
66
67
|
# File 'lib/active_merchant/billing/gateways/netbanx.rb', line 61
def verify(credit_card, options={})
post = {}
add_payment(post, credit_card)
add_order_id(post, options)
commit(:post, 'verifications', post)
end
|
#void(authorization, options = {}) ⇒ Object
54
55
56
57
58
59
|
# File 'lib/active_merchant/billing/gateways/netbanx.rb', line 54
def void(authorization, options={})
post = {}
add_order_id(post, options)
commit(:post, "auths/#{authorization}/voidauths", post)
end
|