spree-paypal_merchant 6.0.2 → 6.0.4
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: f40d1d9baf5a7d4b551e4d8bb0ce1c81772fb34a40dce2a7266f78374330e8a1
|
|
4
|
+
data.tar.gz: f4cc3f2a011c1fe9b44288b93f1bc08cbc4b3b80f30a6ed73cf09c771dda755d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 16dc581cbaa958a04c488e5f663e97671dfaf1186f74c3487bb7ec317e7c196231b253201f3d30bc471b418d87f16796b3f0e39eb3a44d7653bf2a2c7df7385c
|
|
7
|
+
data.tar.gz: fcd3b28716cee74a36718974d6faf7a15631c22884f77bfde74ef76a638b5d5056251fb6747b727a030ce4cfaed01ee98664e707a4346cfe82a47daf465e014d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.0.4
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- A setup guide for store staff, `docs/setup.md`: creating the PayPal app,
|
|
8
|
+
working out the webhook address, which events to subscribe, where the
|
|
9
|
+
Webhook ID goes, testing in the sandbox, and troubleshooting. The PayPal
|
|
10
|
+
card's **Setup guide** link under Settings → Integrations now opens it
|
|
11
|
+
instead of the README.
|
|
12
|
+
- `Gateway.description`, one line on what the provider does. The dashboard
|
|
13
|
+
shows it on the PayPal card before PayPal is connected, and in the "add
|
|
14
|
+
payment method" picker. A connected method's card still shows that record's
|
|
15
|
+
own Description, which storefronts may show to buyers.
|
|
16
|
+
|
|
17
|
+
## 6.0.3
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- A payment session's `external_data` carries `client_id`, the payment
|
|
22
|
+
method's PayPal client id. A storefront that loads PayPal's JS SDK with it
|
|
23
|
+
always uses the same PayPal app (sandbox or live) as the order. A client id
|
|
24
|
+
set in storefront config at build time could point at the live app while the
|
|
25
|
+
backend used the sandbox one, and checkout then failed. PayPal client ids are
|
|
26
|
+
public: the SDK sends them in its script URL.
|
|
27
|
+
|
|
3
28
|
## 6.0.2
|
|
4
29
|
|
|
5
30
|
### 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
|
|
@@ -56,7 +60,10 @@ bin/rails g spree:paypal_merchant:install
|
|
|
56
60
|
The generator copies the migrations. Pass `--auto-run-migrations` to skip the
|
|
57
61
|
prompt.
|
|
58
62
|
|
|
59
|
-
Then
|
|
63
|
+
Then connect PayPal in the dashboard under **Settings → Integrations**. The
|
|
64
|
+
**[setup guide](docs/setup.md)** walks store staff through it: the PayPal app,
|
|
65
|
+
the webhook address and events, and testing in the sandbox. The card's
|
|
66
|
+
**Setup guide** link opens it too. The preferences it sets:
|
|
60
67
|
|
|
61
68
|
| Preference | Purpose |
|
|
62
69
|
|---|---|
|
|
@@ -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]
|
|
@@ -135,12 +135,25 @@ module Spree
|
|
|
135
135
|
end
|
|
136
136
|
|
|
137
137
|
##
|
|
138
|
-
# The setup guide the card links to
|
|
138
|
+
# The setup guide the card links to: connecting the PayPal app and its
|
|
139
|
+
# webhook, written for store staff.
|
|
139
140
|
#
|
|
140
141
|
# @return [String]
|
|
141
142
|
#
|
|
142
143
|
def self.docs_url
|
|
143
|
-
'https://github.com/aypex-io/spree-paypal_merchant
|
|
144
|
+
'https://github.com/aypex-io/spree-paypal_merchant/blob/main/docs/setup.md'
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
##
|
|
148
|
+
# One line on what the provider does, shown on its card under
|
|
149
|
+
# Settings -> Integrations before it is connected, and in the "add payment
|
|
150
|
+
# method" picker. A connected method's card shows that record's own
|
|
151
|
+
# description instead, which storefronts may show to buyers.
|
|
152
|
+
#
|
|
153
|
+
# @return [String]
|
|
154
|
+
#
|
|
155
|
+
def self.description
|
|
156
|
+
'Take payments with PayPal, credit and debit cards, and Apple Pay through your PayPal business account.'
|
|
144
157
|
end
|
|
145
158
|
|
|
146
159
|
##
|