killbill-cybersource 4.0.8 → 4.0.9

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
  SHA1:
3
- metadata.gz: e5e9dc0988edff5c4623bbe0b78fff943f7deeca
4
- data.tar.gz: 8021eb5f7e6a7ad4c8132ecf7f7d7a2f96fc4523
3
+ metadata.gz: 7f29b96955182c07ea9f8c6c0b2664828c9b385d
4
+ data.tar.gz: 43392e1684880a50f286cdaaae67b8c8666e2d91
5
5
  SHA512:
6
- metadata.gz: 8c8240aff2da9f916e0dad419b4ca2a335a38850ec4628046819d858dc5fead9fbccda182e22cee2340f655a54a5d21449e440e9b5a2cbc9c6985239ca1d6b50
7
- data.tar.gz: 25bf63b13df3da99c28903e0534398dedd6e24ae3c80b4e6799f6d0e62e78d4aa8b236fa3a713ee0373d33cdeed5b5c7fc12b5bf16ff021b5481b75c34919847
6
+ metadata.gz: 6ccc1ae57b5fef06cf6e45f2518704aaebaaf3f0b195a8356f4a9eae084cdb748e245e6e04d1f67d42580c5c8d981eec90276df47826c6bbdd50e2dfd190d292
7
+ data.tar.gz: 2da7bfe0ff896e517ea1ec8be1450cf850633274b629afad4cac5997947a2ac1fd16b62aa1560f3cec2c4f98f2aeef58bb879050432432835334f6a622ee1ba9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- killbill-cybersource (4.0.8)
4
+ killbill-cybersource (4.0.9)
5
5
  actionpack (~> 4.1.0)
6
6
  actionview (~> 4.1.0)
7
7
  activemerchant (~> 1.48.0)
data/NEWS CHANGED
@@ -1,3 +1,7 @@
1
+ 4.0.9
2
+ Android Pay bugfix
3
+ Cancel UNDEFINED payments after 24 hours by default
4
+
1
5
  4.0.8
2
6
  Add Android Pay support
3
7
  Add support for merchant descriptors
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.0.8
1
+ 4.0.9
@@ -2,7 +2,7 @@ module Killbill #:nodoc:
2
2
  module Cybersource #:nodoc:
3
3
  class PaymentPlugin < ::Killbill::Plugin::ActiveMerchant::PaymentPlugin
4
4
 
5
- SEVEN_DAYS_AGO = (7 * 86400)
5
+ ONE_DAY_AGO = (1 * 86400)
6
6
  SIXTY_DAYS_AGO = (60 * 86400)
7
7
 
8
8
  def initialize
@@ -152,7 +152,7 @@ module Killbill #:nodoc:
152
152
  # Report API not configured, connection problem or skip_gw=true
153
153
  next if report.nil?
154
154
 
155
- threshold = (Killbill::Plugin::ActiveMerchant::Utils.normalized(options, :cancel_threshold) || SEVEN_DAYS_AGO).to_i
155
+ threshold = (Killbill::Plugin::ActiveMerchant::Utils.normalized(options, :cancel_threshold) || ONE_DAY_AGO).to_i
156
156
  should_cancel_payment = (now - report_date) >= threshold
157
157
  if report.empty? && !should_cancel_payment
158
158
  # We'll retry later
@@ -64,7 +64,9 @@ module ActiveMerchant
64
64
  xml.tag! 'ccAuthService', {'run' => 'true'} do
65
65
  xml.tag!("cavv", Base64.encode64(cryptogram[0...20]))
66
66
  xml.tag!("commerceIndicator", options[:commerce_indicator] || "aesk")
67
- xml.tag!("xid", Base64.encode64(cryptogram[20...40]))
67
+ if cryptogram.size == 40
68
+ xml.tag!("xid", Base64.encode64(cryptogram[20...40]))
69
+ end
68
70
  end
69
71
  end
70
72
  end
data/pom.xml CHANGED
@@ -25,7 +25,7 @@
25
25
  <groupId>org.kill-bill.billing.plugin.ruby</groupId>
26
26
  <artifactId>cybersource-plugin</artifactId>
27
27
  <packaging>pom</packaging>
28
- <version>4.0.8</version>
28
+ <version>4.0.9</version>
29
29
  <name>cybersource-plugin</name>
30
30
  <url>http://github.com/killbill/killbill-cybersource-plugin</url>
31
31
  <description>Plugin for accessing Cybersource as a payment gateway</description>
@@ -182,6 +182,18 @@ describe Killbill::Cybersource::PaymentPlugin do
182
182
  kb_payment = setup_kb_payment
183
183
  payment_response = @plugin.purchase_payment(@pm.kb_account_id, kb_payment.id, kb_payment.transactions[0].id, @pm.kb_payment_method_id, @amount, @currency, properties, @call_context)
184
184
  check_response(payment_response, @amount, :PURCHASE, :PROCESSED, 'Successful transaction', '100')
185
+
186
+ properties = build_pm_properties(nil,
187
+ {
188
+ :cc_number => 378282246310005,
189
+ :cc_type => 'american_express',
190
+ :payment_cryptogram => 'AAAAAAAAAAAAAAAAAABBBBBBBBB=',
191
+ :ignore_avs => true,
192
+ :ignore_cvv => true
193
+ })
194
+ kb_payment = setup_kb_payment
195
+ payment_response = @plugin.purchase_payment(@pm.kb_account_id, kb_payment.id, kb_payment.transactions[0].id, @pm.kb_payment_method_id, @amount, @currency, properties, @call_context)
196
+ check_response(payment_response, @amount, :PURCHASE, :PROCESSED, 'Successful transaction', '100')
185
197
  end
186
198
 
187
199
  it 'should be able to pay with Android Pay' do
@@ -196,8 +208,50 @@ describe Killbill::Cybersource::PaymentPlugin do
196
208
  properties << build_property('source', 'androidpay')
197
209
 
198
210
  kb_payment = setup_kb_payment
199
- payment_response = @plugin.authorize_payment(@pm.kb_account_id, kb_payment.id, kb_payment.transactions[0].id, @pm.kb_payment_method_id, @amount, @currency, properties, @call_context)
200
- check_response(payment_response, @amount, :AUTHORIZE, :PROCESSED, 'Successful transaction', '100')
211
+ payment_response = @plugin.purchase_payment(@pm.kb_account_id, kb_payment.id, kb_payment.transactions[0].id, @pm.kb_payment_method_id, @amount, @currency, properties, @call_context)
212
+ check_response(payment_response, @amount, :PURCHASE, :PROCESSED, 'Successful transaction', '100')
213
+
214
+ properties = build_pm_properties(nil,
215
+ {
216
+ :cc_number => 5555555555554444,
217
+ :cc_type => 'master',
218
+ :payment_cryptogram => 'EHuWW9PiBkWvqE5juRwDzAUFBAk=',
219
+ :ignore_avs => true,
220
+ :ignore_cvv => true
221
+ })
222
+ properties << build_property('source', 'androidpay')
223
+
224
+ kb_payment = setup_kb_payment
225
+ payment_response = @plugin.purchase_payment(@pm.kb_account_id, kb_payment.id, kb_payment.transactions[0].id, @pm.kb_payment_method_id, @amount, @currency, properties, @call_context)
226
+ check_response(payment_response, @amount, :PURCHASE, :PROCESSED, 'Successful transaction', '100')
227
+
228
+ properties = build_pm_properties(nil,
229
+ {
230
+ :cc_number => 378282246310005,
231
+ :cc_type => 'american_express',
232
+ :payment_cryptogram => 'AAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBB==',
233
+ :ignore_avs => true,
234
+ :ignore_cvv => true
235
+ })
236
+ properties << build_property('source', 'androidpay')
237
+
238
+ kb_payment = setup_kb_payment
239
+ payment_response = @plugin.purchase_payment(@pm.kb_account_id, kb_payment.id, kb_payment.transactions[0].id, @pm.kb_payment_method_id, @amount, @currency, properties, @call_context)
240
+ check_response(payment_response, @amount, :PURCHASE, :PROCESSED, 'Successful transaction', '100')
241
+
242
+ properties = build_pm_properties(nil,
243
+ {
244
+ :cc_number => 378282246310005,
245
+ :cc_type => 'american_express',
246
+ :payment_cryptogram => 'AAAAAAAAAAAAAAAAAABBBBBBBBB=',
247
+ :ignore_avs => true,
248
+ :ignore_cvv => true
249
+ })
250
+ properties << build_property('source', 'androidpay')
251
+
252
+ kb_payment = setup_kb_payment
253
+ payment_response = @plugin.purchase_payment(@pm.kb_account_id, kb_payment.id, kb_payment.transactions[0].id, @pm.kb_payment_method_id, @amount, @currency, properties, @call_context)
254
+ check_response(payment_response, @amount, :PURCHASE, :PROCESSED, 'Successful transaction', '100')
201
255
  end
202
256
 
203
257
  it 'should be able to fix UNDEFINED payments' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-cybersource
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.8
4
+ version: 4.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kill Bill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-15 00:00:00.000000000 Z
11
+ date: 2016-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: killbill