spree-paypal_merchant 6.0.3 → 6.0.5
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 +36 -0
- data/README.md +7 -3
- data/app/models/spree/paypal_merchant/gateway.rb +31 -2
- 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: e12905a27064c65e2edb2bac3659d837cdb40cf42ab803d8c3a10f4dae487c86
|
|
4
|
+
data.tar.gz: d16e33faf83d3216493240ece3f58be2d001f6864a1ff32b4ac8b8cb45bfdd4c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '061959ff636d14011aea37b7f6a7b626e1012eb24a12bc0b5d8c01c37aeb4781b043000a5fbfa6c1920f170be52e89dd35935aeb52c6c5f76f2919dd5c8af1cc'
|
|
7
|
+
data.tar.gz: 0e0f00e7db73906f72b030a93d5fa553100f2823ed8a8a39e4b1e08418a75b96e6f7c2330d7c740280c20434daf5897028f2f49e988e53601a2911497bb4ecc9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.0.5
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- The dashboard no longer offers **Void** on a completed PayPal payment. The
|
|
8
|
+
payment is captured, so Void could only fail, telling the merchant to refund
|
|
9
|
+
instead. `Gateway#can_void?` now returns false for a completed payment;
|
|
10
|
+
Spree 6.0.2 and later ask it before showing Void. (Earlier Spree 6.0 releases
|
|
11
|
+
go by the payment's status alone, so this changes nothing there.)
|
|
12
|
+
|
|
13
|
+
A void requested through the API is now refused by Spree before it reaches
|
|
14
|
+
the gateway, with Spree's `payment_not_voidable` error. Payments PayPal may
|
|
15
|
+
still complete (checkout, pending, processing) are unchanged: Spree still
|
|
16
|
+
asks the gateway, which refuses them, so canceling their order still stops
|
|
17
|
+
and says PayPal is still processing the payment.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- The test bundle requires `ostruct`. Spree's `stringex` requires it without
|
|
22
|
+
depending on it, Ruby 4.0 no longer ships it as a default gem, and `oj`
|
|
23
|
+
stopped pulling it in with 3.17.8, so the dummy app failed to boot.
|
|
24
|
+
|
|
25
|
+
## 6.0.4
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- A setup guide for store staff, `docs/setup.md`: creating the PayPal app,
|
|
30
|
+
working out the webhook address, which events to subscribe, where the
|
|
31
|
+
Webhook ID goes, testing in the sandbox, and troubleshooting. The PayPal
|
|
32
|
+
card's **Setup guide** link under Settings → Integrations now opens it
|
|
33
|
+
instead of the README.
|
|
34
|
+
- `Gateway.description`, one line on what the provider does. The dashboard
|
|
35
|
+
shows it on the PayPal card before PayPal is connected, and in the "add
|
|
36
|
+
payment method" picker. A connected method's card still shows that record's
|
|
37
|
+
own Description, which storefronts may show to buyers.
|
|
38
|
+
|
|
3
39
|
## 6.0.3
|
|
4
40
|
|
|
5
41
|
### Added
|
data/README.md
CHANGED
|
@@ -60,7 +60,10 @@ bin/rails g spree:paypal_merchant:install
|
|
|
60
60
|
The generator copies the migrations. Pass `--auto-run-migrations` to skip the
|
|
61
61
|
prompt.
|
|
62
62
|
|
|
63
|
-
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:
|
|
64
67
|
|
|
65
68
|
| Preference | Purpose |
|
|
66
69
|
|---|---|
|
|
@@ -109,8 +112,9 @@ ignored.
|
|
|
109
112
|
the payment in the dashboard before canceling the order, or refund it in
|
|
110
113
|
PayPal.
|
|
111
114
|
- **Void** always fails. A PayPal payment holds captured money, so refund it
|
|
112
|
-
instead.
|
|
113
|
-
|
|
115
|
+
instead. On Spree 6.0.2 and later the dashboard doesn't offer Void on a
|
|
116
|
+
completed PayPal payment at all. One that PayPal is still processing can't be
|
|
117
|
+
voided or canceled; refund it once PayPal completes it.
|
|
114
118
|
|
|
115
119
|
## Refunds made in PayPal
|
|
116
120
|
|
|
@@ -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
|
##
|
|
@@ -345,6 +358,22 @@ module Spree
|
|
|
345
358
|
raise
|
|
346
359
|
end
|
|
347
360
|
|
|
361
|
+
##
|
|
362
|
+
# Whether Spree may void the payment. Spree 6.0.2 and later ask before
|
|
363
|
+
# the dashboard offers Void.
|
|
364
|
+
#
|
|
365
|
+
# A completed PayPal payment is captured, so only a refund gives the
|
|
366
|
+
# money back. Any other payment is left to {#void}, which refuses it
|
|
367
|
+
# while PayPal may still complete it, so cancelling its order stops with
|
|
368
|
+
# that reason instead of skipping it.
|
|
369
|
+
#
|
|
370
|
+
# @param payment [Spree::Payment]
|
|
371
|
+
# @return [Boolean]
|
|
372
|
+
#
|
|
373
|
+
def can_void?(payment)
|
|
374
|
+
!payment.completed?
|
|
375
|
+
end
|
|
376
|
+
|
|
348
377
|
##
|
|
349
378
|
# PayPal payments are captured at checkout, so there is never an
|
|
350
379
|
# authorization to void: a payment that holds money is refunded instead.
|