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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 628bafaed312453b5971e9fa948b04974c7befe223923a432dd981562eb1d3db
4
- data.tar.gz: 808222f11a91d8f2f835162d9ce64b3782c95de2acc11c0d06621b70ac44a91d
3
+ metadata.gz: e12905a27064c65e2edb2bac3659d837cdb40cf42ab803d8c3a10f4dae487c86
4
+ data.tar.gz: d16e33faf83d3216493240ece3f58be2d001f6864a1ff32b4ac8b8cb45bfdd4c
5
5
  SHA512:
6
- metadata.gz: 1833821671186a5de1ffa8b1a8df6c0099bb09c20e27c5ac843511c11325a1db3efbb612e4d1b2a802b83bf3236fd4e83590a01299d57caa4f4a19f8bc10e42a
7
- data.tar.gz: f922a3aa04ccd11e9fbb1c77dd649038fad83c8790106d539c12bdb5c8718feb6b2c03d0dedaa4696a78fd6fa9ad322ae67587dd13252a0e956b21ba0481fb55
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 add a **PayPal** payment method in the admin dashboard and set:
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. One that PayPal is still processing can't be voided or canceled;
113
- refund it once PayPal completes it.
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#readme'
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.
@@ -4,6 +4,6 @@ module Spree
4
4
  module PaypalMerchant
5
5
  # Major version tracks Spree's major version: 6.x supports Spree 6.
6
6
  # 5.2.x supports Spree 5.6 and lives on the `5-2-stable` branch.
7
- VERSION = '6.0.3'
7
+ VERSION = '6.0.5'
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree-paypal_merchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.3
4
+ version: 6.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aypex