Class: ActiveMerchant::Billing::AxcessmsGateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::AxcessmsGateway
show all
- Includes:
- Empty
- Defined in:
- lib/active_merchant/billing/gateways/axcessms.rb
Constant Summary
collapse
- API_VERSION =
'v1'
- PAYMENT_CODE_PREAUTHORIZATION =
'PA'
- PAYMENT_CODE_DEBIT =
'DB'
- PAYMENT_CODE_CAPTURE =
'CP'
- PAYMENT_CODE_REVERSAL =
'RV'
- PAYMENT_CODE_REFUND =
'RF'
- PAYMENT_CODE_REBILL =
'RB'
- SUCCESS_CODES =
%w[000.000.100 000.000.100 000.100.110]
- SOFT_DECLINE_CODES =
%w{
800.100.201 800.100.203 800.100.204 100.150.204 000.100.204
000.100.205 800.100.205 000.100.221 000.100.223 000.100.225
000.100.226 300.100.100
}.freeze
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
-
#authorize(amount, payment_method, options = {}) ⇒ Object
-
#capture(amount, authorization, options = {}) ⇒ Object
-
#confirm(authorization) ⇒ Object
-
#initialize(options = {}) ⇒ AxcessmsGateway
constructor
A new instance of AxcessmsGateway.
-
#purchase(amount, payment_method, options = {}) ⇒ Object
-
#rebill(amount, authorization, options = {}) ⇒ Object
-
#refund(amount, authorization, options = {}) ⇒ Object
-
#registration_token_purchase(amount, payment_method, options) ⇒ Object
-
#void(amount, authorization, options = {}) ⇒ Object
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?
#expdate, #format
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
Returns a new instance of AxcessmsGateway.
35
36
37
38
39
|
# File 'lib/active_merchant/billing/gateways/axcessms.rb', line 35
def initialize(options = {})
requires!(options, :token, :entityId)
super
@response_http_code = nil
end
|
Instance Method Details
#authorize(amount, payment_method, options = {}) ⇒ Object
41
42
43
44
45
46
47
48
49
|
# File 'lib/active_merchant/billing/gateways/axcessms.rb', line 41
def authorize(amount, payment_method, options = {})
post = {}
add_payment_method(post, payment_method, options)
add_customer_details(post, options)
add_three_d_secure_data(post, amount, options) if options[:three_d_secure_data].present?
add_invoice_details(post, PAYMENT_CODE_PREAUTHORIZATION, amount, options)
add_recurring_details(post, options)
commit(:authorize, post)
end
|
#capture(amount, authorization, options = {}) ⇒ Object
75
76
77
78
79
|
# File 'lib/active_merchant/billing/gateways/axcessms.rb', line 75
def capture(amount, authorization, options = {})
post = {}
add_invoice_details(post, PAYMENT_CODE_CAPTURE, amount, options)
commit(:capture, post, :post, authorization)
end
|
#confirm(authorization) ⇒ Object
93
94
95
96
|
# File 'lib/active_merchant/billing/gateways/axcessms.rb', line 93
def confirm(authorization)
post = {}
commit(:confirm, post, :get, authorization)
end
|
#purchase(amount, payment_method, options = {}) ⇒ Object
51
52
53
54
55
56
57
58
59
|
# File 'lib/active_merchant/billing/gateways/axcessms.rb', line 51
def purchase(amount, payment_method, options = {})
post = {}
add_payment_method(post, payment_method, options)
add_customer_details(post, options)
add_three_d_secure_data(post, amount, options) if options[:three_d_secure_data].present?
add_invoice_details(post, PAYMENT_CODE_DEBIT, amount, options)
add_recurring_details(post, options)
commit(:purchase, post)
end
|
#rebill(amount, authorization, options = {}) ⇒ Object
69
70
71
72
73
|
# File 'lib/active_merchant/billing/gateways/axcessms.rb', line 69
def rebill(amount, authorization, options = {})
post = {}
add_invoice_details(post, PAYMENT_CODE_REBILL, amount, options)
commit(:rebill, post, :post, authorization)
end
|
#refund(amount, authorization, options = {}) ⇒ Object
81
82
83
84
85
|
# File 'lib/active_merchant/billing/gateways/axcessms.rb', line 81
def refund(amount, authorization, options = {})
post = {}
add_invoice_details(post, PAYMENT_CODE_REFUND, amount, options)
commit(:refund, post, :post, authorization)
end
|
#registration_token_purchase(amount, payment_method, options) ⇒ Object
61
62
63
64
65
66
67
|
# File 'lib/active_merchant/billing/gateways/axcessms.rb', line 61
def registration_token_purchase(amount, payment_method, options)
post = {}
add_customer_details(post, options)
add_invoice_details(post, PAYMENT_CODE_DEBIT, amount, options)
add_repeated_recurring_details(post, options)
commit(:registration_token_purchase, post, :post, payment_method)
end
|
#void(amount, authorization, options = {}) ⇒ Object
87
88
89
90
91
|
# File 'lib/active_merchant/billing/gateways/axcessms.rb', line 87
def void(amount, authorization, options = {})
post = {}
add_invoice_details(post, PAYMENT_CODE_REVERSAL, amount, options)
commit(:void, post, :post, authorization)
end
|