spree-paypal_merchant 6.0.4 → 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: f40d1d9baf5a7d4b551e4d8bb0ce1c81772fb34a40dce2a7266f78374330e8a1
4
- data.tar.gz: f4cc3f2a011c1fe9b44288b93f1bc08cbc4b3b80f30a6ed73cf09c771dda755d
3
+ metadata.gz: e12905a27064c65e2edb2bac3659d837cdb40cf42ab803d8c3a10f4dae487c86
4
+ data.tar.gz: d16e33faf83d3216493240ece3f58be2d001f6864a1ff32b4ac8b8cb45bfdd4c
5
5
  SHA512:
6
- metadata.gz: 16dc581cbaa958a04c488e5f663e97671dfaf1186f74c3487bb7ec317e7c196231b253201f3d30bc471b418d87f16796b3f0e39eb3a44d7653bf2a2c7df7385c
7
- data.tar.gz: fcd3b28716cee74a36718974d6faf7a15631c22884f77bfde74ef76a638b5d5056251fb6747b727a030ce4cfaed01ee98664e707a4346cfe82a47daf465e014d
6
+ metadata.gz: '061959ff636d14011aea37b7f6a7b626e1012eb24a12bc0b5d8c01c37aeb4781b043000a5fbfa6c1920f170be52e89dd35935aeb52c6c5f76f2919dd5c8af1cc'
7
+ data.tar.gz: 0e0f00e7db73906f72b030a93d5fa553100f2823ed8a8a39e4b1e08418a75b96e6f7c2330d7c740280c20434daf5897028f2f49e988e53601a2911497bb4ecc9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
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
+
3
25
  ## 6.0.4
4
26
 
5
27
  ### Added
data/README.md CHANGED
@@ -112,8 +112,9 @@ ignored.
112
112
  the payment in the dashboard before canceling the order, or refund it in
113
113
  PayPal.
114
114
  - **Void** always fails. A PayPal payment holds captured money, so refund it
115
- instead. One that PayPal is still processing can't be voided or canceled;
116
- 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.
117
118
 
118
119
  ## Refunds made in PayPal
119
120
 
@@ -358,6 +358,22 @@ module Spree
358
358
  raise
359
359
  end
360
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
+
361
377
  ##
362
378
  # PayPal payments are captured at checkout, so there is never an
363
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.4'
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.4
4
+ version: 6.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aypex