activemerchant 1.107.1 → 1.107.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88249628bc56fb775fc6cc669fceea51b9040ced2f7c2dea503cd276a37202d1
4
- data.tar.gz: f538ae45a677ec066b40dbb68742b1df9ccea5e7d45e0bd9e28d88968ae77334
3
+ metadata.gz: d4b704d184c4e243e3026a3ecca838279de90491495d7fd0f4bf03addc1cd21f
4
+ data.tar.gz: 6caaf2044ce6013c47ba00415443945adc466c5df7b684a2ad0b20f66ebec0e8
5
5
  SHA512:
6
- metadata.gz: 06c755605d7633a83cc1e2b9cfbf0cdf00d320e8bcd345cfdb6539ad814b9795ac4e33e075941f9b0761768ae9a6f3cb2bad90dd2ed35eca0fce7a8aa9642f55
7
- data.tar.gz: e35ac5cfa97a22fdc416c0031e20f398b62189bb091e20b9c17fc815d2db2d481aa5463d047a5d718ec07574249c57acf1defec69c5ff7156f9be80220361b3d
6
+ metadata.gz: 0167a96bd917e3268deab4aad83073380fbd5b9c61106814f17cd886604acc1ed98dd99006648742f23fc12db85c4da7d4d4c32f9b8e411e542f9c1c6f8c05a5
7
+ data.tar.gz: 72642b914bba4bebe7db3cee4104f77aeba688c7e88efb8f4d2e5dc480f4c3a9211ac653741c9f973fc78ddf7062b84d48ab8b1f144121931588450627b2e545
data/CHANGELOG CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  == HEAD
4
4
 
5
+ == Version 1.107.2 (May 7, 2020)
6
+ * Cybersource: Send a specific card brand commerceIndicator for 3DS [pi3r] #3620
7
+ * Cybersource: Send application_id as partnerSolutionID [pi3r] #3620
8
+ * Iridium: Localize zero-decimal currencies [chinhle23] #3587
9
+ * iVeri: Fix `verify` action [chinhle23] #3588
10
+ * Ixopay: Properly support three-decimal currencies [chinhle23] #3589
11
+ * Kushki: support `auth` and `capture` [therufs] #3591
12
+ * PaymentExpress: Update references to Windcave to reflect rebranding [britth] #3595
13
+ * Decidir: Improve handling of error responses from the gateway [naashton] #3594
14
+ * CyberSource: Added support for MerchantInformation CyberSource-specific fields [apfranzen] #3592
15
+ * ePay: Send unique order ids for remote tests [curiousepic] #3593
16
+ * Checkout V2: Send more informative error messages for 4xx errors [britth] #3601
17
+ * Elavon: Add ssl_dynamic_dba field [apfranzen] #3600
18
+ * iATS Payments: Update gateway to v3 and add support for additional GSFs [naashton] #3599
19
+ * Remove deprecated `rubyforge_project` attribute and tidy up unit test output [fatcatt316] #3598
20
+ * Elavon: Cleanup inadvertant field removal (avs_address) in #3600 [apfranzen] #3602
21
+ * EBANX: Fix transaction amount for verify transaction [miguelxpn] #3603
22
+ * iATS Payments: Update gateway to accept `email`, `phone`, and `country` fields [naashton] #3607
23
+ * Braintree: Fix response for failed refunds when falling back to voids [jasonwebster] #3608
24
+ * Worldpay: Fix response for failed refunds when falling back to voids [jasonwebster] #3609
25
+ * iATS Payments: Add support for Customer Code payment method [molbrown] #3611
26
+ * HPS: Add Google Pay support [MSmedal] #3597
27
+ * Adyen: Parse appropriate message for 3DS2 authorization calls [britth] #3619
28
+
5
29
  == Version 1.107.1 (Apr 1, 2020)
6
30
  * Add `allowed_push_host` to gemspec [mdeloupy]
7
31
 
data/README.md CHANGED
@@ -183,7 +183,7 @@ The [ActiveMerchant Wiki](https://github.com/activemerchant/active_merchant/wiki
183
183
  * [Paybox Direct](http://www.paybox.com/) - FR
184
184
  * [Payeezy](https://developer.payeezy.com/) - CA, US
185
185
  * [Payex](http://payex.com/) - DK, FI, NO, SE
186
- * [PaymentExpress](http://www.paymentexpress.com/) - AU, CA, DE, ES, FR, GB, HK, IE, MY, NL, NZ, SG, US, ZA
186
+ * [Windcave (formerly PaymentExpress)](https://www.windcave.com/) - AU, CA, DE, ES, FR, GB, HK, IE, MY, NL, NZ, SG, US, ZA
187
187
  * [PAYMILL](https://paymill.com) - 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
188
188
  * [PayPal Express Checkout](https://www.paypal.com/webapps/mpp/express-checkout) - US, CA, SG, AU
189
189
  * [PayPal Express Checkout (UK)](https://www.paypal.com/uk/webapps/mpp/express-checkout) - GB
@@ -549,7 +549,7 @@ module ActiveMerchant #:nodoc:
549
549
  end
550
550
 
551
551
  def message_from(action, response)
552
- return authorize_message_from(response) if action.to_s == 'authorise' || action.to_s == 'authorise3d'
552
+ return authorize_message_from(response) if %w(authorise authorise3d authorise3ds2).include?(action.to_s)
553
553
 
554
554
  response['response'] || response['message'] || response['result']
555
555
  end
@@ -98,10 +98,13 @@ module ActiveMerchant #:nodoc:
98
98
 
99
99
  commit do
100
100
  response = response_from_result(@braintree_gateway.transaction.refund(transaction_id, money))
101
- return response if response.success?
102
- return response unless options[:force_full_refund_if_unsettled]
103
101
 
104
- void(transaction_id) if response.message =~ /#{ERROR_CODES[:cannot_refund_if_unsettled]}/
102
+ if !response.success? && options[:force_full_refund_if_unsettled] &&
103
+ response.message =~ /#{ERROR_CODES[:cannot_refund_if_unsettled]}/
104
+ void(transaction_id)
105
+ else
106
+ response
107
+ end
105
108
  end
106
109
  end
107
110
 
@@ -166,7 +166,7 @@ module ActiveMerchant #:nodoc:
166
166
  rescue ResponseError => e
167
167
  raise unless e.response.code.to_s =~ /4\d\d/
168
168
 
169
- response = parse(e.response.body)
169
+ response = parse(e.response.body, error: e.response)
170
170
  end
171
171
 
172
172
  succeeded = success_from(response)
@@ -224,13 +224,16 @@ module ActiveMerchant #:nodoc:
224
224
  response['source'] && response['source']['cvv_check'] ? CVVResult.new(response['source']['cvv_check']) : nil
225
225
  end
226
226
 
227
- def parse(body)
227
+ def parse(body, error: nil)
228
228
  JSON.parse(body)
229
229
  rescue JSON::ParserError
230
- {
230
+ response = {
231
+ 'error_type' => error&.code,
231
232
  'message' => 'Invalid JSON response received from Checkout.com Unified Payments Gateway. Please contact Checkout.com if you continue to receive this message.',
232
233
  'raw_response' => scrub(body)
233
234
  }
235
+ response['error_codes'] = [error&.message] if error&.message
236
+ response
234
237
  end
235
238
 
236
239
  def success_from(response)
@@ -243,7 +246,7 @@ module ActiveMerchant #:nodoc:
243
246
  elsif response['error_type']
244
247
  response['error_type'] + ': ' + response['error_codes'].first
245
248
  else
246
- response['response_summary'] || response['response_code'] || response['status'] || 'Unable to read error message'
249
+ response['response_summary'] || response['response_code'] || response['status'] || response['message'] || 'Unable to read error message'
247
250
  end
248
251
  end
249
252
 
@@ -25,8 +25,15 @@ module ActiveMerchant #:nodoc:
25
25
  self.live_url = 'https://ics2wsa.ic3.com/commerce/1.x/transactionProcessor'
26
26
 
27
27
  # Schema files can be found here: https://ics2ws.ic3.com/commerce/1.x/transactionProcessor/
28
- TEST_XSD_VERSION = '1.159'
29
- PRODUCTION_XSD_VERSION = '1.159'
28
+ TEST_XSD_VERSION = '1.164'
29
+ PRODUCTION_XSD_VERSION = '1.164'
30
+ ECI_BRAND_MAPPING = {
31
+ visa: 'vbv',
32
+ master: 'spa',
33
+ american_express: 'aesk',
34
+ jcb: 'js',
35
+ discover: 'pb',
36
+ }.freeze
30
37
 
31
38
  self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :dankort, :maestro, :elo]
32
39
  self.supported_countries = %w(US BR CA CN DK FI FR DE IN JP MX NO SE GB SG LB PK)
@@ -272,6 +279,7 @@ module ActiveMerchant #:nodoc:
272
279
  add_business_rules_data(xml, creditcard_or_reference, options)
273
280
  add_stored_credential_options(xml, options)
274
281
  add_issuer_additional_data(xml, options)
282
+ add_merchant_description(xml, options)
275
283
 
276
284
  xml.target!
277
285
  end
@@ -298,6 +306,8 @@ module ActiveMerchant #:nodoc:
298
306
  add_capture_service(xml, request_id, request_token)
299
307
  add_business_rules_data(xml, authorization, options)
300
308
  add_issuer_additional_data(xml, options)
309
+ add_merchant_description(xml, options)
310
+
301
311
  xml.target!
302
312
  end
303
313
 
@@ -316,6 +326,7 @@ module ActiveMerchant #:nodoc:
316
326
  add_business_rules_data(xml, payment_method_or_reference, options) unless options[:pinless_debit_card]
317
327
  end
318
328
  add_issuer_additional_data(xml, options)
329
+ add_merchant_description(xml, options)
319
330
 
320
331
  xml.target!
321
332
  end
@@ -356,6 +367,7 @@ module ActiveMerchant #:nodoc:
356
367
  add_mdd_fields(xml, options)
357
368
  add_credit_service(xml)
358
369
  add_issuer_additional_data(xml, options)
370
+ add_merchant_description(xml, options)
359
371
 
360
372
  xml.target!
361
373
  end
@@ -459,6 +471,8 @@ module ActiveMerchant #:nodoc:
459
471
  xml.tag! 'clientLibrary', 'Ruby Active Merchant'
460
472
  xml.tag! 'clientLibraryVersion', VERSION
461
473
  xml.tag! 'clientEnvironment', RUBY_PLATFORM
474
+ xml.tag!('partnerSolutionID', application_id) if application_id
475
+
462
476
  add_merchant_descriptor(xml, options)
463
477
  end
464
478
 
@@ -470,6 +484,18 @@ module ActiveMerchant #:nodoc:
470
484
  end
471
485
  end
472
486
 
487
+ def add_merchant_description(xml, options)
488
+ return unless options[:merchant_descriptor_name] || options[:merchant_descriptor_address1] || options[:merchant_descriptor_locality]
489
+
490
+ xml.tag! 'merchantInformation' do
491
+ xml.tag! 'merchantDescriptor' do
492
+ xml.tag! 'name', options[:merchant_descriptor_name] if options[:merchant_descriptor_name]
493
+ xml.tag! 'address1', options[:merchant_descriptor_address1] if options[:merchant_descriptor_address1]
494
+ xml.tag! 'locality', options[:merchant_descriptor_locality] if options[:merchant_descriptor_locality]
495
+ end
496
+ end
497
+ end
498
+
473
499
  def add_purchase_data(xml, money = 0, include_grand_total = false, options={})
474
500
  xml.tag! 'purchaseTotals' do
475
501
  xml.tag! 'currency', options[:currency] || currency(money)
@@ -581,7 +607,7 @@ module ActiveMerchant #:nodoc:
581
607
  xml.tag!('cavvAlgorithm', threeds_2_options[:cavv_algorithm]) if threeds_2_options[:cavv_algorithm]
582
608
  xml.tag!('paSpecificationVersion', threeds_2_options[:version]) if threeds_2_options[:version]
583
609
  xml.tag!('directoryServerTransactionID', threeds_2_options[:ds_transaction_id]) if threeds_2_options[:ds_transaction_id]
584
- xml.tag!('commerceIndicator', options[:commerce_indicator]) if options[:commerce_indicator]
610
+ xml.tag!('commerceIndicator', options[:commerce_indicator] || ECI_BRAND_MAPPING[card_brand(payment_method).to_sym])
585
611
  xml.tag!('eciRaw', threeds_2_options[:eci]) if threeds_2_options[:eci]
586
612
  xml.tag!('xid', threeds_2_options[:xid]) if threeds_2_options[:xid]
587
613
  xml.tag!('veresEnrolled', threeds_2_options[:enrolled]) if threeds_2_options[:enrolled]
@@ -613,12 +639,13 @@ module ActiveMerchant #:nodoc:
613
639
 
614
640
  def add_auth_network_tokenization(xml, payment_method, options)
615
641
  return unless network_tokenization?(payment_method)
642
+ brand = card_brand(payment_method).to_sym
616
643
 
617
- case card_brand(payment_method).to_sym
644
+ case brand
618
645
  when :visa
619
646
  xml.tag! 'ccAuthService', {'run' => 'true'} do
620
647
  xml.tag!('cavv', payment_method.payment_cryptogram)
621
- xml.tag!('commerceIndicator', 'vbv')
648
+ xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand])
622
649
  xml.tag!('xid', payment_method.payment_cryptogram)
623
650
  end
624
651
  when :master
@@ -627,13 +654,13 @@ module ActiveMerchant #:nodoc:
627
654
  xml.tag!('collectionIndicator', '2')
628
655
  end
629
656
  xml.tag! 'ccAuthService', {'run' => 'true'} do
630
- xml.tag!('commerceIndicator', 'spa')
657
+ xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand])
631
658
  end
632
659
  when :american_express
633
660
  cryptogram = Base64.decode64(payment_method.payment_cryptogram)
634
661
  xml.tag! 'ccAuthService', {'run' => 'true'} do
635
662
  xml.tag!('cavv', Base64.encode64(cryptogram[0...20]))
636
- xml.tag!('commerceIndicator', 'aesk')
663
+ xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand])
637
664
  xml.tag!('xid', Base64.encode64(cryptogram[20...40]))
638
665
  end
639
666
  end
@@ -266,6 +266,11 @@ module ActiveMerchant #:nodoc:
266
266
  error_code ||= error['type']
267
267
  elsif response['error_type']
268
268
  error_code = response['error_type'] if response['validation_errors']
269
+ elsif error = response.dig('error')
270
+ validation_errors = error.dig('validation_errors', 0)
271
+ code = validation_errors['code'] if validation_errors && validation_errors['code']
272
+ param = validation_errors['param'] if validation_errors && validation_errors['param']
273
+ error_code = "#{error['error_type']} | #{code} | #{param}" if error['error_type']
269
274
  end
270
275
 
271
276
  error_code || STANDARD_ERROR_CODE[:processing_error]
@@ -37,6 +37,15 @@ module ActiveMerchant #:nodoc:
37
37
  store: :post
38
38
  }
39
39
 
40
+ VERIFY_AMOUNT_PER_COUNTRY = {
41
+ 'br' => 100,
42
+ 'ar' => 100,
43
+ 'co' => 100,
44
+ 'pe' => 300,
45
+ 'mx' => 300,
46
+ 'cl' => 5000
47
+ }
48
+
40
49
  def initialize(options={})
41
50
  requires!(options, :integration_key)
42
51
  super
@@ -65,6 +74,7 @@ module ActiveMerchant #:nodoc:
65
74
  add_card_or_token(post, payment)
66
75
  add_address(post, options)
67
76
  add_customer_responsible_person(post, payment, options)
77
+ add_additional_data(post, options)
68
78
  post[:payment][:creditcard][:auto_capture] = false
69
79
 
70
80
  commit(:authorize, post)
@@ -109,7 +119,7 @@ module ActiveMerchant #:nodoc:
109
119
 
110
120
  def verify(credit_card, options={})
111
121
  MultiResponse.run(:use_first_response) do |r|
112
- r.process { authorize(100, credit_card, options) }
122
+ r.process { authorize(VERIFY_AMOUNT_PER_COUNTRY[customer_country(options)], credit_card, options) }
113
123
  r.process(:ignore_result) { void(r.authorization, options) }
114
124
  end
115
125
  end
@@ -47,6 +47,7 @@ module ActiveMerchant #:nodoc:
47
47
  add_customer_data(form, options)
48
48
  add_test_mode(form, options)
49
49
  add_ip(form, options)
50
+ add_ssl_dynamic_dba(form, options)
50
51
  commit(:purchase, money, form, options)
51
52
  end
52
53
 
@@ -60,6 +61,7 @@ module ActiveMerchant #:nodoc:
60
61
  add_customer_data(form, options)
61
62
  add_test_mode(form, options)
62
63
  add_ip(form, options)
64
+ add_ssl_dynamic_dba(form, options)
63
65
  commit(:authorize, money, form, options)
64
66
  end
65
67
 
@@ -249,6 +251,10 @@ module ActiveMerchant #:nodoc:
249
251
  form[:cardholder_ip] = options[:ip] if options.has_key?(:ip)
250
252
  end
251
253
 
254
+ def add_ssl_dynamic_dba(form, options)
255
+ form[:dynamic_dba] = options[:dba] if options.has_key?(:dba)
256
+ end
257
+
252
258
  def message_from(response)
253
259
  success?(response) ? response['result_message'] : response['errorMessage']
254
260
  end
@@ -21,6 +21,8 @@ module ActiveMerchant #:nodoc:
21
21
  visa: 'Visa 3DSecure',
22
22
  american_express: 'AMEX 3DSecure',
23
23
  discover: 'Discover 3DSecure',
24
+ android_pay: 'GooglePayApp',
25
+ google_pay: 'GooglePayApp'
24
26
  }
25
27
 
26
28
  def initialize(options={})
@@ -14,12 +14,13 @@ module ActiveMerchant #:nodoc:
14
14
  self.display_name = 'iATS Payments'
15
15
 
16
16
  ACTIONS = {
17
- purchase: 'ProcessCreditCardV1',
18
- purchase_check: 'ProcessACHEFTV1',
19
- refund: 'ProcessCreditCardRefundWithTransactionIdV1',
20
- refund_check: 'ProcessACHEFTRefundWithTransactionIdV1',
21
- store: 'CreateCreditCardCustomerCodeV1',
22
- unstore: 'DeleteCustomerCodeV1'
17
+ purchase: 'ProcessCreditCard',
18
+ purchase_check: 'ProcessACHEFT',
19
+ purchase_customer_code: 'ProcessCreditCardWithCustomerCode',
20
+ refund: 'ProcessCreditCardRefundWithTransactionId',
21
+ refund_check: 'ProcessACHEFTRefundWithTransactionId',
22
+ store: 'CreateCreditCardCustomerCode',
23
+ unstore: 'DeleteCustomerCode'
23
24
  }
24
25
 
25
26
  def initialize(options={})
@@ -42,7 +43,7 @@ module ActiveMerchant #:nodoc:
42
43
  add_ip(post, options)
43
44
  add_description(post, options)
44
45
 
45
- commit((payment.is_a?(Check) ? :purchase_check : :purchase), post)
46
+ commit(determine_purchase_type(payment), post)
46
47
  end
47
48
 
48
49
  def refund(money, authorization, options={})
@@ -90,6 +91,16 @@ module ActiveMerchant #:nodoc:
90
91
 
91
92
  private
92
93
 
94
+ def determine_purchase_type(payment)
95
+ if payment.is_a?(String)
96
+ :purchase_customer_code
97
+ elsif payment.is_a?(Check)
98
+ :purchase_check
99
+ else
100
+ :purchase
101
+ end
102
+ end
103
+
93
104
  def add_ip(post, options)
94
105
  post[:customer_ip_address] = options[:ip] if options.has_key?(:ip)
95
106
  end
@@ -101,6 +112,9 @@ module ActiveMerchant #:nodoc:
101
112
  post[:city] = billing_address[:city]
102
113
  post[:state] = billing_address[:state]
103
114
  post[:zip_code] = billing_address[:zip]
115
+ post[:phone] = billing_address[:phone] if billing_address[:phone]
116
+ post[:email] = billing_address[:email] if billing_address[:email]
117
+ post[:country] = billing_address[:country] if billing_address[:country]
104
118
  end
105
119
  end
106
120
 
@@ -114,7 +128,9 @@ module ActiveMerchant #:nodoc:
114
128
  end
115
129
 
116
130
  def add_payment(post, payment)
117
- if payment.is_a?(Check)
131
+ if payment.is_a?(String)
132
+ post[:customer_code] = payment
133
+ elsif payment.is_a?(Check)
118
134
  add_check(post, payment)
119
135
  else
120
136
  add_credit_card(post, payment)
@@ -178,12 +194,13 @@ module ActiveMerchant #:nodoc:
178
194
 
179
195
  def endpoints
180
196
  {
181
- purchase: 'ProcessLink.asmx',
182
- purchase_check: 'ProcessLink.asmx',
183
- refund: 'ProcessLink.asmx',
184
- refund_check: 'ProcessLink.asmx',
185
- store: 'CustomerLink.asmx',
186
- unstore: 'CustomerLink.asmx'
197
+ purchase: 'ProcessLinkv3.asmx',
198
+ purchase_check: 'ProcessLinkv3.asmx',
199
+ purchase_customer_code: 'ProcessLinkv3.asmx',
200
+ refund: 'ProcessLinkv3.asmx',
201
+ refund_check: 'ProcessLinkv3.asmx',
202
+ store: 'CustomerLinkv3.asmx',
203
+ unstore: 'CustomerLinkv3.asmx'
187
204
  }
188
205
  end
189
206
 
@@ -291,7 +291,8 @@ module ActiveMerchant #:nodoc:
291
291
  order_id, cross_reference, _ = authorization.split(';')
292
292
  build_request(options) do |xml|
293
293
  if money
294
- details = {'CurrencyCode' => currency_code(options[:currency] || default_currency), 'Amount' => amount(money)}
294
+ currency = options[:currency] || currency(money)
295
+ details = {'CurrencyCode' => currency_code(currency), 'Amount' => localized_amount(money, currency)}
295
296
  else
296
297
  details = {'CurrencyCode' => currency_code(default_currency), 'Amount' => '0'}
297
298
  end
@@ -327,8 +328,9 @@ module ActiveMerchant #:nodoc:
327
328
  end
328
329
 
329
330
  def add_purchase_data(xml, type, money, options)
331
+ currency = options[:currency] || currency(money)
330
332
  requires!(options, :order_id)
331
- xml.tag! 'TransactionDetails', {'Amount' => amount(money), 'CurrencyCode' => currency_code(options[:currency] || currency(money))} do
333
+ xml.tag! 'TransactionDetails', {'Amount' => localized_amount(money, currency), 'CurrencyCode' => currency_code(currency)} do
332
334
  xml.tag! 'MessageDetails', {'TransactionType' => type}
333
335
  xml.tag! 'OrderID', options[:order_id]
334
336
  xml.tag! 'TransactionControl' do
@@ -60,7 +60,10 @@ module ActiveMerchant #:nodoc:
60
60
  end
61
61
 
62
62
  def verify(credit_card, options={})
63
- authorize(0, credit_card, options)
63
+ MultiResponse.run(:use_first_response) do |r|
64
+ r.process { authorize(100, credit_card, options) }
65
+ r.process(:ignore_result) { void(r.authorization, options) }
66
+ end
64
67
  end
65
68
 
66
69
  def verify_credentials
@@ -8,6 +8,7 @@ module ActiveMerchant #:nodoc:
8
8
 
9
9
  self.supported_countries = %w(AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW)
10
10
  self.default_currency = 'EUR'
11
+ self.currencies_with_three_decimal_places = %w(BHD IQD JOD KWD LWD OMR TND)
11
12
  self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :maestro]
12
13
 
13
14
  self.homepage_url = 'https://www.ixopay.com'
@@ -4,8 +4,8 @@ module ActiveMerchant #:nodoc:
4
4
  self.display_name = 'Kushki'
5
5
  self.homepage_url = 'https://www.kushkipagos.com'
6
6
 
7
- self.test_url = 'https://api-uat.kushkipagos.com/v1/'
8
- self.live_url = 'https://api.kushkipagos.com/v1/'
7
+ self.test_url = 'https://api-uat.kushkipagos.com/'
8
+ self.live_url = 'https://api.kushkipagos.com/'
9
9
 
10
10
  self.supported_countries = ['CL', 'CO', 'EC', 'MX', 'PE']
11
11
  self.default_currency = 'USD'
@@ -24,6 +24,23 @@ module ActiveMerchant #:nodoc:
24
24
  end
25
25
  end
26
26
 
27
+ def authorize(amount, payment_method, options={})
28
+ MultiResponse.run() do |r|
29
+ r.process { tokenize(amount, payment_method, options) }
30
+ r.process { preauthorize(amount, r.authorization, options) }
31
+ end
32
+ end
33
+
34
+ def capture(amount, authorization, options={})
35
+ action = 'capture'
36
+
37
+ post = {}
38
+ post[:ticketNumber] = authorization
39
+ add_invoice(action, post, amount, options)
40
+
41
+ commit(action, post)
42
+ end
43
+
27
44
  def refund(amount, authorization, options={})
28
45
  action = 'refund'
29
46
 
@@ -75,6 +92,16 @@ module ActiveMerchant #:nodoc:
75
92
  commit(action, post)
76
93
  end
77
94
 
95
+ def preauthorize(amount, authorization, options)
96
+ action = 'preAuthorization'
97
+
98
+ post = {}
99
+ add_reference(post, authorization, options)
100
+ add_invoice(action, post, amount, options)
101
+
102
+ commit(action, post)
103
+ end
104
+
78
105
  def add_invoice(action, post, money, options)
79
106
  if action == 'tokenize'
80
107
  post[:totalAmount] = amount(money).to_f
@@ -131,7 +158,9 @@ module ActiveMerchant #:nodoc:
131
158
  'tokenize' => 'tokens',
132
159
  'charge' => 'charges',
133
160
  'void' => 'charges',
134
- 'refund' => 'refund'
161
+ 'refund' => 'refund',
162
+ 'preAuthorization' => 'preAuthorization',
163
+ 'capture' => 'capture'
135
164
  }
136
165
 
137
166
  def commit(action, params)
@@ -178,9 +207,9 @@ module ActiveMerchant #:nodoc:
178
207
  base_url = test? ? test_url : live_url
179
208
 
180
209
  if ['void', 'refund'].include?(action)
181
- base_url + ENDPOINT[action] + '/' + params[:ticketNumber].to_s
210
+ base_url + 'v1/' + ENDPOINT[action] + '/' + params[:ticketNumber].to_s
182
211
  else
183
- base_url + ENDPOINT[action]
212
+ base_url + 'card/v1/' + ENDPOINT[action]
184
213
  end
185
214
  end
186
215
 
@@ -17,8 +17,8 @@ module ActiveMerchant #:nodoc:
17
17
 
18
18
  self.supported_countries = %w[AU FJ GB HK IE MY NZ PG SG US]
19
19
 
20
- self.homepage_url = 'http://www.paymentexpress.com/'
21
- self.display_name = 'PaymentExpress'
20
+ self.homepage_url = 'https://www.windcave.com/'
21
+ self.display_name = 'Windcave (formerly PaymentExpress)'
22
22
 
23
23
  self.live_url = 'https://sec.paymentexpress.com/pxpost.aspx'
24
24
  self.test_url = 'https://uat.paymentexpress.com/pxpost.aspx'
@@ -94,10 +94,12 @@ module ActiveMerchant #:nodoc:
94
94
  r.process { refund_request(money, authorization, options) }
95
95
  end
96
96
 
97
- return response if response.success?
98
- return response unless options[:force_full_refund_if_unsettled]
99
-
100
- void(authorization, options) if response.params['last_event'] == 'AUTHORISED'
97
+ if !response.success? && options[:force_full_refund_if_unsettled] &&
98
+ response.params['last_event'] == 'AUTHORISED'
99
+ void(authorization, options)
100
+ else
101
+ response
102
+ end
101
103
  end
102
104
 
103
105
  # Credits only function on a Merchant ID/login/profile flagged for Payouts
@@ -580,7 +582,7 @@ module ActiveMerchant #:nodoc:
580
582
  xml = ssl_post(url, request, headers(options))
581
583
  raw = parse(action, xml)
582
584
  if options[:execute_threed]
583
- raw[:cookie] = @cookie
585
+ raw[:cookie] = @cookie if defined?(@cookie)
584
586
  raw[:session_id] = options[:session_id]
585
587
  raw[:is3DSOrder] = true
586
588
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = '1.107.1'
2
+ VERSION = '1.107.2'
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.107.1
4
+ version: 1.107.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-01 00:00:00.000000000 Z
11
+ date: 2020-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport