activemerchant 1.61.0 → 1.62.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1fe35e2a54670d5e8b4a1b03b60e0fbdb63b862e
4
- data.tar.gz: 776d6fcde383b0ca43232791f8816ea573a21b3a
3
+ metadata.gz: 7495e19fc84deca42bc3878d9463044899a33b2e
4
+ data.tar.gz: bc44737020062ba81039dfc19956b7c5a128ee40
5
5
  SHA512:
6
- metadata.gz: 1c4e2de0b7a0302afbbab9c6a486db123ac8228f83d3f7ea844ccd2108d80a79234627f2a9ce5824a9782c5eff560ef644aefea40d729564e97afb30d476946b
7
- data.tar.gz: 2d259ac6111733da3f2d093f8638a5f2adcd8eb47a3adcce29197e37c4605daca606a2214ed274629872bdd5d6ba931acec991abfa1c398758941542d1b03963
6
+ metadata.gz: 3fb5132fdfd23c6f1d772755285638231bef754099790c47c69f963133b7c1057c0d3c3f19b82c8b72226f5b61a294c7d2d30e283c570d2a5f81701886db491a
7
+ data.tar.gz: be95c7d4600244ab3f2607f2a67ff1f4a325db60da1deb57834b5ea11eead17392a4d5d758d5595fcd76710c2a3e141a51e61e0de67191db8b2be58b1b07e867
data/CHANGELOG CHANGED
@@ -1,5 +1,29 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
+ == HEAD
4
+
5
+ == Version 1.62.0 (December 5, 2016)
6
+ * AuthorizeNet: Map to standard AVSResult codes [shasum]
7
+ * CitrusPay: Add 3DSecureId field [davidsantoso]
8
+ * CyberSource: Only get alpha2 country code when it's a known country [bruno] #2238
9
+ * Fat Zebra: Add scrubbing to Fat Zebra gateway [bruno] #2037
10
+ * Monei: Add US and CA as new supported countries [davidgf] #2209
11
+ * NAB Transact: Add scrubbing to NAB Transact [bruno] #2038
12
+ * iATS: Add scrubbing support to iATS [bruno] #2228
13
+ * Stripe: Ensure ECI values for tokenized cards are padded [jasonwebster] #2250
14
+ * Forte: Fix incorrect authorization_code response mapping [davidsantoso]
15
+ * maxiPago: Send currency with request [curiousepic]
16
+ * Credorax: Map order_id to field H9 [curiousepic]
17
+ * Authorize.net: Remove duplicate country GB [shasum]
18
+ * PayU Latam: Add processWithoutCvv2 field [shasum]
19
+ * Fat Zebra: De-nest soft descriptor fields [curiousepic]
20
+ * Credorax: Only pass c5 field for billing address1 [davidsantoso]
21
+ * Orbital: Add support for CLP currency [curiousepic]
22
+ * Authorize.net: Add line item fields and additional transaction settings [shasum]
23
+ * Authorize.net: Pass through `header_email_receipt` [shasum]
24
+ * Stripe: Scrub additional network tokenization related sensitive data [jasonwebster] #2251
25
+ * Applying: Worldpay: Format non-fractional currency amounts correctly [jasonwebster] #2267
26
+
3
27
  == Version 1.61.0 (November 7, 2016)
4
28
  * Add codes AQ, BQ, SX, and SS to list of countries and update SD numeric code [zxlin]
5
29
  * AuthorizeNet: Update supported countries list [shasum]
data/README.md CHANGED
@@ -150,7 +150,7 @@ The [ActiveMerchant Wiki](http://github.com/activemerchant/active_merchant/wikis
150
150
  * [Metrics Global](http://www.metricsglobal.com) - US
151
151
  * [MasterCard Internet Gateway Service (MiGS)](http://mastercard.com/mastercardsps) - AU, AE, BD, BN, EG, HK, ID, IN, JO, KW, LB, LK, MU, MV, MY, NZ, OM, PH, QA, SA, SG, TT, VN
152
152
  * [Modern Payments](http://www.modpay.com) - US
153
- * [MONEI](http://www.monei.net/) - ES
153
+ * [MONEI](http://www.monei.net/) - AD, AT, BE, BG, CA, CH, CY, CZ, DE, DK, EE, ES, FI, FO, FR, GB, GI, GR, HU, IE, IL, IS, IT, LI, LT, LU, LV, MT, NL, NO, PL, PT, RO, SE, SI, SK, TR, US, VA
154
154
  * [Moneris](http://www.moneris.com/) - CA
155
155
  * [Moneris (US)](http://www.monerisusa.com/) - US
156
156
  * [MoneyMovers](http://mmoa.us/) - US
@@ -65,10 +65,10 @@ module ActiveMerchant #:nodoc:
65
65
  #
66
66
  # :incorrect_number - Card number does not comply with ISO/IEC 7812 numbering standard
67
67
  # :invalid_number - Card number was not matched by processor
68
- # :invalid_expiry_date - Expiry date deos not match correct formatting
68
+ # :invalid_expiry_date - Expiry date does not match correct formatting
69
69
  # :invalid_cvc - Security codes does not match correct format (3-4 digits)
70
70
  # :expired_card - Card number is expired
71
- # :incorrect_cvc - Secerity code was not matched by the processor
71
+ # :incorrect_cvc - Security code was not matched by the processor
72
72
  # :incorrect_zip - Zip code is not in correct format
73
73
  # :incorrect_address - Billing address info was not matched by the processor
74
74
  # :incorrect_pin - Card PIN is incorrect
@@ -8,7 +8,7 @@ module ActiveMerchant
8
8
  self.test_url = 'https://apitest.authorize.net/xml/v1/request.api'
9
9
  self.live_url = 'https://api2.authorize.net/xml/v1/request.api'
10
10
 
11
- self.supported_countries = %w(AD AT AU BE BG CA CH CY CZ DE DK EE ES FI FR GB GB GI GR HU IE IL IS IT LI LT LU LV MC MT NL NO PL PT RO SE SI SK SM TR US VA)
11
+ self.supported_countries = %w(AD AT AU BE BG CA CH CY CZ DE DK EE ES FI FR GB GI GR HU IE IL IS IT LI LT LU LV MC MT NL NO PL PT RO SE SI SK SM TR US VA)
12
12
  self.default_currency = 'USD'
13
13
  self.money_format = :dollars
14
14
  self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :maestro]
@@ -16,6 +16,25 @@ module ActiveMerchant
16
16
  self.homepage_url = 'http://www.authorize.net/'
17
17
  self.display_name = 'Authorize.Net'
18
18
 
19
+ # Authorize.net has slightly different definitions for returned AVS codes
20
+ # that have been mapped to the closest equivalent AM standard AVSResult codes
21
+ # Authorize.net's descriptions noted below
22
+ STANDARD_AVS_CODE_MAPPING = {
23
+ 'A' => 'A', # Street Address: Match -- First 5 Digits of ZIP: No Match
24
+ 'B' => 'I', # Address not provided for AVS check or street address match, postal code could not be verified
25
+ 'E' => 'E', # AVS Error
26
+ 'G' => 'G', # Non U.S. Card Issuing Bank
27
+ 'N' => 'N', # Street Address: No Match -- First 5 Digits of ZIP: No Match
28
+ 'P' => 'I', # AVS not applicable for this transaction
29
+ 'R' => 'R', # Retry, System Is Unavailable
30
+ 'S' => 'S', # AVS Not Supported by Card Issuing Bank
31
+ 'U' => 'U', # Address Information For This Cardholder Is Unavailable
32
+ 'W' => 'W', # Street Address: No Match -- All 9 Digits of ZIP: Match
33
+ 'X' => 'X', # Street Address: Match -- All 9 Digits of ZIP: Match
34
+ 'Y' => 'Y', # Street Address: Match - First 5 Digits of ZIP: Match
35
+ 'Z' => 'Z' # Street Address: No Match - First 5 Digits of ZIP: Match
36
+ }
37
+
19
38
  STANDARD_ERROR_CODE_MAPPING = {
20
39
  '36' => STANDARD_ERROR_CODE[:incorrect_number],
21
40
  '237' => STANDARD_ERROR_CODE[:invalid_number],
@@ -61,7 +80,7 @@ module ActiveMerchant
61
80
  TRANSACTION_ALREADY_ACTIONED = %w(310 311)
62
81
 
63
82
  CARD_CODE_ERRORS = %w(N S)
64
- AVS_ERRORS = %w(A E N R W Z)
83
+ AVS_ERRORS = %w(A E I N R W Z)
65
84
  AVS_REASON_CODES = %w(27 45)
66
85
 
67
86
  TRACKS = {
@@ -140,6 +159,7 @@ module ActiveMerchant
140
159
  add_payment_source(xml, payment)
141
160
  add_invoice(xml, options)
142
161
  add_customer_data(xml, payment, options)
162
+ add_line_items(xml, options)
143
163
  add_settings(xml, payment, options)
144
164
  add_user_fields(xml, amount, options)
145
165
  end
@@ -213,6 +233,7 @@ module ActiveMerchant
213
233
  add_invoice(xml, options)
214
234
  add_customer_data(xml, payment, options)
215
235
  add_market_type_device_type(xml, payment, options)
236
+ add_line_items(xml, options)
216
237
  add_settings(xml, payment, options)
217
238
  add_user_fields(xml, amount, options)
218
239
  end
@@ -326,6 +347,23 @@ module ActiveMerchant
326
347
  end
327
348
  end
328
349
 
350
+ def add_line_items(xml, options)
351
+ return unless options[:line_items]
352
+ xml.lineItems do
353
+ options[:line_items].each do |line_item|
354
+ xml.lineItem do
355
+ line_item.each do |key, value|
356
+ xml.send(camel_case_lower(key), value)
357
+ end
358
+ end
359
+ end
360
+ end
361
+ end
362
+
363
+ def camel_case_lower(key)
364
+ String(key).split('_').inject([]){ |buffer,e| buffer.push(buffer.empty? ? e : e.capitalize) }.join
365
+ end
366
+
329
367
  def add_settings(xml, source, options)
330
368
  xml.transactionSettings do
331
369
  if options[:recurring]
@@ -346,6 +384,18 @@ module ActiveMerchant
346
384
  ActiveMerchant.deprecated "Using the duplicate_window class_attribute is deprecated. Use the transaction options hash instead."
347
385
  set_duplicate_window(xml, self.class.duplicate_window)
348
386
  end
387
+ if options[:email_customer]
388
+ xml.setting do
389
+ xml.settingName("emailCustomer")
390
+ xml.settingValue("true")
391
+ end
392
+ end
393
+ if options[:header_email_receipt]
394
+ xml.setting do
395
+ xml.settingName("headerEmailReceipt")
396
+ xml.settingValue(options[:header_email_receipt])
397
+ end
398
+ end
349
399
  end
350
400
  end
351
401
 
@@ -566,7 +616,6 @@ module ActiveMerchant
566
616
  end
567
617
  end
568
618
 
569
-
570
619
  def names_from(payment_source, address, options)
571
620
  if payment_source && !payment_source.is_a?(PaymentToken) && !payment_source.is_a?(String)
572
621
  first_name, last_name = split_names(address[:name])
@@ -596,7 +645,8 @@ module ActiveMerchant
596
645
  raw_response = ssl_post(url, post_data(action, &payload), headers)
597
646
  response = parse(action, raw_response)
598
647
 
599
- avs_result = AVSResult.new(code: response[:avs_result_code])
648
+ avs_result_code = response[:avs_result_code].upcase if response[:avs_result_code]
649
+ avs_result = AVSResult.new(code: STANDARD_AVS_CODE_MAPPING[avs_result_code])
600
650
  cvv_result = CVVResult.new(response[:card_code])
601
651
  if using_live_gateway_in_test_mode?(response)
602
652
  Response.new(false, "Using a live Authorize.net account in Test Mode is not permitted.")
@@ -62,7 +62,7 @@ module ActiveMerchant #:nodoc:
62
62
  add_customer_data(post, options)
63
63
  reference_action = add_reference(post, authorization)
64
64
  add_echo(post, options)
65
- post[:a1] = options[:order_id] || generate_unique_id
65
+ post[:a1] = generate_unique_id
66
66
 
67
67
  commit(:void, post, reference_action)
68
68
  end
@@ -109,8 +109,9 @@ module ActiveMerchant #:nodoc:
109
109
 
110
110
  def add_invoice(post, money, options)
111
111
  post[:a4] = amount(money)
112
- post[:a1] = options[:order_id] || generate_unique_id
112
+ post[:a1] = generate_unique_id
113
113
  post[:a5] = options[:currency] || currency(money)
114
+ post[:h9] = options[:order_id]
114
115
  end
115
116
 
116
117
  CARD_TYPES = {
@@ -131,9 +132,7 @@ module ActiveMerchant #:nodoc:
131
132
  def add_customer_data(post, options)
132
133
  post[:d1] = options[:ip] || '127.0.0.1'
133
134
  if (billing_address = options[:billing_address])
134
- # Credorax has separate fields for street number and street name
135
- post[:c4] = billing_address[:address1].split.first
136
- post[:c5] = billing_address[:address1].split.drop(1).join(" ")
135
+ post[:c5] = billing_address[:address1]
137
136
  post[:c7] = billing_address[:city]
138
137
  post[:c10] = billing_address[:zip]
139
138
  post[:c8] = billing_address[:state]
@@ -653,7 +653,7 @@ module ActiveMerchant #:nodoc:
653
653
 
654
654
  def lookup_country_code(country_field)
655
655
  country_code = Country.find(country_field) rescue nil
656
- country_code.code(:alpha2)
656
+ country_code.code(:alpha2) if country_code
657
657
  end
658
658
 
659
659
  # Where we actually build the full SOAP request using builder
@@ -91,6 +91,17 @@ module ActiveMerchant #:nodoc:
91
91
  commit(:post, "credit_cards", post)
92
92
  end
93
93
 
94
+ def supports_scrubbing?
95
+ true
96
+ end
97
+
98
+ def scrub(transcript)
99
+ transcript.
100
+ gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
101
+ gsub(%r(("card_number\\":\\")[^"\\]*)i, '\1[FILTERED]').
102
+ gsub(%r(("cvv\\":\\")\d+), '\1[FILTERED]')
103
+ end
104
+
94
105
  private
95
106
 
96
107
  # Add the money details to the request
@@ -125,17 +136,11 @@ module ActiveMerchant #:nodoc:
125
136
  extra[:cavv] = options[:cavv] if options[:cavv]
126
137
  extra[:xid] = options[:cavv] if options[:xid]
127
138
  extra[:sli] = options[:sli] if options[:sli]
128
- add_descriptor(extra, options)
139
+ extra[:name] = options[:merchant] if options[:merchant]
140
+ extra[:location] = options[:merchant_location] if options[:merchant_location]
129
141
  post[:extra] = extra if extra.any?
130
142
  end
131
143
 
132
- def add_descriptor(extra, options)
133
- descriptor = {}
134
- descriptor[:name] = options[:merchant] if options[:merchant]
135
- descriptor[:location] = options[:merchant_location] if options[:merchant_location]
136
- extra[:descriptor] = descriptor if descriptor.any?
137
- end
138
-
139
144
  def add_order_id(post, options)
140
145
  post[:reference] = options[:order_id] || SecureRandom.hex(15)
141
146
  end
@@ -48,7 +48,7 @@ module ActiveMerchant #:nodoc:
48
48
  post = {}
49
49
  add_invoice(post, options)
50
50
  post[:transaction_id] = transaction_id_from(authorization)
51
- post[:authorization_code] = authorization_code_from(authorization)
51
+ post[:authorization_code] = authorization_code_from(authorization) || ""
52
52
  post[:action] = "capture"
53
53
 
54
54
  commit(:put, post)
@@ -211,7 +211,7 @@ module ActiveMerchant #:nodoc:
211
211
  end
212
212
 
213
213
  def authorization_from(response)
214
- [response["transaction_id"], response["authorization_code"]].join("#")
214
+ [response.try(:[], "transaction_id"), response.try(:[], "response").try(:[], "authorization_code")].join("#")
215
215
  end
216
216
 
217
217
  def endpoint
@@ -75,6 +75,19 @@ module ActiveMerchant #:nodoc:
75
75
  commit(:unstore, post)
76
76
  end
77
77
 
78
+ def supports_scrubbing?
79
+ true
80
+ end
81
+
82
+ def scrub(transcript)
83
+ transcript.
84
+ gsub(%r((<agentCode>).+(</agentCode>)), '\1[FILTERED]\2').
85
+ gsub(%r((<password>).+(</password>)), '\1[FILTERED]\2').
86
+ gsub(%r((<creditCardNum>).+(</creditCardNum>)), '\1[FILTERED]\2').
87
+ gsub(%r((<cvv2>).+(</cvv2>)), '\1[FILTERED]\2').
88
+ gsub(%r((<accountNum>).+(</accountNum>)), '\1[FILTERED]\2')
89
+ end
90
+
78
91
  private
79
92
 
80
93
  def add_ip(post, options)
@@ -20,6 +20,7 @@ module ActiveMerchant
20
20
  add_reference(post, *new_authorization)
21
21
  add_payment_method(post, payment_method)
22
22
  add_customer_data(post, payment_method, options)
23
+ add_3dsecure_id(post, options)
23
24
 
24
25
  commit('authorize', post)
25
26
  end
@@ -29,6 +30,7 @@ module ActiveMerchant
29
30
  add_invoice(post, amount, options, :transaction)
30
31
  add_reference(post, *next_authorization(authorization))
31
32
  add_customer_data(post, nil, options)
33
+ add_3dsecure_id(post, options)
32
34
 
33
35
  commit('capture', post)
34
36
  end
@@ -160,6 +162,11 @@ module ActiveMerchant
160
162
  post[:customer].merge!(customer)
161
163
  end
162
164
 
165
+ def add_3dsecure_id(post, options)
166
+ return unless options[:threed_secure_id]
167
+ post.merge!({"3DSecureId" => options[:threed_secure_id]})
168
+ end
169
+
163
170
  def country_code(country)
164
171
  if country
165
172
  country = ActiveMerchant::Country.find(country)
@@ -37,7 +37,7 @@ module ActiveMerchant #:nodoc:
37
37
  add_order_id(xml, authorization)
38
38
  add_reference_num(xml, options)
39
39
  xml.payment do
40
- add_amount(xml, money)
40
+ add_amount(xml, money, options)
41
41
  end
42
42
  end
43
43
  end
@@ -54,7 +54,7 @@ module ActiveMerchant #:nodoc:
54
54
  add_order_id(xml, authorization)
55
55
  add_reference_num(xml, options)
56
56
  xml.payment do
57
- add_amount(xml, money)
57
+ add_amount(xml, money, options)
58
58
  end
59
59
  end
60
60
  end
@@ -163,7 +163,7 @@ module ActiveMerchant #:nodoc:
163
163
  end
164
164
  end
165
165
  xml.payment do
166
- add_amount(xml, money)
166
+ add_amount(xml, money, options)
167
167
  add_installments(xml, options)
168
168
  end
169
169
  add_billing_address(xml, creditcard, options)
@@ -173,8 +173,9 @@ module ActiveMerchant #:nodoc:
173
173
  xml.referenceNum(options[:order_id] || generate_unique_id)
174
174
  end
175
175
 
176
- def add_amount(xml, money)
176
+ def add_amount(xml, money, options)
177
177
  xml.chargeTotal(amount(money))
178
+ xml.currencyCode(options[:currency] || currency(money) || default_currency)
178
179
  end
179
180
 
180
181
  def add_processor_id(xml)
@@ -14,7 +14,7 @@ module ActiveMerchant #:nodoc:
14
14
  self.test_url = 'https://test.monei-api.net/payment/ctpe'
15
15
  self.live_url = 'https://monei-api.net/payment/ctpe'
16
16
 
17
- self.supported_countries = ['AD', 'AT', 'BE', 'BG', 'CH', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FO', 'FR', 'GB', 'GI', 'GR', 'HU', 'IE', 'IL', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK', 'TR', 'VA']
17
+ self.supported_countries = ['AD', 'AT', 'BE', 'BG', 'CA', 'CH', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FO', 'FR', 'GB', 'GI', 'GR', 'HU', 'IE', 'IL', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK', 'TR', 'US', 'VA']
18
18
  self.default_currency = 'EUR'
19
19
  self.supported_cardtypes = [:visa, :master, :maestro, :jcb, :american_express]
20
20
 
@@ -79,6 +79,18 @@ module ActiveMerchant #:nodoc:
79
79
  commit_periodic(:deletecrn, build_unstore_request(identification, options))
80
80
  end
81
81
 
82
+ def supports_scrubbing?
83
+ true
84
+ end
85
+
86
+ def scrub(transcript)
87
+ return "" if transcript.blank?
88
+ transcript.
89
+ gsub(%r((<cardNumber>)[^<]+(<))i, '\1[FILTERED]\2').
90
+ gsub(%r((<cvv>)[^<]+(<))i, '\1[FILTERED]\2').
91
+ gsub(%r((<password>)[^<]+(<))i, '\1[FILTERED]\2')
92
+ end
93
+
82
94
  private
83
95
 
84
96
  def add_metadata(xml, options)
@@ -86,6 +86,7 @@ module ActiveMerchant #:nodoc:
86
86
  "AUD" => '036',
87
87
  "BRL" => '986',
88
88
  "CAD" => '124',
89
+ "CLP" => '152',
89
90
  "CZK" => '203',
90
91
  "DKK" => '208',
91
92
  "HKD" => '344',
@@ -106,6 +107,7 @@ module ActiveMerchant #:nodoc:
106
107
  "AUD" => '2',
107
108
  "BRL" => '2',
108
109
  "CAD" => '2',
110
+ "CLP" => '2',
109
111
  "CZK" => '2',
110
112
  "DKK" => '2',
111
113
  "HKD" => '2',
@@ -200,20 +200,34 @@ module ActiveMerchant #:nodoc:
200
200
  brand, token = split_authorization(payment_method)
201
201
  credit_card = {}
202
202
  credit_card[:securityCode] = options[:cvv] if options[:cvv]
203
+ credit_card[:processWithoutCvv2] = true if options[:cvv].blank?
203
204
  post[:transaction][:creditCard] = credit_card
204
205
  post[:transaction][:creditCardTokenId] = token
205
206
  post[:transaction][:paymentMethod] = brand.upcase
206
207
  else
207
208
  credit_card = {}
208
209
  credit_card[:number] = payment_method.number
209
- credit_card[:securityCode] = payment_method.verification_value
210
+ credit_card[:securityCode] = add_security_code(payment_method, options)
210
211
  credit_card[:expirationDate] = format(payment_method.year, :four_digits).to_s + '/' + format(payment_method.month, :two_digits).to_s
211
212
  credit_card[:name] = payment_method.name.strip
213
+ credit_card[:processWithoutCvv2] = true if add_process_without_cvv2(payment_method, options)
212
214
  post[:transaction][:creditCard] = credit_card
213
215
  post[:transaction][:paymentMethod] = BRAND_MAP[payment_method.brand.to_s]
214
216
  end
215
217
  end
216
218
 
219
+ def add_security_code(payment_method, options)
220
+ return payment_method.verification_value unless payment_method.verification_value.blank?
221
+ return options[:cvv] unless options[:cvv].blank?
222
+ return "0000" if BRAND_MAP[payment_method.brand.to_s] == "AMEX"
223
+ "000"
224
+ end
225
+
226
+ def add_process_without_cvv2(payment_method, options)
227
+ return true if payment_method.verification_value.blank? && options[:cvv].blank?
228
+ false
229
+ end
230
+
217
231
  def add_payer(post, options)
218
232
  if address = options[:billing_address]
219
233
  payer = {}
@@ -271,13 +271,15 @@ module ActiveMerchant #:nodoc:
271
271
  def scrub(transcript)
272
272
  transcript.
273
273
  gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
274
- gsub(%r((card\[number\]=)\d+), '\1[FILTERED]').
275
- gsub(%r((card\[cvc\]=)\d+), '\1[FILTERED]').
276
274
  gsub(%r((&?three_d_secure\[cryptogram\]=)[\w=]*(&?)), '\1[FILTERED]\2').
277
- gsub(%r((card\[swipe_data\]=)[^&]+(&?)), '\1[FILTERED]\2').
275
+ gsub(%r((card\[cryptogram\]=)[^&]+(&?)), '\1[FILTERED]\2').
276
+ gsub(%r((card\[cvc\]=)\d+), '\1[FILTERED]').
277
+ gsub(%r((card\[emv_approval_data\]=)[^&]+(&?)), '\1[FILTERED]\2').
278
+ gsub(%r((card\[emv_auth_data\]=)[^&]+(&?)), '\1[FILTERED]\2').
278
279
  gsub(%r((card\[encrypted_pin\]=)[^&]+(&?)), '\1[FILTERED]\2').
279
280
  gsub(%r((card\[encrypted_pin_key_id\]=)[\w=]+(&?)), '\1[FILTERED]\2').
280
- gsub(%r((card\[emv_auth_data\]=)[^&]+(&?)), '\1[FILTERED]\2')
281
+ gsub(%r((card\[number\]=)\d+), '\1[FILTERED]').
282
+ gsub(%r((card\[swipe_data\]=)[^&]+(&?)), '\1[FILTERED]\2')
281
283
  end
282
284
 
283
285
  def supports_network_tokenization?
@@ -389,7 +391,7 @@ module ActiveMerchant #:nodoc:
389
391
 
390
392
  if creditcard.is_a?(NetworkTokenizationCreditCard)
391
393
  card[:cryptogram] = creditcard.payment_cryptogram
392
- card[:eci] = creditcard.eci
394
+ card[:eci] = creditcard.eci.rjust(2, '0') if creditcard.eci =~ /^[0-9]+$/
393
395
  card[:tokenization_method] = creditcard.source.to_s
394
396
  end
395
397
  post[:card] = card
@@ -187,7 +187,7 @@ module ActiveMerchant #:nodoc:
187
187
  currency = options[:currency] || currency(money)
188
188
 
189
189
  amount_hash = {
190
- :value => amount(money),
190
+ :value => localized_amount(money, currency),
191
191
  'currencyCode' => currency,
192
192
  'exponent' => non_fractional_currency?(currency) ? 0 : 2
193
193
  }
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = "1.61.0"
2
+ VERSION = "1.62.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.61.0
4
+ version: 1.62.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-07 00:00:00.000000000 Z
11
+ date: 2016-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport