spree-paypal_platform 5.1.1 → 5.1.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8a5221aa76bed440ec3e3c43943dd19d5230363f0af8a2b019de30451b6b5a17
|
|
4
|
+
data.tar.gz: 211d91d6bdbfaa92915b5c83902e41da2945a07701fc4165be9fc33951ce85d4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7a3000e8e2ba28578737283bdff1c0c12aee5bb13504d3491cea317e690da1accd91dfa49ff965683dbdaec7397ab6b56a5b898d3495c0d14e505f5a2cb83a52
|
|
7
|
+
data.tar.gz: 94bb3f74f6bcbde9703a52e9d483d01991c1c0a07b9b4af1ee9879ce06dd374ebd9ef7d90a9c6b6a942da4b97b497be348c7fdd27c87cf4da4b5aaec1eee4c0b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,51 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 5.1.2
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## 5.1.0
|
|
11
|
-
|
|
12
|
-
Full internal rename to `Spree::PaypalPlatform`.
|
|
13
|
-
|
|
14
|
-
- Require path is `spree/paypal_platform`. There is no `spree/paypal_checkout`
|
|
15
|
-
require and no `Spree::PaypalCheckout` constant.
|
|
16
|
-
- Engine name, table prefix, payment-session STI, admin partials, and
|
|
17
|
-
`method_type` are all `spree_paypal_platform`.
|
|
18
|
-
- Migration renames `spree_paypal_checkout_orders` →
|
|
19
|
-
`spree_paypal_platform_orders` and rewrites remaining STI type strings.
|
|
20
|
-
- Install generator: `bin/rails g spree:paypal_platform:install`.
|
|
5
|
+
- Completing a session GETs the PayPal order first and skips capture when
|
|
6
|
+
it is already `COMPLETED` (Apple Pay `confirmOrder`).
|
|
7
|
+
- `CreateSource` accepts an empty `payment_source.paypal` hash from the
|
|
8
|
+
create-order echo so checkout can finish after PayPal has taken payment.
|
|
21
9
|
|
|
22
|
-
## 5.
|
|
23
|
-
|
|
24
|
-
Published name is **`spree-paypal_platform`**. RubyGems rejected
|
|
25
|
-
`spree-paypal_platform` as too similar to the official
|
|
26
|
-
`spree_paypal_platform`. Require path and constants are unchanged
|
|
27
|
-
(`spree/paypal_platform` → `Spree::PaypalPlatform`).
|
|
28
|
-
|
|
29
|
-
## 5.0.0
|
|
30
|
-
|
|
31
|
-
First Aypex release. Intended published name `spree-paypal_platform` was
|
|
32
|
-
never accepted by RubyGems; see 5.0.1.
|
|
33
|
-
|
|
34
|
-
### Audit follow-up
|
|
10
|
+
## 5.1.1
|
|
35
11
|
|
|
36
|
-
|
|
37
|
-
- Webhook verify now checks HTTP status and is specced for signed and unsigned paths.
|
|
38
|
-
- `#authorize` raises `NotImplementedError`.
|
|
39
|
-
- `#void` / `#credit` / `#cancel` specs restored; `CaptureOrder` no longer uses the `money` gem.
|
|
40
|
-
- Unique index on `spree_paypal_platform_orders.paypal_id`.
|
|
41
|
-
- Payment sources share `#display_payment_info`; OAuth/token HTTP responses must be 2xx.
|
|
12
|
+
First release.
|
|
42
13
|
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
- Store API v3 payment sessions
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
- STI alias + rewrite migration for hosts coming from
|
|
51
|
-
`SpreePaypalCheckout::Gateway`.
|
|
14
|
+
- `Spree::PaypalPlatform::Gateway` for Spree 5.6+
|
|
15
|
+
- PayPal wallet, Apple Pay, and Card Fields on one payment method
|
|
16
|
+
- Store API v3 payment sessions
|
|
17
|
+
- `SET_PROVIDED_ADDRESS` so the storefront owns shipping
|
|
18
|
+
- VAT-safe amount breakdown (`additional_tax_total` only)
|
|
19
|
+
- Official `paypal-server-sdk` `~> 2.3`
|
|
20
|
+
- One migration: create `spree_paypal_platform_orders`
|
|
@@ -89,11 +89,15 @@ module Spree
|
|
|
89
89
|
#
|
|
90
90
|
def complete_payment_session(payment_session:, **_unused)
|
|
91
91
|
paypal_order_id = payment_session.external_id
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
lookup = { 'id' => paypal_order_id, 'prefer' => 'return=representation' }
|
|
93
|
+
|
|
94
|
+
fetched = client.orders.get_order(lookup)
|
|
95
|
+
response =
|
|
96
|
+
if fetched.data.status == 'COMPLETED'
|
|
97
|
+
fetched
|
|
98
|
+
else
|
|
99
|
+
client.orders.capture_order(lookup)
|
|
100
|
+
end
|
|
97
101
|
|
|
98
102
|
payment_session.update!(external_data: response.data.as_json)
|
|
99
103
|
|
|
@@ -27,7 +27,7 @@ module Spree
|
|
|
27
27
|
# @raise [ArgumentError] when the payload has no known wallet key
|
|
28
28
|
#
|
|
29
29
|
def call
|
|
30
|
-
if paypal_payment_source
|
|
30
|
+
if paypal_payment_source.key?(:paypal)
|
|
31
31
|
create_paypal_source
|
|
32
32
|
elsif paypal_payment_source[:apple_pay].present?
|
|
33
33
|
create_apple_pay_source
|
|
@@ -43,10 +43,11 @@ module Spree
|
|
|
43
43
|
attr_reader :gateway, :user, :paypal_payment_source, :order
|
|
44
44
|
|
|
45
45
|
def create_paypal_source
|
|
46
|
-
wallet = paypal_payment_source[:paypal]
|
|
46
|
+
wallet = paypal_payment_source[:paypal] || {}
|
|
47
|
+
profile_id = wallet[:account_id].presence || "paypal-#{order&.number || 'guest'}"
|
|
47
48
|
source = PaymentSources::Paypal.find_or_initialize_by(
|
|
48
49
|
payment_method: gateway,
|
|
49
|
-
gateway_payment_profile_id:
|
|
50
|
+
gateway_payment_profile_id: profile_id
|
|
50
51
|
)
|
|
51
52
|
source.update!(
|
|
52
53
|
user: user,
|