killbill-cybersource 4.0.8 → 4.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/NEWS +4 -0
- data/VERSION +1 -1
- data/lib/cybersource/api.rb +2 -2
- data/lib/cybersource/ext/active_merchant/active_merchant.rb +3 -1
- data/pom.xml +1 -1
- data/spec/cybersource/remote/integration_spec.rb +56 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f29b96955182c07ea9f8c6c0b2664828c9b385d
|
4
|
+
data.tar.gz: 43392e1684880a50f286cdaaae67b8c8666e2d91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ccc1ae57b5fef06cf6e45f2518704aaebaaf3f0b195a8356f4a9eae084cdb748e245e6e04d1f67d42580c5c8d981eec90276df47826c6bbdd50e2dfd190d292
|
7
|
+
data.tar.gz: 2da7bfe0ff896e517ea1ec8be1450cf850633274b629afad4cac5997947a2ac1fd16b62aa1560f3cec2c4f98f2aeef58bb879050432432835334f6a622ee1ba9
|
data/Gemfile.lock
CHANGED
data/NEWS
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.0.
|
1
|
+
4.0.9
|
data/lib/cybersource/api.rb
CHANGED
@@ -2,7 +2,7 @@ module Killbill #:nodoc:
|
|
2
2
|
module Cybersource #:nodoc:
|
3
3
|
class PaymentPlugin < ::Killbill::Plugin::ActiveMerchant::PaymentPlugin
|
4
4
|
|
5
|
-
|
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) ||
|
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
|
-
|
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.
|
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.
|
200
|
-
check_response(payment_response, @amount, :
|
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.
|
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-
|
11
|
+
date: 2016-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: killbill
|