activemerchant 1.83.0 → 1.84.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +19 -0
- data/lib/active_merchant/billing/base.rb +1 -1
- data/lib/active_merchant/billing/check.rb +3 -2
- data/lib/active_merchant/billing/compatibility.rb +2 -4
- data/lib/active_merchant/billing/credit_card.rb +6 -39
- data/lib/active_merchant/billing/credit_card_formatting.rb +0 -1
- data/lib/active_merchant/billing/credit_card_methods.rb +67 -44
- data/lib/active_merchant/billing/gateway.rb +1 -8
- data/lib/active_merchant/billing/gateways/adyen.rb +1 -1
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +0 -1
- data/lib/active_merchant/billing/gateways/authorize_net.rb +0 -1
- data/lib/active_merchant/billing/gateways/axcessms.rb +1 -1
- data/lib/active_merchant/billing/gateways/balanced.rb +9 -9
- data/lib/active_merchant/billing/gateways/banwire.rb +5 -5
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/beanstream.rb +1 -0
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +0 -1
- data/lib/active_merchant/billing/gateways/blue_snap.rb +5 -7
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +12 -6
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +0 -1
- data/lib/active_merchant/billing/gateways/card_connect.rb +2 -2
- data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
- data/lib/active_merchant/billing/gateways/card_stream.rb +9 -18
- data/lib/active_merchant/billing/gateways/cardknox.rb +8 -9
- data/lib/active_merchant/billing/gateways/cc5.rb +0 -1
- data/lib/active_merchant/billing/gateways/cecabank.rb +0 -1
- data/lib/active_merchant/billing/gateways/cenpos.rb +1 -1
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +6 -6
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/commercegate.rb +0 -1
- data/lib/active_merchant/billing/gateways/conekta.rb +6 -8
- data/lib/active_merchant/billing/gateways/creditcall.rb +1 -2
- data/lib/active_merchant/billing/gateways/ct_payment.rb +1 -1
- data/lib/active_merchant/billing/gateways/culqi.rb +8 -10
- data/lib/active_merchant/billing/gateways/cyber_source.rb +1 -2
- data/lib/active_merchant/billing/gateways/data_cash.rb +16 -29
- data/lib/active_merchant/billing/gateways/dibs.rb +1 -7
- data/lib/active_merchant/billing/gateways/digitzs.rb +1 -1
- data/lib/active_merchant/billing/gateways/efsnet.rb +0 -4
- data/lib/active_merchant/billing/gateways/element.rb +1 -1
- data/lib/active_merchant/billing/gateways/epay.rb +8 -9
- data/lib/active_merchant/billing/gateways/eway.rb +1 -0
- data/lib/active_merchant/billing/gateways/eway_managed.rb +2 -3
- data/lib/active_merchant/billing/gateways/exact.rb +0 -2
- data/lib/active_merchant/billing/gateways/ezic.rb +0 -1
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +9 -11
- data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -1
- data/lib/active_merchant/billing/gateways/first_giving.rb +3 -3
- data/lib/active_merchant/billing/gateways/first_pay.rb +5 -0
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +2 -2
- data/lib/active_merchant/billing/gateways/garanti.rb +4 -5
- data/lib/active_merchant/billing/gateways/global_collect.rb +6 -7
- data/lib/active_merchant/billing/gateways/iats_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/inspire.rb +2 -2
- data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
- data/lib/active_merchant/billing/gateways/iridium.rb +3 -3
- data/lib/active_merchant/billing/gateways/iveri.rb +1 -1
- data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
- data/lib/active_merchant/billing/gateways/kushki.rb +7 -9
- data/lib/active_merchant/billing/gateways/latitude19.rb +29 -34
- data/lib/active_merchant/billing/gateways/linkpoint.rb +1 -3
- data/lib/active_merchant/billing/gateways/litle.rb +1 -1
- data/lib/active_merchant/billing/gateways/mastercard.rb +1 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +0 -1
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +0 -1
- data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +3 -3
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +3 -3
- data/lib/active_merchant/billing/gateways/mercury.rb +1 -1
- data/lib/active_merchant/billing/gateways/micropayment.rb +0 -2
- data/lib/active_merchant/billing/gateways/modern_payments.rb +1 -0
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +4 -3
- data/lib/active_merchant/billing/gateways/moneris.rb +0 -1
- data/lib/active_merchant/billing/gateways/moneris_us.rb +1 -2
- data/lib/active_merchant/billing/gateways/money_movers.rb +1 -1
- data/lib/active_merchant/billing/gateways/mundipagg.rb +9 -9
- data/lib/active_merchant/billing/gateways/nab_transact.rb +0 -1
- data/lib/active_merchant/billing/gateways/net_registry.rb +1 -0
- data/lib/active_merchant/billing/gateways/nmi.rb +1 -2
- data/lib/active_merchant/billing/gateways/ogone.rb +9 -10
- data/lib/active_merchant/billing/gateways/openpay.rb +7 -8
- data/lib/active_merchant/billing/gateways/opp.rb +110 -112
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +1 -4
- data/lib/active_merchant/billing/gateways/orbital.rb +1 -2
- data/lib/active_merchant/billing/gateways/pagarme.rb +3 -5
- data/lib/active_merchant/billing/gateways/pay_conex.rb +0 -1
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +10 -12
- data/lib/active_merchant/billing/gateways/pay_secure.rb +1 -1
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +0 -1
- data/lib/active_merchant/billing/gateways/payeezy.rb +15 -4
- data/lib/active_merchant/billing/gateways/payex.rb +5 -6
- data/lib/active_merchant/billing/gateways/payflow.rb +0 -4
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -2
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +1 -1
- data/lib/active_merchant/billing/gateways/payflow_express.rb +54 -55
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
- data/lib/active_merchant/billing/gateways/payment_express.rb +0 -6
- data/lib/active_merchant/billing/gateways/paymill.rb +0 -2
- data/lib/active_merchant/billing/gateways/paypal.rb +0 -8
- data/lib/active_merchant/billing/gateways/payscout.rb +0 -1
- data/lib/active_merchant/billing/gateways/paystation.rb +2 -2
- data/lib/active_merchant/billing/gateways/payu_latam.rb +37 -32
- data/lib/active_merchant/billing/gateways/pin.rb +2 -2
- data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -0
- data/lib/active_merchant/billing/gateways/psl_card.rb +3 -10
- data/lib/active_merchant/billing/gateways/quantum.rb +4 -4
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +0 -3
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -7
- data/lib/active_merchant/billing/gateways/realex.rb +6 -8
- data/lib/active_merchant/billing/gateways/redsys.rb +1 -0
- data/lib/active_merchant/billing/gateways/s5.rb +0 -1
- data/lib/active_merchant/billing/gateways/safe_charge.rb +4 -4
- data/lib/active_merchant/billing/gateways/sage.rb +16 -13
- data/lib/active_merchant/billing/gateways/sage_pay.rb +2 -9
- data/lib/active_merchant/billing/gateways/secure_net.rb +0 -1
- data/lib/active_merchant/billing/gateways/securion_pay.rb +3 -6
- data/lib/active_merchant/billing/gateways/skip_jack.rb +2 -2
- data/lib/active_merchant/billing/gateways/smart_ps.rb +2 -4
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +5 -5
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -2
- data/lib/active_merchant/billing/gateways/stripe.rb +60 -15
- data/lib/active_merchant/billing/gateways/telr.rb +5 -6
- data/lib/active_merchant/billing/gateways/tns.rb +1 -1
- data/lib/active_merchant/billing/gateways/trans_first.rb +0 -1
- data/lib/active_merchant/billing/gateways/trexle.rb +6 -5
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -0
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +2 -2
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +0 -1
- data/lib/active_merchant/billing/gateways/vanco.rb +1 -1
- data/lib/active_merchant/billing/gateways/viaklix.rb +1 -0
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +28 -32
- data/lib/active_merchant/billing/gateways/wepay.rb +0 -1
- data/lib/active_merchant/billing/gateways/wirecard.rb +2 -1
- data/lib/active_merchant/billing/gateways/worldpay.rb +1 -4
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +5 -8
- data/lib/active_merchant/connection.rb +0 -2
- data/lib/active_merchant/country.rb +1 -0
- data/lib/active_merchant/net_http_ssl_connection.rb +1 -1
- data/lib/active_merchant/network_connection_retries.rb +1 -0
- data/lib/active_merchant/post_data.rb +1 -0
- data/lib/active_merchant/posts_data.rb +0 -2
- data/lib/active_merchant/version.rb +1 -1
- data/lib/support/gateway_support.rb +3 -4
- data/lib/support/ssl_verify.rb +0 -1
- metadata +2 -2
@@ -318,7 +318,7 @@ module ActiveMerchant #:nodoc:
|
|
318
318
|
def authorize_response_map(body)
|
319
319
|
lines = split_lines(body)
|
320
320
|
keys, values = split_line(lines[0]), split_line(lines[1])
|
321
|
-
Hash[*
|
321
|
+
Hash[*keys.zip(values).flatten].symbolize_keys
|
322
322
|
end
|
323
323
|
|
324
324
|
def parse_authorization_response(body)
|
@@ -333,7 +333,7 @@ module ActiveMerchant #:nodoc:
|
|
333
333
|
keys = [ :szSerialNumber, :szErrorCode, :szNumberRecords]
|
334
334
|
values = split_line(lines[0])[0..2]
|
335
335
|
|
336
|
-
result = Hash[*
|
336
|
+
result = Hash[*keys.zip(values).flatten]
|
337
337
|
|
338
338
|
result[:szErrorMessage] = ''
|
339
339
|
result[:success] = (result[:szErrorCode] == '0')
|
@@ -106,7 +106,6 @@ module ActiveMerchant #:nodoc:
|
|
106
106
|
commit('update', nil, post)
|
107
107
|
end
|
108
108
|
|
109
|
-
|
110
109
|
def delete(vault_id)
|
111
110
|
post = {}
|
112
111
|
post[:customer_vault] = 'delete_customer'
|
@@ -128,6 +127,7 @@ module ActiveMerchant #:nodoc:
|
|
128
127
|
alias_method :unstore, :delete
|
129
128
|
|
130
129
|
private
|
130
|
+
|
131
131
|
def add_customer_data(post, options)
|
132
132
|
if options.has_key? :email
|
133
133
|
post[:email] = options[:email]
|
@@ -237,7 +237,6 @@ module ActiveMerchant #:nodoc:
|
|
237
237
|
:cvv_result => response['cvvresponse'],
|
238
238
|
:avs_result => { :code => response['avsresponse'] }
|
239
239
|
)
|
240
|
-
|
241
240
|
end
|
242
241
|
|
243
242
|
def expdate(creditcard)
|
@@ -247,7 +246,6 @@ module ActiveMerchant #:nodoc:
|
|
247
246
|
"#{month}#{year[-2..-1]}"
|
248
247
|
end
|
249
248
|
|
250
|
-
|
251
249
|
def message_from(response)
|
252
250
|
case response['responsetext']
|
253
251
|
when 'SUCCESS', 'Approved', nil # This is dubious, but responses from UPDATE are nil.
|
@@ -272,7 +270,7 @@ module ActiveMerchant #:nodoc:
|
|
272
270
|
def determine_funding_source(source)
|
273
271
|
case
|
274
272
|
when source.is_a?(String) then :vault
|
275
|
-
when CreditCard.card_companies.
|
273
|
+
when CreditCard.card_companies.include?(card_brand(source)) then :credit_card
|
276
274
|
when card_brand(source) == 'check' then :check
|
277
275
|
else raise ArgumentError, 'Unsupported funding source provided'
|
278
276
|
end
|
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
|
|
10
10
|
'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB',
|
11
11
|
'IS', 'NO', 'CH'
|
12
12
|
]
|
13
|
-
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :maestro, :jcb, :
|
13
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :maestro, :jcb, :diners_club]
|
14
14
|
self.homepage_url = 'http://www.soeasypay.com/'
|
15
15
|
self.display_name = 'SoEasyPay'
|
16
16
|
|
@@ -162,10 +162,10 @@ module ActiveMerchant #:nodoc:
|
|
162
162
|
response_string = ssl_post(test? ? self.test_url : self.live_url, soap, headers)
|
163
163
|
response = parse(response_string, soap_action)
|
164
164
|
return Response.new(response['errorcode'] == '000',
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
165
|
+
response['errormessage'],
|
166
|
+
response,
|
167
|
+
:test => test?,
|
168
|
+
:authorization => response['transaction_id'])
|
169
169
|
end
|
170
170
|
|
171
171
|
def build_soap(request)
|
@@ -88,7 +88,6 @@ module ActiveMerchant #:nodoc:
|
|
88
88
|
commit("transactions/#{authorization}/void.xml", '')
|
89
89
|
end
|
90
90
|
|
91
|
-
|
92
91
|
# Public: Determine whether a credit card is chargeable card and available for purchases.
|
93
92
|
#
|
94
93
|
# payment_method - The CreditCard or the Spreedly payment method token.
|
@@ -231,7 +230,7 @@ module ActiveMerchant #:nodoc:
|
|
231
230
|
|
232
231
|
doc = Nokogiri::XML(xml)
|
233
232
|
doc.root.xpath('*').each do |node|
|
234
|
-
if
|
233
|
+
if node.elements.empty?
|
235
234
|
response[node.name.downcase.to_sym] = node.text
|
236
235
|
else
|
237
236
|
node.elements.each do |childnode|
|
@@ -136,6 +136,7 @@ module ActiveMerchant #:nodoc:
|
|
136
136
|
def void(identification, options = {})
|
137
137
|
post = {}
|
138
138
|
post[:metadata] = options[:metadata] if options[:metadata]
|
139
|
+
post[:reason] = options[:reason] if options[:reason]
|
139
140
|
post[:expand] = [:charge]
|
140
141
|
commit(:post, "charges/#{CGI.escape(identification)}/refunds", post, options)
|
141
142
|
end
|
@@ -323,6 +324,7 @@ module ActiveMerchant #:nodoc:
|
|
323
324
|
add_application_fee(post, options)
|
324
325
|
add_exchange_rate(post, options)
|
325
326
|
add_destination(post, options)
|
327
|
+
add_level_three(post, options)
|
326
328
|
post
|
327
329
|
end
|
328
330
|
|
@@ -348,6 +350,21 @@ module ActiveMerchant #:nodoc:
|
|
348
350
|
end
|
349
351
|
end
|
350
352
|
|
353
|
+
def add_level_three(post, options)
|
354
|
+
level_three = {}
|
355
|
+
|
356
|
+
copy_when_present(level_three, [:merchant_reference], options)
|
357
|
+
copy_when_present(level_three, [:customer_reference], options)
|
358
|
+
copy_when_present(level_three, [:shipping_address_zip], options)
|
359
|
+
copy_when_present(level_three, [:shipping_from_zip], options)
|
360
|
+
copy_when_present(level_three, [:shipping_amount], options)
|
361
|
+
copy_when_present(level_three, [:line_items], options)
|
362
|
+
|
363
|
+
unless level_three.empty?
|
364
|
+
post[:level3] = level_three
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
351
368
|
def add_expand_parameters(post, options)
|
352
369
|
post[:expand] ||= []
|
353
370
|
post[:expand].concat(Array.wrap(options[:expand]).map(&:to_sym)).uniq!
|
@@ -490,25 +507,39 @@ module ActiveMerchant #:nodoc:
|
|
490
507
|
|
491
508
|
def post_data(params)
|
492
509
|
return nil unless params
|
510
|
+
flatten_params([], params).join('&')
|
511
|
+
end
|
493
512
|
|
494
|
-
|
513
|
+
def flatten_params(flattened, params, prefix = nil)
|
514
|
+
params.each do |key, value|
|
495
515
|
next if value != false && value.blank?
|
516
|
+
flattened_key = prefix.nil? ? key : "#{prefix}[#{key}]"
|
496
517
|
if value.is_a?(Hash)
|
497
|
-
|
498
|
-
value.each do |k, v|
|
499
|
-
h["#{key}[#{k}]"] = v unless v.blank?
|
500
|
-
end
|
501
|
-
post_data(h)
|
518
|
+
flatten_params(flattened, value, flattened_key)
|
502
519
|
elsif value.is_a?(Array)
|
503
|
-
value
|
520
|
+
flatten_array(flattened, value, flattened_key)
|
521
|
+
else
|
522
|
+
flattened << "#{flattened_key}=#{CGI.escape(value.to_s)}"
|
523
|
+
end
|
524
|
+
end
|
525
|
+
flattened
|
526
|
+
end
|
527
|
+
|
528
|
+
def flatten_array(flattened, array, prefix)
|
529
|
+
array.each_with_index do |item, idx|
|
530
|
+
key = "#{prefix}[#{idx}]"
|
531
|
+
if item.is_a?(Hash)
|
532
|
+
flatten_params(flattened, item, key)
|
533
|
+
elsif item.is_a?(Array)
|
534
|
+
flatten_array(flattened, item, key)
|
504
535
|
else
|
505
|
-
"#{key}=#{CGI.escape(
|
536
|
+
flattened << "#{key}=#{CGI.escape(item.to_s)}"
|
506
537
|
end
|
507
|
-
end
|
538
|
+
end
|
508
539
|
end
|
509
540
|
|
510
541
|
def headers(options = {})
|
511
|
-
key
|
542
|
+
key = options[:key] || @api_key
|
512
543
|
idempotency_key = options[:idempotency_key]
|
513
544
|
|
514
545
|
headers = {
|
@@ -589,11 +620,9 @@ module ActiveMerchant #:nodoc:
|
|
589
620
|
end
|
590
621
|
|
591
622
|
def response_error(raw_response)
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
json_error(raw_response)
|
596
|
-
end
|
623
|
+
parse(raw_response)
|
624
|
+
rescue JSON::ParserError
|
625
|
+
json_error(raw_response)
|
597
626
|
end
|
598
627
|
|
599
628
|
def json_error(raw_response)
|
@@ -682,6 +711,22 @@ module ActiveMerchant #:nodoc:
|
|
682
711
|
return 100 unless options[:currency]
|
683
712
|
return MINIMUM_AUTHORIZE_AMOUNTS[options[:currency].upcase] || 100
|
684
713
|
end
|
714
|
+
|
715
|
+
def copy_when_present(dest, dest_path, source, source_path = nil)
|
716
|
+
source_path ||= dest_path
|
717
|
+
source_path.each do |key|
|
718
|
+
return nil unless source[key]
|
719
|
+
source = source[key]
|
720
|
+
end
|
721
|
+
|
722
|
+
if source
|
723
|
+
dest_path.first(dest_path.size - 1).each do |key|
|
724
|
+
dest[key] ||= {}
|
725
|
+
dest = dest[key]
|
726
|
+
end
|
727
|
+
dest[dest_path.last] = source
|
728
|
+
end
|
729
|
+
end
|
685
730
|
end
|
686
731
|
end
|
687
732
|
end
|
@@ -11,7 +11,7 @@ module ActiveMerchant #:nodoc:
|
|
11
11
|
self.supported_countries = ['AE', 'IN', 'SA']
|
12
12
|
self.default_currency = 'AED'
|
13
13
|
self.money_format = :dollars
|
14
|
-
self.supported_cardtypes = [:visa, :master, :american_express, :maestro, :
|
14
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :maestro, :jcb]
|
15
15
|
|
16
16
|
CVC_CODE_TRANSLATOR = {
|
17
17
|
'Y' => 'M',
|
@@ -87,9 +87,9 @@ module ActiveMerchant #:nodoc:
|
|
87
87
|
|
88
88
|
def scrub(transcript)
|
89
89
|
transcript.
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
gsub(%r((<Number>)[^<]+(<))i, '\1[FILTERED]\2').
|
91
|
+
gsub(%r((<CVV>)[^<]+(<))i, '\1[FILTERED]\2').
|
92
|
+
gsub(%r((<Key>)[^<]+(<))i, '\1[FILTERED]\2')
|
93
93
|
end
|
94
94
|
|
95
95
|
private
|
@@ -190,7 +190,6 @@ module ActiveMerchant #:nodoc:
|
|
190
190
|
def build_xml_request
|
191
191
|
builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
|
192
192
|
xml.remote do |doc|
|
193
|
-
|
194
193
|
add_authentication(doc)
|
195
194
|
yield(doc)
|
196
195
|
end
|
@@ -220,7 +219,7 @@ module ActiveMerchant #:nodoc:
|
|
220
219
|
response[node.name.downcase.to_sym] = node.text
|
221
220
|
else
|
222
221
|
node.elements.each do |childnode|
|
223
|
-
name =
|
222
|
+
name = childnode.name.downcase
|
224
223
|
response[name.to_sym] = childnode.text
|
225
224
|
end
|
226
225
|
end
|
@@ -15,7 +15,7 @@ module ActiveMerchant
|
|
15
15
|
self.homepage_url = 'http://www.tnsi.com/'
|
16
16
|
self.supported_countries = %w(AR AU BR FR DE HK MX NZ SG GB US)
|
17
17
|
self.default_currency = 'USD'
|
18
|
-
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :maestro
|
18
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :maestro]
|
19
19
|
|
20
20
|
end
|
21
21
|
end
|
@@ -90,6 +90,7 @@ module ActiveMerchant #:nodoc:
|
|
90
90
|
gsub(/(number\\?":\\?")(\d*)/, '\1[FILTERED]').
|
91
91
|
gsub(/(cvc\\?":\\?")(\d*)/, '\1[FILTERED]')
|
92
92
|
end
|
93
|
+
|
93
94
|
private
|
94
95
|
|
95
96
|
def add_amount(post, money, options)
|
@@ -170,11 +171,11 @@ module ActiveMerchant #:nodoc:
|
|
170
171
|
|
171
172
|
response = body['response']
|
172
173
|
Response.new(
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
174
|
+
true,
|
175
|
+
response['status_message'],
|
176
|
+
body,
|
177
|
+
authorization: token(response),
|
178
|
+
test: test?
|
178
179
|
)
|
179
180
|
end
|
180
181
|
|
@@ -1563,12 +1563,12 @@ module ActiveMerchant #:nodoc:
|
|
1563
1563
|
|
1564
1564
|
success, message, authorization, avs, cvv = false, FAILURE_MESSAGE, nil, nil, nil
|
1565
1565
|
|
1566
|
-
fault =
|
1566
|
+
fault = !response || (response.length < 1) || response.has_key?('faultcode')
|
1567
1567
|
return [response, success, response['faultstring'], authorization, avs, cvv] if fault
|
1568
1568
|
|
1569
1569
|
if response.respond_to?(:[]) && p = response["#{action}_return"]
|
1570
1570
|
if p.respond_to?(:key?) && p.key?('result_code')
|
1571
|
-
success = p['result_code'] == 'A'
|
1571
|
+
success = p['result_code'] == 'A'
|
1572
1572
|
authorization = p['ref_num']
|
1573
1573
|
avs = AVS_RESULTS[p['avs_result_code']]
|
1574
1574
|
cvv = p['card_code_result_code']
|
@@ -140,24 +140,22 @@ module ActiveMerchant #:nodoc:
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def commit(action, params, options={})
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
)
|
160
|
-
end
|
143
|
+
raw_response = ssl_request(method(action), url(action, params, options), params.to_json, headers)
|
144
|
+
response = parse(raw_response)
|
145
|
+
rescue ResponseError => e
|
146
|
+
raw_response = e.response.body
|
147
|
+
response_error(raw_response, options, action)
|
148
|
+
rescue JSON::ParserError
|
149
|
+
unparsable_response(raw_response)
|
150
|
+
else
|
151
|
+
Response.new(
|
152
|
+
success_from(response),
|
153
|
+
message_from(response, options, action),
|
154
|
+
response,
|
155
|
+
:test => test?,
|
156
|
+
:authorization => authorization_from(params, response, options),
|
157
|
+
:error_code => response['errorCode']
|
158
|
+
)
|
161
159
|
end
|
162
160
|
|
163
161
|
def headers
|
@@ -211,20 +209,18 @@ module ActiveMerchant #:nodoc:
|
|
211
209
|
end
|
212
210
|
|
213
211
|
def response_error(raw_response, options, action)
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
)
|
227
|
-
end
|
212
|
+
response = parse(raw_response)
|
213
|
+
rescue JSON::ParserError
|
214
|
+
unparsable_response(raw_response)
|
215
|
+
else
|
216
|
+
return Response.new(
|
217
|
+
false,
|
218
|
+
message_from(response, options, action),
|
219
|
+
response,
|
220
|
+
:test => test?,
|
221
|
+
:authorization => response['transactionUUID'],
|
222
|
+
:error_code => response['errorCode']
|
223
|
+
)
|
228
224
|
end
|
229
225
|
|
230
226
|
def unparsable_response(raw_response)
|
@@ -26,7 +26,7 @@ module ActiveMerchant #:nodoc:
|
|
26
26
|
# number 5551234 within area code 202 (country code 1).
|
27
27
|
VALID_PHONE_FORMAT = /\+\d{1,3}(\(?\d{3}\)?)?\d{3}-\d{4}-\d{3}/
|
28
28
|
|
29
|
-
self.supported_cardtypes = [ :visa, :master, :american_express, :diners_club, :jcb
|
29
|
+
self.supported_cardtypes = [ :visa, :master, :american_express, :diners_club, :jcb ]
|
30
30
|
self.supported_countries = %w(AD CY GI IM MT RO CH AT DK GR IT MC SM TR BE EE HU LV NL SK GB BG FI IS LI NO SI VA FR IL LT PL ES CZ DE IE LU PT SE)
|
31
31
|
self.homepage_url = 'http://www.wirecard.com'
|
32
32
|
self.display_name = 'Wirecard'
|
@@ -138,6 +138,7 @@ module ActiveMerchant #:nodoc:
|
|
138
138
|
end
|
139
139
|
|
140
140
|
private
|
141
|
+
|
141
142
|
def clean_description(description)
|
142
143
|
description.to_s.slice(0,32).encode('US-ASCII', invalid: :replace, undef: :replace, replace: '?')
|
143
144
|
end
|