killbill-paypal-express 5.0.13 → 5.0.14

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/paypal_express/api.rb +24 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54f8a08d21c46e77b8f4bc4a33e2080d97057d41
4
- data.tar.gz: e6faa116b3e5e1ac45f03d6724cdef59f6f55344
3
+ metadata.gz: 3f986a90b244426935eaf2dc513c48f6a27c6b8f
4
+ data.tar.gz: 348e81e5bdef89834a83b811c96521e42ae70ed2
5
5
  SHA512:
6
- metadata.gz: e9e7263c70a43baa8f56ef151f32b24d8891e8263e82907519119157a9cc590e4178a196fca82f96300b3da509806b73e1b2cb6a27bc38d7dcfe7e096a69dc74
7
- data.tar.gz: 0d84744e2c50defa9a42f4df2858ac1c75a25aa62fbc1afeb20ca6fecc2591168ac39de33d2b71c3ba50fc80cdae565839340d153369c05716eab9e0623b0b13
6
+ metadata.gz: d9af7a1ceb33f2154b1747b9f0104d53c4b42dc802a43827e621224cd9a4140e430b75232a7e35610908747b70f6e85384e7e9f8484be2e78a53fe829982adb5
7
+ data.tar.gz: f62ec07a6d4350c2bcadfcdb855f0006fb61428079c818a3b8706eb787b74f9db30bbfadb0279a6c7467609a23d08037dc3b90559d2160eacac80e98295a6846
@@ -620,15 +620,19 @@ module Killbill #:nodoc:
620
620
  end
621
621
 
622
622
  def get_raw_payment_info(kb_payment_id, context)
623
- ignored_api_calls = [:details_for]
624
623
  responses = @response_model.from_kb_payment_id(@transaction_model, kb_payment_id, context.tenant_id)
624
+ details_for_response = responses.select {|r| r.api_call.to_sym == :details_for}.last
625
+ details_for_plugin_info = details_for_response.nil? ? nil : details_for_response.to_transaction_info_plugin
626
+
625
627
  responses = responses.reject do |response|
626
- ignored_api_calls.include?(response.api_call.to_sym)
628
+ response == details_for_response
627
629
  end
628
630
  t_info_plugins = responses.collect do |response|
629
631
  response.to_transaction_info_plugin(response.send("#{@identifier}_transaction"))
630
632
  end
631
633
 
634
+ merge_selected_properties_from_details_call(t_info_plugins, details_for_plugin_info, [:payerEmail])
635
+
632
636
  # Completed purchases/authorizations will have two rows in the responses table (one for api_call 'build_form_descriptor', one for api_call 'purchase/authorize')
633
637
  # Other transaction types don't support the :PENDING state
634
638
  target_transaction_types = [:PURCHASE, :AUTHORIZE]
@@ -638,6 +642,24 @@ module Killbill #:nodoc:
638
642
  t_info_plugins_without_pending = t_info_plugins.reject { |t_info_plugin| target_transaction_types.include?(t_info_plugin.transaction_type) && t_info_plugin.status == :PENDING }
639
643
  [with_only_pending_trx ? t_info_plugins : t_info_plugins_without_pending, t_info_plugins, with_only_pending_trx]
640
644
  end
645
+
646
+ def merge_selected_properties_from_details_call(plugin_infos, to_merge_plugin_info, merge_properties)
647
+ unless to_merge_plugin_info.nil?
648
+ matched_trx_plugin_info = plugin_infos.detect {|info| info.kb_transaction_payment_id == to_merge_plugin_info.kb_transaction_payment_id}
649
+ unless matched_trx_plugin_info.nil?
650
+ merge_properties.each do |p|
651
+ p_value = find_value_from_properties(to_merge_plugin_info.properties, p)
652
+ unless p_value.blank?
653
+ if matched_trx_plugin_info.properties.detect {|mp| mp.key.to_s == p.to_s}.nil?
654
+ matched_trx_plugin_info.properties << create_plugin_property(p.to_s, p_value)
655
+ else
656
+ matched_trx_plugin_info.properties.detect {|mp| mp.key.to_s == p.to_s} .value = p_value
657
+ end
658
+ end
659
+ end
660
+ end
661
+ end
662
+ end
641
663
  end
642
664
  end
643
665
  end
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.13
4
+ version: 5.0.14
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-28 00:00:00.000000000 Z
11
+ date: 2019-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement