pay 3.0.22 → 3.0.23
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.
Potentially problematic release.
This version of pay might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/pay/stripe/billable.rb +9 -2
- data/lib/pay/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5755d6421fc4b0366728f278b32de2f9f1bf6186cafe4c62cf9c5a188204d0d6
|
4
|
+
data.tar.gz: 5a4cf13ffbdf85017401dd9aca4ddc3d7fd48fea249868ff10c04bfa383e39d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 966be7e8c643bb6bfa65f21d111d76e35d461a500630434f6b37907c9001f823ae3aa7193f763a7b0af76ef35806de91bd8acfaff1eef219972c8284a96835d3
|
7
|
+
data.tar.gz: b0dd861df1aa7cb64ab45b267de205251e4a8885a113219a0eb5c3d4fe087332fae129ca7fa1b619d7b75aef6a53698f1665d977c52a472a3d31bce90ff255d5
|
data/lib/pay/stripe/billable.rb
CHANGED
@@ -187,8 +187,8 @@ module Pay
|
|
187
187
|
payment_method_types: ["card"],
|
188
188
|
mode: "payment",
|
189
189
|
# These placeholder URLs will be replaced in a following step.
|
190
|
-
success_url: options.delete(:success_url) || root_url
|
191
|
-
cancel_url: options.delete(:cancel_url) || root_url
|
190
|
+
success_url: merge_session_id_param(options.delete(:success_url) || root_url),
|
191
|
+
cancel_url: merge_session_id_param(options.delete(:cancel_url) || root_url)
|
192
192
|
}
|
193
193
|
|
194
194
|
# Line items are optional
|
@@ -240,6 +240,13 @@ module Pay
|
|
240
240
|
def stripe_options
|
241
241
|
{stripe_account: stripe_account}.compact
|
242
242
|
end
|
243
|
+
|
244
|
+
# Includes the `session_id` param for Stripe Checkout with existing params (and makes sure the curly braces aren't escaped)
|
245
|
+
def merge_session_id_param(url)
|
246
|
+
uri = URI.parse(url)
|
247
|
+
uri.query = URI.encode_www_form(URI.decode_www_form(uri.query.to_s).to_h.merge("session_id" => "{CHECKOUT_SESSION_ID}").to_a)
|
248
|
+
uri.to_s.gsub("%7BCHECKOUT_SESSION_ID%7D", "{CHECKOUT_SESSION_ID}")
|
249
|
+
end
|
243
250
|
end
|
244
251
|
end
|
245
252
|
end
|
data/lib/pay/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Charnes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-10-
|
12
|
+
date: 2021-10-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|