killbill-paypal-express 5.0.12 → 5.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paypal_express/api.rb +12 -6
- 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: 54f8a08d21c46e77b8f4bc4a33e2080d97057d41
|
4
|
+
data.tar.gz: e6faa116b3e5e1ac45f03d6724cdef59f6f55344
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9e7263c70a43baa8f56ef151f32b24d8891e8263e82907519119157a9cc590e4178a196fca82f96300b3da509806b73e1b2cb6a27bc38d7dcfe7e096a69dc74
|
7
|
+
data.tar.gz: 0d84744e2c50defa9a42f4df2858ac1c75a25aa62fbc1afeb20ca6fecc2591168ac39de33d2b71c3ba50fc80cdae565839340d153369c05716eab9e0623b0b13
|
data/lib/paypal_express/api.rb
CHANGED
@@ -301,16 +301,21 @@ module Killbill #:nodoc:
|
|
301
301
|
response
|
302
302
|
end
|
303
303
|
|
304
|
-
def
|
304
|
+
def add_default_options(kb_payment_transaction_id, options)
|
305
|
+
options[:payment_type] ||= 'Any'
|
306
|
+
options[:invoice_id] ||= kb_payment_transaction_id
|
307
|
+
options[:ip] ||= @ip
|
308
|
+
end
|
309
|
+
|
310
|
+
def add_payment_method_options(kb_account_id, kb_payment_method_id, context, options, properties_hash)
|
311
|
+
options[:token] = ::Killbill::Plugin::ActiveMerchant::Utils.normalized(properties_hash, :token) || find_last_token(kb_account_id, context.tenant_id)
|
312
|
+
options[:reference_id] = ::Killbill::Plugin::ActiveMerchant::Utils.normalized(properties_hash, :baid)
|
313
|
+
|
305
314
|
payment_method = @payment_method_model.from_kb_payment_method_id(kb_payment_method_id, context.tenant_id)
|
306
315
|
|
307
316
|
options[:payer_id] ||= payment_method.paypal_express_payer_id.presence
|
308
317
|
options[:token] ||= payment_method.paypal_express_token.presence
|
309
318
|
options[:reference_id] ||= payment_method.token.presence # baid
|
310
|
-
|
311
|
-
options[:payment_type] ||= 'Any'
|
312
|
-
options[:invoice_id] ||= kb_payment_transaction_id
|
313
|
-
options[:ip] ||= @ip
|
314
319
|
end
|
315
320
|
|
316
321
|
def initiate_express_checkout(kb_account_id, amount, currency, properties, context)
|
@@ -371,7 +376,8 @@ module Killbill #:nodoc:
|
|
371
376
|
transaction
|
372
377
|
else
|
373
378
|
options = {}
|
374
|
-
|
379
|
+
add_default_options(kb_payment_transaction_id, options)
|
380
|
+
add_payment_method_options(kb_account_id, kb_payment_method_id, context, options, properties_hash)
|
375
381
|
options[:token] = ::Killbill::Plugin::ActiveMerchant::Utils.normalized(properties_hash, :token) || find_last_token(kb_account_id, context.tenant_id)
|
376
382
|
# Find the payment_processor_id if not provided
|
377
383
|
payment_processor_account_id ||= find_payment_processor_id_from_initial_call(kb_account_id, context.tenant_id, options[:token])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: killbill-paypal-express
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.13
|
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: 2019-06-
|
11
|
+
date: 2019-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|