spree-paypal_merchant 6.0.2 → 6.0.3
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 +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +4 -0
- data/app/models/spree/paypal_merchant/gateway/payment_sessions.rb +9 -4
- data/lib/spree/paypal_merchant/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 628bafaed312453b5971e9fa948b04974c7befe223923a432dd981562eb1d3db
|
|
4
|
+
data.tar.gz: 808222f11a91d8f2f835162d9ce64b3782c95de2acc11c0d06621b70ac44a91d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1833821671186a5de1ffa8b1a8df6c0099bb09c20e27c5ac843511c11325a1db3efbb612e4d1b2a802b83bf3236fd4e83590a01299d57caa4f4a19f8bc10e42a
|
|
7
|
+
data.tar.gz: f922a3aa04ccd11e9fbb1c77dd649038fad83c8790106d539c12bdb5c8718feb6b2c03d0dedaa4696a78fd6fa9ad322ae67587dd13252a0e956b21ba0481fb55
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.0.3
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- A payment session's `external_data` carries `client_id`, the payment
|
|
8
|
+
method's PayPal client id. A storefront that loads PayPal's JS SDK with it
|
|
9
|
+
always uses the same PayPal app (sandbox or live) as the order. A client id
|
|
10
|
+
set in storefront config at build time could point at the live app while the
|
|
11
|
+
backend used the sandbox one, and checkout then failed. PayPal client ids are
|
|
12
|
+
public: the SDK sends them in its script URL.
|
|
13
|
+
|
|
3
14
|
## 6.0.2
|
|
4
15
|
|
|
5
16
|
### Fixed
|
data/README.md
CHANGED
|
@@ -23,6 +23,10 @@ releases, on the `5-2-stable` branch.
|
|
|
23
23
|
(`POST /api/v3/store/carts/:id/payment_sessions` → complete).
|
|
24
24
|
- The storefront owns the address. The gem pins it with
|
|
25
25
|
`SET_PROVIDED_ADDRESS` so PayPal does not re-collect it.
|
|
26
|
+
- The payment session's `external_data.client_id` is the client id to load
|
|
27
|
+
PayPal's JS SDK with. It comes from the payment method, so the SDK always
|
|
28
|
+
belongs to the same PayPal app (sandbox or live) as the order, and one
|
|
29
|
+
storefront build can serve a sandbox and a live backend.
|
|
26
30
|
- PayPal **captures at checkout**, whatever capture method the store defaults
|
|
27
31
|
to. Authorize now, capture later is not supported: a payment method whose own
|
|
28
32
|
capture method is `on_dispatch` or `manual` is refused. Spree never captures a
|
|
@@ -105,6 +105,11 @@ module Spree
|
|
|
105
105
|
|
|
106
106
|
session_data = paypal_response.data.as_json
|
|
107
107
|
|
|
108
|
+
# The client id the storefront loads PayPal's JS SDK with. It must
|
|
109
|
+
# be the same app as the client secret that created the order, so
|
|
110
|
+
# it comes from this payment method rather than storefront config.
|
|
111
|
+
# PayPal client ids are public: the SDK puts them in its URL.
|
|
112
|
+
session_data['client_id'] = preferred_client_id
|
|
108
113
|
session_data['enable_apple_pay'] = apple_pay_enabled?
|
|
109
114
|
session_data['enable_card_fields'] = card_fields_enabled?
|
|
110
115
|
|
|
@@ -135,10 +140,10 @@ module Spree
|
|
|
135
140
|
# the new amount. The same amount is accepted.
|
|
136
141
|
#
|
|
137
142
|
# +external_data+ is ignored. The gem writes every key the storefront
|
|
138
|
-
# reads (+id+, +status+, +
|
|
139
|
-
# +enable_card_fields+), and settlement reads
|
|
140
|
-
# (+purchase_units+, +payment_source+), so no key
|
|
141
|
-
# write.
|
|
143
|
+
# reads (+id+, +status+, +client_id+, +client_token+,
|
|
144
|
+
# +enable_apple_pay+, +enable_card_fields+), and settlement reads
|
|
145
|
+
# PayPal's own order (+purchase_units+, +payment_source+), so no key
|
|
146
|
+
# is the client's to write.
|
|
142
147
|
#
|
|
143
148
|
# @param payment_session [Spree::PaymentSessions::PaypalMerchant]
|
|
144
149
|
# @param amount [Numeric, String, NilClass]
|