solidus_paypal_commerce_platform 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 64ecb1bbe9f5e77a70613976318354d6b0e3011c529e95d410229e31c55c3fb1
4
- data.tar.gz: 7d6aae5716b1c2a9aa88a2c843755c0312b7025f5dde7cdd539c5ea7cb059974
3
+ metadata.gz: b52bbb8e31d082c1202fc2ffa6a587492ecedfd6f975dba8523619cab84831d1
4
+ data.tar.gz: c4b0684da1b34c7612688d3fe64af5f9abfe2045a5d68b453dc6b64ee5d7f2d1
5
5
  SHA512:
6
- metadata.gz: 532b61e156f5a3cd0ff0eca30e65fcdf7f9e70fdfb0c69f299b2528cf3ed96bd9c08540007bafc19f26e17a1e317067270506f1da986f5e52e38dd757ef62605
7
- data.tar.gz: 9e79910413c373e01efd301789b1b3dce257976102c7de3ce61383a1aa3e8f32ac13f1ff54e514263ce0dfdad971e49ef2eddb8d7c59deb360e8b98f3a4c06d6
6
+ metadata.gz: 1a7f24f611ed07c49285287aede4c9de8436b3374249c6611b024f5bbeab98e332d7c3123aab53998c74190333d088884901a88c67100e7849493ab21b4c0a0c
7
+ data.tar.gz: 16fea0636664456280fc3e92de96110750dc81e6d7121a027c93b00a8b15c0b9ed940b51d98e4aa4dab6f429866adb3128005cab28d039e8f9d2e439089f2dee
data/.gem_release.yml CHANGED
@@ -2,4 +2,4 @@ bump:
2
2
  recurse: false
3
3
  file: 'lib/solidus_paypal_commerce_platform/version.rb'
4
4
  message: Bump SolidusPaypalCommercePlatform to %{version}
5
- tag: true
5
+ tag: false
data/CHANGELOG.md CHANGED
@@ -1,21 +1,13 @@
1
1
  # Changelog
2
2
 
3
- ## [v0.6.0](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.6.0) (2022-11-25)
3
+ ## [v0.7.0](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.7.0) (2023-01-18)
4
4
 
5
- [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.6.0...v0.6.0)
5
+ [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.6.0...v0.7.0)
6
6
 
7
7
  **Merged pull requests:**
8
8
 
9
- - More fixes and improvements extracted from SSF support [\#168](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/168) ([elia](https://github.com/elia))
10
- * inline the load_order before action
11
- * require the payment_method_id param when loading the payment method
12
- * mark the javascript_sdk_url as HTML safe
13
- * ensure amounts are presented with 2 decimals for the PayPal API
14
- * fixed the sign in requests
15
- - Reorganize the install generator and deprecate `--skip-migrations` [\#167](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/167) ([elia](https://github.com/elia))
16
- - Move 'shipping\_preference' preference under PaypalOrder\#to\_json [\#152](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/152) ([retsef](https://github.com/retsef))
17
- - Truncate the product name to 127 characters [\#139](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/139) ([DanielePalombo](https://github.com/DanielePalombo))
18
- - Fix issue on international transactions [\#129](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/129) ([jtapia](https://github.com/jtapia))
9
+ - Allow to use the auto\_capture global preference [\#185](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/185) ([kennyadsl](https://github.com/kennyadsl))
10
+ - Allow cancelling orders [\#180](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/180) ([kennyadsl](https://github.com/kennyadsl))
19
11
 
20
12
  ## [v0.6.0](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.6.0) (2022-11-25)
21
13
 
@@ -30,6 +22,19 @@
30
22
  - Invalid string length error [\#135](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/135)
31
23
  - PayPal SDK JS Error: Disallowed query param: shipping\_preference [\#133](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/133)
32
24
 
25
+ **Merged pull requests:**
26
+
27
+ - More fixes and improvements extracted from SSF support [\#168](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/168) ([elia](https://github.com/elia))
28
+ * inline the load_order before action
29
+ * require the payment_method_id param when loading the payment method
30
+ * mark the javascript_sdk_url as HTML safe
31
+ * ensure amounts are presented with 2 decimals for the PayPal API
32
+ * fixed the sign in requests
33
+ - Reorganize the install generator and deprecate `--skip-migrations` [\#167](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/167) ([elia](https://github.com/elia))
34
+ - Move 'shipping\_preference' preference under PaypalOrder\#to\_json [\#152](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/152) ([retsef](https://github.com/retsef))
35
+ - Truncate the product name to 127 characters [\#139](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/139) ([DanielePalombo](https://github.com/DanielePalombo))
36
+ - Fix issue on international transactions [\#129](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/129) ([jtapia](https://github.com/jtapia))
37
+
33
38
  ## [v0.5.0](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.5.0) (2022-10-07)
34
39
 
35
40
  [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.4.0...v0.5.0)
data/README.md CHANGED
@@ -206,7 +206,8 @@ Your new extension version can be released using `gem-release` like this:
206
206
  bundle exec gem bump -v 1.6.0
207
207
  bin/rake changelog
208
208
  git commit -a --amend
209
- git push
209
+ git tag v1.6.0
210
+ git push --tags
210
211
  bundle exec gem release
211
212
  ```
212
213
 
@@ -7,7 +7,7 @@ module SolidusPaypalCommercePlatform
7
7
 
8
8
  def show
9
9
  authorize! :show, @order, order_token
10
- order_request = @payment_method.gateway.create_order(@order, @payment_method.auto_capture)
10
+ order_request = @payment_method.gateway.create_order(@order, @payment_method.auto_capture?)
11
11
 
12
12
  render json: order_request, status: order_request.status_code
13
13
  end
@@ -83,7 +83,7 @@ module SolidusPaypalCommercePlatform
83
83
 
84
84
  parameters = {
85
85
  'client-id': client_id,
86
- intent: auto_capture ? "capture" : "authorize",
86
+ intent: auto_capture? ? "capture" : "authorize",
87
87
  commit: commit_immediately ? "false" : "true",
88
88
  components: options[:display_credit_messaging] ? "buttons,messages" : "buttons",
89
89
  currency: currency,
@@ -97,5 +97,22 @@ module SolidusPaypalCommercePlatform
97
97
 
98
98
  "https://www.paypal.com/sdk/js?#{parameters.compact.to_query}".html_safe # rubocop:disable Rails/OutputSafety
99
99
  end
100
+
101
+ # Will void the payment depending on its state or return false
102
+ #
103
+ # If the payment has not yet been captured, we can void the transaction.
104
+ # Otherwise, we return false so Solidus creates a refund instead.
105
+ #
106
+ # https://developer.paypal.com/docs/api/payments/v2/#authorizations_void
107
+ #
108
+ # @api public
109
+ # @param payment [Spree::Payment] the payment to void
110
+ # @return [Response|FalseClass]
111
+ def try_void(payment)
112
+ void_attempt = void(nil, { originator: payment })
113
+ return void_attempt if void_attempt.success?
114
+
115
+ false
116
+ end
100
117
  end
101
118
  end
@@ -40,6 +40,7 @@ en:
40
40
  success: "Payment refunded for %{amount}"
41
41
  pay_pal_checkout_sdk/payments/authorizations_void_request:
42
42
  success: "Payment voided"
43
+ failure: "This payment can't be voided"
43
44
  payment_method:
44
45
  gold_button_message: "cannot be 'gold' when Venmo standalone is enabled."
45
46
  paypal_funding_sources:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusPaypalCommercePlatform
4
- VERSION = '0.6.0'
4
+ VERSION = '0.7.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_paypal_commerce_platform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Denny
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-11-25 00:00:00.000000000 Z
12
+ date: 2023-01-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: deface
@@ -258,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
258
  - !ruby/object:Gem::Version
259
259
  version: '0'
260
260
  requirements: []
261
- rubygems_version: 3.3.23
261
+ rubygems_version: 3.3.7
262
262
  signing_key:
263
263
  specification_version: 4
264
264
  summary: Integrate Solidus with Paypal Commerce Platform