activemerchant 1.62.0 → 1.79.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +420 -2
- data/README.md +1 -2
- data/lib/active_merchant/billing/credit_card.rb +13 -14
- data/lib/active_merchant/billing/credit_card_methods.rb +3 -1
- data/lib/active_merchant/billing/gateway.rb +25 -9
- data/lib/active_merchant/billing/gateways/adyen.rb +299 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +168 -56
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +4 -2
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +65 -22
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +87 -7
- data/lib/active_merchant/billing/gateways/beanstream.rb +2 -0
- data/lib/active_merchant/billing/gateways/blue_snap.rb +3 -8
- data/lib/active_merchant/billing/gateways/borgun.rb +10 -10
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +1 -0
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +49 -15
- data/lib/active_merchant/billing/gateways/card_connect.rb +286 -0
- data/lib/active_merchant/billing/gateways/card_stream.rb +97 -2
- data/lib/active_merchant/billing/gateways/cardprocess.rb +254 -0
- data/lib/active_merchant/billing/gateways/cashnet.rb +14 -2
- data/lib/active_merchant/billing/gateways/cenpos.rb +1 -1
- data/lib/active_merchant/billing/gateways/checkout.rb +1 -1
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +44 -14
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +0 -1
- data/lib/active_merchant/billing/gateways/clearhaus.rb +0 -2
- data/lib/active_merchant/billing/gateways/conekta.rb +4 -4
- data/lib/active_merchant/billing/gateways/creditcall.rb +71 -9
- data/lib/active_merchant/billing/gateways/credorax.rb +117 -5
- data/lib/active_merchant/billing/gateways/culqi.rb +279 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +54 -15
- data/lib/active_merchant/billing/gateways/data_cash.rb +12 -0
- data/lib/active_merchant/billing/gateways/dibs.rb +0 -1
- data/lib/active_merchant/billing/gateways/digitzs.rb +292 -0
- data/lib/active_merchant/billing/gateways/ebanx.rb +296 -0
- data/lib/active_merchant/billing/gateways/elavon.rb +37 -95
- data/lib/active_merchant/billing/gateways/element.rb +11 -1
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +3 -29
- data/lib/active_merchant/billing/gateways/first_pay.rb +12 -10
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +37 -20
- data/lib/active_merchant/billing/gateways/forte.rb +0 -1
- data/lib/active_merchant/billing/gateways/global_collect.rb +55 -16
- data/lib/active_merchant/billing/gateways/global_transport.rb +16 -2
- data/lib/active_merchant/billing/gateways/hps.rb +12 -1
- data/lib/active_merchant/billing/gateways/iats_payments.rb +2 -2
- data/lib/active_merchant/billing/gateways/iveri.rb +251 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +12 -9
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +437 -0
- data/lib/active_merchant/billing/gateways/kushki.rb +227 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +2 -2
- data/lib/active_merchant/billing/gateways/litle.rb +107 -30
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +262 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +11 -0
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +16 -4
- data/lib/active_merchant/billing/gateways/mercury.rb +14 -1
- data/lib/active_merchant/billing/gateways/migs.rb +28 -6
- data/lib/active_merchant/billing/gateways/moneris.rb +20 -12
- data/lib/active_merchant/billing/gateways/moneris_us.rb +11 -0
- data/lib/active_merchant/billing/gateways/mundipagg.rb +292 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +4 -4
- data/lib/active_merchant/billing/gateways/netbanx.rb +60 -16
- data/lib/active_merchant/billing/gateways/netbilling.rb +0 -1
- data/lib/active_merchant/billing/gateways/nmi.rb +12 -1
- data/lib/active_merchant/billing/gateways/ogone.rb +1 -1
- data/lib/active_merchant/billing/gateways/omise.rb +9 -5
- data/lib/active_merchant/billing/gateways/openpay.rb +13 -0
- data/lib/active_merchant/billing/gateways/opp.rb +124 -114
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +14 -1
- data/lib/active_merchant/billing/gateways/orbital.rb +83 -14
- data/lib/active_merchant/billing/gateways/pay_hub.rb +2 -2
- data/lib/active_merchant/billing/gateways/payeezy.rb +152 -46
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +12 -2
- data/lib/active_merchant/billing/gateways/payflow.rb +24 -2
- data/lib/active_merchant/billing/gateways/payment_express.rb +3 -2
- data/lib/active_merchant/billing/gateways/paymentez.rb +276 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +18 -10
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +14 -0
- data/lib/active_merchant/billing/gateways/paypal.rb +0 -12
- data/lib/active_merchant/billing/gateways/paystation.rb +14 -1
- data/lib/active_merchant/billing/gateways/payu_latam.rb +102 -62
- data/lib/active_merchant/billing/gateways/pin.rb +5 -0
- data/lib/active_merchant/billing/gateways/pro_pay.rb +326 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +12 -1
- data/lib/active_merchant/billing/gateways/qbms.rb +11 -0
- data/lib/active_merchant/billing/gateways/quickbooks.rb +10 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +21 -17
- data/lib/active_merchant/billing/gateways/quickpay.rb +3 -3
- data/lib/active_merchant/billing/gateways/qvalent.rb +60 -3
- data/lib/active_merchant/billing/gateways/realex.rb +16 -6
- data/lib/active_merchant/billing/gateways/redsys.rb +8 -2
- data/lib/active_merchant/billing/gateways/safe_charge.rb +262 -0
- data/lib/active_merchant/billing/gateways/sage.rb +8 -3
- data/lib/active_merchant/billing/gateways/sage_pay.rb +29 -13
- data/lib/active_merchant/billing/gateways/secure_net.rb +11 -1
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +12 -0
- data/lib/active_merchant/billing/gateways/smart_ps.rb +1 -1
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +53 -7
- data/lib/active_merchant/billing/gateways/stripe.rb +84 -26
- data/lib/active_merchant/billing/gateways/tns.rb +0 -1
- data/lib/active_merchant/billing/gateways/trans_first.rb +3 -2
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +61 -26
- data/lib/active_merchant/billing/gateways/trexle.rb +217 -0
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +114 -9
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +45 -22
- data/lib/active_merchant/billing/gateways/vanco.rb +1 -1
- data/lib/active_merchant/billing/gateways/wepay.rb +79 -46
- data/lib/active_merchant/billing/gateways/wirecard.rb +5 -4
- data/lib/active_merchant/billing/gateways/worldpay.rb +85 -20
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +27 -8
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +1 -1
- data/lib/active_merchant/connection.rb +48 -12
- data/lib/active_merchant/net_http_ssl_connection.rb +9 -0
- data/lib/active_merchant/network_connection_retries.rb +6 -4
- data/lib/active_merchant/posts_data.rb +11 -1
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +2 -5
- data/lib/certs/cacert.pem +85 -0
- data/lib/support/ssl_version.rb +87 -0
- metadata +25 -9
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
@@ -0,0 +1,276 @@
|
|
1
|
+
require 'base64'
|
2
|
+
require 'digest'
|
3
|
+
|
4
|
+
module ActiveMerchant #:nodoc:
|
5
|
+
module Billing #:nodoc:
|
6
|
+
class PaymentezGateway < Gateway #:nodoc:
|
7
|
+
self.test_url = 'https://ccapi-stg.paymentez.com/v2/'
|
8
|
+
self.live_url = 'https://ccapi.paymentez.com/v2/'
|
9
|
+
|
10
|
+
self.supported_countries = %w[MX EC VE CO BR CL]
|
11
|
+
self.default_currency = 'USD'
|
12
|
+
self.supported_cardtypes = %i[visa master american_express diners_club]
|
13
|
+
|
14
|
+
self.homepage_url = 'https://secure.paymentez.com/'
|
15
|
+
self.display_name = 'Paymentez'
|
16
|
+
|
17
|
+
STANDARD_ERROR_CODE_MAPPING = {
|
18
|
+
1 => :processing_error,
|
19
|
+
6 => :card_declined,
|
20
|
+
9 => :card_declined,
|
21
|
+
10 => :processing_error,
|
22
|
+
11 => :card_declined,
|
23
|
+
12 => :config_error,
|
24
|
+
13 => :config_error,
|
25
|
+
19 => :invalid_cvc,
|
26
|
+
20 => :config_error,
|
27
|
+
21 => :card_declined,
|
28
|
+
22 => :card_declined,
|
29
|
+
23 => :card_declined,
|
30
|
+
24 => :card_declined,
|
31
|
+
25 => :card_declined,
|
32
|
+
26 => :card_declined,
|
33
|
+
27 => :card_declined,
|
34
|
+
28 => :card_declined
|
35
|
+
}.freeze
|
36
|
+
|
37
|
+
CARD_MAPPING = {
|
38
|
+
'visa' => 'vi',
|
39
|
+
'master' => 'mc',
|
40
|
+
'american_express' => 'ax',
|
41
|
+
'diners_club' => 'di'
|
42
|
+
}.freeze
|
43
|
+
|
44
|
+
def initialize(options = {})
|
45
|
+
requires!(options, :application_code, :app_key)
|
46
|
+
super
|
47
|
+
end
|
48
|
+
|
49
|
+
def purchase(money, payment, options = {})
|
50
|
+
post = {}
|
51
|
+
|
52
|
+
add_invoice(post, money, options)
|
53
|
+
add_payment(post, payment)
|
54
|
+
add_customer_data(post, options)
|
55
|
+
action = payment.is_a?(String) ? 'debit' : 'debit_cc'
|
56
|
+
|
57
|
+
commit_transaction(action, post)
|
58
|
+
end
|
59
|
+
|
60
|
+
def authorize(money, payment, options = {})
|
61
|
+
post = {}
|
62
|
+
|
63
|
+
add_invoice(post, money, options)
|
64
|
+
add_payment(post, payment)
|
65
|
+
add_customer_data(post, options)
|
66
|
+
|
67
|
+
commit_transaction('authorize', post)
|
68
|
+
end
|
69
|
+
|
70
|
+
def capture(_money, authorization, _options = {})
|
71
|
+
post = { transaction: { id: authorization } }
|
72
|
+
|
73
|
+
commit_transaction('capture', post)
|
74
|
+
end
|
75
|
+
|
76
|
+
def refund(_money, authorization, options = {})
|
77
|
+
void(authorization, options)
|
78
|
+
end
|
79
|
+
|
80
|
+
def void(authorization, _options = {})
|
81
|
+
post = { transaction: { id: authorization } }
|
82
|
+
commit_transaction('refund', post)
|
83
|
+
end
|
84
|
+
|
85
|
+
def verify(credit_card, options = {})
|
86
|
+
MultiResponse.run do |r|
|
87
|
+
r.process { authorize(100, credit_card, options) }
|
88
|
+
r.process { void(r.authorization, options) }
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def store(credit_card, options = {})
|
93
|
+
post = {}
|
94
|
+
|
95
|
+
add_customer_data(post, options)
|
96
|
+
add_payment(post, credit_card)
|
97
|
+
|
98
|
+
response = commit_card('add', post)
|
99
|
+
if !response.success? && !(token = extract_previous_card_token(response)).nil?
|
100
|
+
unstore(token, options)
|
101
|
+
response = commit_card('add', post)
|
102
|
+
end
|
103
|
+
response
|
104
|
+
end
|
105
|
+
|
106
|
+
def unstore(identification, options = {})
|
107
|
+
post = { card: { token: identification }, user: { id: options[:user_id] }}
|
108
|
+
commit_card('delete', post)
|
109
|
+
end
|
110
|
+
|
111
|
+
def supports_scrubbing?
|
112
|
+
true
|
113
|
+
end
|
114
|
+
|
115
|
+
def scrub(transcript)
|
116
|
+
transcript
|
117
|
+
.gsub(%r{(\\?"number\\?":)(\\?"[^"]+\\?")}, '\1[FILTERED]')
|
118
|
+
.gsub(%r{(\\?"cvc\\?":)(\\?"[^"]+\\?")}, '\1[FILTERED]')
|
119
|
+
.gsub(%r{(Auth-Token: )([A-Za-z0-9=]+)}, '\1[FILTERED]')
|
120
|
+
end
|
121
|
+
|
122
|
+
private
|
123
|
+
|
124
|
+
def add_customer_data(post, options)
|
125
|
+
requires!(options, :user_id, :email)
|
126
|
+
post[:user] ||= {}
|
127
|
+
post[:user][:id] = options[:user_id]
|
128
|
+
post[:user][:email] = options[:email]
|
129
|
+
post[:user][:ip_address] = options[:ip] if options[:ip]
|
130
|
+
post[:user][:fiscal_number] = options[:fiscal_number] if options[:fiscal_number]
|
131
|
+
end
|
132
|
+
|
133
|
+
def add_invoice(post, money, options)
|
134
|
+
post[:session_id] = options[:session_id] if options[:session_id]
|
135
|
+
|
136
|
+
post[:order] ||= {}
|
137
|
+
post[:order][:amount] = amount(money).to_f
|
138
|
+
post[:order][:vat] = options[:vat] if options[:vat]
|
139
|
+
post[:order][:dev_reference] = options[:dev_reference] if options[:dev_reference]
|
140
|
+
post[:order][:description] = options[:description] if options[:description]
|
141
|
+
post[:order][:discount] = options[:discount] if options[:discount]
|
142
|
+
post[:order][:installments] = options[:installments] if options[:installments]
|
143
|
+
post[:order][:installments_type] = options[:installments_type] if options[:installments_type]
|
144
|
+
post[:order][:taxable_amount] = options[:taxable_amount] if options[:taxable_amount]
|
145
|
+
post[:order][:tax_percentage] = options[:tax_percentage] if options[:tax_percentage]
|
146
|
+
end
|
147
|
+
|
148
|
+
def add_payment(post, payment)
|
149
|
+
post[:card] ||= {}
|
150
|
+
if payment.is_a?(String)
|
151
|
+
post[:card][:token] = payment
|
152
|
+
else
|
153
|
+
post[:card][:number] = payment.number
|
154
|
+
post[:card][:holder_name] = payment.name
|
155
|
+
post[:card][:expiry_month] = payment.month
|
156
|
+
post[:card][:expiry_year] = payment.year
|
157
|
+
post[:card][:cvc] = payment.verification_value
|
158
|
+
post[:card][:type] = CARD_MAPPING[payment.brand]
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
def parse(body)
|
163
|
+
JSON.parse(body)
|
164
|
+
end
|
165
|
+
|
166
|
+
def commit_raw(object, action, parameters)
|
167
|
+
url = "#{(test? ? test_url : live_url)}#{object}/#{action}"
|
168
|
+
|
169
|
+
begin
|
170
|
+
raw_response = ssl_post(url, post_data(parameters), headers)
|
171
|
+
rescue ResponseError => e
|
172
|
+
raw_response = e.response.body
|
173
|
+
end
|
174
|
+
parse(raw_response)
|
175
|
+
end
|
176
|
+
|
177
|
+
def commit_transaction(action, parameters)
|
178
|
+
response = commit_raw('transaction', action, parameters)
|
179
|
+
Response.new(
|
180
|
+
success_from(response),
|
181
|
+
message_from(response),
|
182
|
+
response,
|
183
|
+
authorization: authorization_from(response),
|
184
|
+
test: test?,
|
185
|
+
error_code: error_code_from(response)
|
186
|
+
)
|
187
|
+
end
|
188
|
+
|
189
|
+
def commit_card(action, parameters)
|
190
|
+
response = commit_raw('card', action, parameters)
|
191
|
+
Response.new(
|
192
|
+
card_success_from(response),
|
193
|
+
card_message_from(response),
|
194
|
+
response,
|
195
|
+
authorization: card_authorization_from(response),
|
196
|
+
test: test?,
|
197
|
+
error_code: card_error_code_from(response)
|
198
|
+
)
|
199
|
+
end
|
200
|
+
|
201
|
+
def headers
|
202
|
+
{
|
203
|
+
'Auth-Token' => authentication_code,
|
204
|
+
'Content-Type' => 'application/json'
|
205
|
+
}
|
206
|
+
end
|
207
|
+
|
208
|
+
def success_from(response)
|
209
|
+
!response.include?('error') && (response['status'] || response['transaction']['status']) == 'success'
|
210
|
+
end
|
211
|
+
|
212
|
+
def card_success_from(response)
|
213
|
+
return false if response.include?('error')
|
214
|
+
return true if response['message'] == 'card deleted'
|
215
|
+
response['card']['status'] == 'valid'
|
216
|
+
end
|
217
|
+
|
218
|
+
def message_from(response)
|
219
|
+
if !success_from(response) && response['error']
|
220
|
+
response['error'] && response['error']['type']
|
221
|
+
else
|
222
|
+
response['transaction'] && response['transaction']['message']
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
def card_message_from(response)
|
227
|
+
if !response.include?('error')
|
228
|
+
response['message'] || response['card']['message']
|
229
|
+
else
|
230
|
+
response['error']['type']
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
def authorization_from(response)
|
235
|
+
response['transaction'] && response['transaction']['id']
|
236
|
+
end
|
237
|
+
|
238
|
+
def card_authorization_from(response)
|
239
|
+
response['card'] && response['card']['token']
|
240
|
+
end
|
241
|
+
|
242
|
+
def extract_previous_card_token(response)
|
243
|
+
match = /Card already added: (\d+)/.match(response.message)
|
244
|
+
match && match[1]
|
245
|
+
end
|
246
|
+
|
247
|
+
def post_data(parameters = {})
|
248
|
+
JSON.dump(parameters)
|
249
|
+
end
|
250
|
+
|
251
|
+
def error_code_from(response)
|
252
|
+
return if success_from(response)
|
253
|
+
if response['transaction']
|
254
|
+
detail = response['transaction']['status_detail']
|
255
|
+
if STANDARD_ERROR_CODE_MAPPING.include?(detail)
|
256
|
+
return STANDARD_ERROR_CODE[STANDARD_ERROR_CODE_MAPPING[detail]]
|
257
|
+
end
|
258
|
+
elsif response['error']
|
259
|
+
return STANDARD_ERROR_CODE[:config_error]
|
260
|
+
end
|
261
|
+
STANDARD_ERROR_CODE[:processing_error]
|
262
|
+
end
|
263
|
+
|
264
|
+
def card_error_code_from(response)
|
265
|
+
STANDARD_ERROR_CODE[:processing_error] unless card_success_from(response)
|
266
|
+
end
|
267
|
+
|
268
|
+
def authentication_code
|
269
|
+
timestamp = Time.new.to_i
|
270
|
+
unique_token = Digest::SHA256.hexdigest("#{@options[:app_key]}#{timestamp}")
|
271
|
+
authentication_string = "#{@options[:application_code]};#{timestamp};#{unique_token}"
|
272
|
+
Base64.encode64(authentication_string).delete("\n")
|
273
|
+
end
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|
@@ -17,7 +17,7 @@ module ActiveMerchant #:nodoc:
|
|
17
17
|
super
|
18
18
|
end
|
19
19
|
|
20
|
-
def purchase(money, payment_method, options
|
20
|
+
def purchase(money, payment_method, options={})
|
21
21
|
action_with_token(:purchase, money, payment_method, options)
|
22
22
|
end
|
23
23
|
|
@@ -48,7 +48,7 @@ module ActiveMerchant #:nodoc:
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def store(credit_card, options={})
|
51
|
-
save_card(credit_card)
|
51
|
+
save_card(credit_card, options)
|
52
52
|
end
|
53
53
|
|
54
54
|
def supports_scrubbing
|
@@ -74,11 +74,15 @@ module ActiveMerchant #:nodoc:
|
|
74
74
|
|
75
75
|
private
|
76
76
|
|
77
|
-
def add_credit_card(post, credit_card)
|
77
|
+
def add_credit_card(post, credit_card, options)
|
78
|
+
post['account.holder'] = (credit_card.try(:name) || "")
|
78
79
|
post['account.number'] = credit_card.number
|
79
80
|
post['account.expiry.month'] = sprintf("%.2i", credit_card.month)
|
80
81
|
post['account.expiry.year'] = sprintf("%.4i", credit_card.year)
|
81
82
|
post['account.verification'] = credit_card.verification_value
|
83
|
+
post['account.email'] = (options[:email] || nil)
|
84
|
+
post['presentation.amount3D'] = (options[:money] || nil)
|
85
|
+
post['presentation.currency3D'] = (options[:currency] || currency( options[:money]))
|
82
86
|
end
|
83
87
|
|
84
88
|
def headers
|
@@ -122,12 +126,13 @@ module ActiveMerchant #:nodoc:
|
|
122
126
|
end
|
123
127
|
|
124
128
|
def action_with_token(action, money, payment_method, options)
|
129
|
+
options[:money] = money
|
125
130
|
case payment_method
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
r.process { save_card(payment_method) }
|
131
|
+
when String
|
132
|
+
self.send("#{action}_with_token", money, payment_method, options)
|
133
|
+
else
|
134
|
+
MultiResponse.run do |r|
|
135
|
+
r.process { save_card(payment_method, options) }
|
131
136
|
r.process { self.send("#{action}_with_token", money, r.authorization, options) }
|
132
137
|
end
|
133
138
|
end
|
@@ -153,10 +158,10 @@ module ActiveMerchant #:nodoc:
|
|
153
158
|
commit(:post, 'preauthorizations', post)
|
154
159
|
end
|
155
160
|
|
156
|
-
def save_card(credit_card)
|
161
|
+
def save_card(credit_card, options)
|
157
162
|
post = {}
|
158
163
|
|
159
|
-
add_credit_card(post, credit_card)
|
164
|
+
add_credit_card(post, credit_card, options)
|
160
165
|
post['channel.id'] = @options[:public_key]
|
161
166
|
post['jsonPFunction'] = 'jsonPFunction'
|
162
167
|
post['transaction.mode'] = (test? ? 'CONNECTOR_TEST' : 'LIVE')
|
@@ -219,6 +224,7 @@ module ActiveMerchant #:nodoc:
|
|
219
224
|
20203 => "Reversed due to complaint by buyer",
|
220
225
|
20204 => "Payment has been refunded",
|
221
226
|
20300 => "Reversal has been canceled",
|
227
|
+
22000 => "Initiation of transaction successful",
|
222
228
|
|
223
229
|
30000 => "Transaction still in progress",
|
224
230
|
30100 => "Transaction has been accepted",
|
@@ -258,6 +264,8 @@ module ActiveMerchant #:nodoc:
|
|
258
264
|
40420 => "Problem with address data",
|
259
265
|
40500 => "Permission error with acquirer API",
|
260
266
|
40510 => "Rate limit reached for acquirer API",
|
267
|
+
42000 => "Initiation of transaction failed",
|
268
|
+
42410 => "Initiation of transaction expired",
|
261
269
|
|
262
270
|
50000 => "Problem with back end",
|
263
271
|
50001 => "Country blacklisted",
|
@@ -269,7 +269,21 @@ module ActiveMerchant #:nodoc:
|
|
269
269
|
commit 'ManagePendingTransactionStatus', build_manage_pending_transaction_status(transaction_id, action)
|
270
270
|
end
|
271
271
|
|
272
|
+
def supports_scrubbing?
|
273
|
+
true
|
274
|
+
end
|
275
|
+
|
276
|
+
def scrub(transcript)
|
277
|
+
transcript.
|
278
|
+
gsub(%r((<n1:Password>).+(</n1:Password>)), '\1[FILTERED]\2').
|
279
|
+
gsub(%r((<n1:Username>).+(</n1:Username>)), '\1[FILTERED]\2').
|
280
|
+
gsub(%r((<n1:Signature>).+(</n1:Signature>)), '\1[FILTERED]\2').
|
281
|
+
gsub(%r((<n2:CreditCardNumber>).+(</n2:CreditCardNumber)), '\1[FILTERED]\2').
|
282
|
+
gsub(%r((<n2:CVV2>)\d+(</n2:CVV2)), '\1[FILTERED]\2')
|
283
|
+
end
|
284
|
+
|
272
285
|
private
|
286
|
+
|
273
287
|
def build_request_wrapper(action, options = {})
|
274
288
|
xml = Builder::XmlMarkup.new :indent => 2
|
275
289
|
xml.tag! action + 'Req', 'xmlns' => PAYPAL_NAMESPACE do
|
@@ -38,18 +38,6 @@ module ActiveMerchant #:nodoc:
|
|
38
38
|
@express ||= PaypalExpressGateway.new(@options)
|
39
39
|
end
|
40
40
|
|
41
|
-
def supports_scrubbing?
|
42
|
-
true
|
43
|
-
end
|
44
|
-
|
45
|
-
def scrub(transcript)
|
46
|
-
transcript.
|
47
|
-
gsub(%r((<n1:Password>).+(</n1:Password>)), '\1[FILTERED]\2').
|
48
|
-
gsub(%r((<n1:Username>).+(</n1:Username>)), '\1[FILTERED]\2').
|
49
|
-
gsub(%r((<n2:CreditCardNumber>).+(</n2:CreditCardNumber)), '\1[FILTERED]\2').
|
50
|
-
gsub(%r((<n2:CVV2>)\d+(</n2:CVV2)), '\1[FILTERED]\2')
|
51
|
-
end
|
52
|
-
|
53
41
|
private
|
54
42
|
|
55
43
|
def define_transaction_type(transaction_arg)
|
@@ -75,7 +75,6 @@ module ActiveMerchant #:nodoc:
|
|
75
75
|
commit(post)
|
76
76
|
end
|
77
77
|
|
78
|
-
|
79
78
|
def refund(money, authorization, options={})
|
80
79
|
post = new_request
|
81
80
|
add_amount(post, money, options)
|
@@ -85,6 +84,20 @@ module ActiveMerchant #:nodoc:
|
|
85
84
|
commit(post)
|
86
85
|
end
|
87
86
|
|
87
|
+
def verify(credit_card, options={})
|
88
|
+
authorize(0, credit_card, options)
|
89
|
+
end
|
90
|
+
|
91
|
+
def supports_scrubbing?
|
92
|
+
true
|
93
|
+
end
|
94
|
+
|
95
|
+
def scrub(transcript)
|
96
|
+
transcript.
|
97
|
+
gsub(%r((pstn_cn=)\d*), '\1[FILTERED]').
|
98
|
+
gsub(%r((pstn_cc=)\d*), '\1[FILTERED]')
|
99
|
+
end
|
100
|
+
|
88
101
|
private
|
89
102
|
|
90
103
|
def new_request
|