Class: ActiveMerchant::Billing::PaywayDotComGateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::PaywayDotComGateway
show all
- Defined in:
- lib/active_merchant/billing/gateways/payway_dot_com.rb
Constant Summary
collapse
- STANDARD_ERROR_CODE_MAPPING =
{
'5012' => STANDARD_ERROR_CODE[:card_declined],
'5035' => STANDARD_ERROR_CODE[:invalid_number],
'5037' => STANDARD_ERROR_CODE[:invalid_expiry_date],
'5045' => STANDARD_ERROR_CODE[:incorrect_zip]
}
- AVS_MAPPING =
Payway to standard AVSResult codes.
{
'N1' => 'I', 'N2' => 'I', '““' => 'R', 'IU' => 'G', 'ID' => 'S', 'IE' => 'E', 'IS' => 'R', 'IB' => 'B', 'IC' => 'C', 'IP' => 'P', 'A1' => 'K', 'A3' => 'V', 'A4' => 'L', 'A7' => 'O', 'B3' => 'H', 'B4' => 'F', 'B7' => 'T', 'B8' => 'N', '??' => 'R', 'I1' => 'X', 'I2' => 'W', 'I3' => 'Y', 'I4' => 'Z', 'I5' => 'M', 'I6' => 'W', 'I7' => 'A', 'I8' => 'C' }
- PAYWAY_WS_SUCCESS =
'5000'
- SCRUB_PATTERNS =
[
%r(("password\\?":\\?")[^\\]+),
%r(("fsv\\?":\\?")\d+),
%r(("fsv\\?": \\?")\d+),
%r(("accountNumber\\?":\\?")\d+),
%r(("accountNumber\\?": \\?")[^\\]+),
%r(("Invalid account number: )\d+)
].freeze
- SCRUB_REPLACEMENT =
'\1[FILTERED]'
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, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #test?
#format, #strftime_yyyymm
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
Returns a new instance of PaywayDotComGateway.
67
68
69
70
|
# File 'lib/active_merchant/billing/gateways/payway_dot_com.rb', line 67
def initialize(options = {})
requires!(options, :login, :password, :company_id, :source_id)
super
end
|
Instance Method Details
#authorize(money, payment, options = {}) ⇒ Object
82
83
84
85
86
87
88
89
90
|
# File 'lib/active_merchant/billing/gateways/payway_dot_com.rb', line 82
def authorize(money, payment, options = {})
post = {}
add_common(post, options)
add_card_payment(post, payment, options)
add_card_transaction_details(post, money, options)
add_address(post, payment, options)
commit('authorize', post)
end
|
#capture(money, authorization, options = {}) ⇒ Object
92
93
94
95
96
97
98
|
# File 'lib/active_merchant/billing/gateways/payway_dot_com.rb', line 92
def capture(money, authorization, options = {})
post = {}
add_common(post, options)
add_card_transaction_name(post, authorization, options)
commit('capture', post)
end
|
#credit(money, payment, options = {}) ⇒ Object
100
101
102
103
104
105
106
107
108
|
# File 'lib/active_merchant/billing/gateways/payway_dot_com.rb', line 100
def credit(money, payment, options = {})
post = {}
add_common(post, options)
add_card_payment(post, payment, options)
add_card_transaction_details(post, money, options)
add_address(post, payment, options)
commit('credit', post)
end
|
#purchase(money, payment, options = {}) ⇒ Object
72
73
74
75
76
77
78
79
80
|
# File 'lib/active_merchant/billing/gateways/payway_dot_com.rb', line 72
def purchase(money, payment, options = {})
post = {}
add_common(post, options)
add_card_payment(post, payment, options)
add_card_transaction_details(post, money, options)
add_address(post, payment, options)
commit('sale', post)
end
|
#scrub(transcript) ⇒ Object
122
123
124
125
126
|
# File 'lib/active_merchant/billing/gateways/payway_dot_com.rb', line 122
def scrub(transcript)
SCRUB_PATTERNS.inject(transcript) do |text, pattern|
text.gsub(pattern, SCRUB_REPLACEMENT)
end
end
|
#supports_scrubbing? ⇒ Boolean
118
119
120
|
# File 'lib/active_merchant/billing/gateways/payway_dot_com.rb', line 118
def supports_scrubbing?
true
end
|
#void(authorization, options = {}) ⇒ Object
110
111
112
113
114
115
116
|
# File 'lib/active_merchant/billing/gateways/payway_dot_com.rb', line 110
def void(authorization, options = {})
post = {}
add_common(post, options)
add_card_transaction_name(post, authorization, options)
commit('void', post)
end
|