spree_stripe 1.2.2 → 1.2.3
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/README.md +1 -1
- data/app/javascript/spree_stripe/controllers/stripe_button_controller.js +15 -11
- data/app/javascript/spree_stripe/controllers/stripe_controller.js +7 -5
- data/app/views/spree/checkout/payment/_spree_stripe.html.erb +3 -1
- data/app/views/spree_stripe/_quick_checkout.html.erb +5 -1
- data/lib/spree_stripe/version.rb +1 -1
- metadata +3 -4
- data/lib/spree_stripe/testing_support/factories/payment_source_factory.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d1395fdcc4bb553b8cf0391c06098131b0c5529c397e60c0c1f17cc476f80bb
|
4
|
+
data.tar.gz: 7d97dde52f20fbc99547b66484ee54800a682835d5a10c7a222c5828cbf73a0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa7713aa1cd16ff77a28bdc7dc53e127d95370c58e6fbd14efef8dc6d44c2520c5e4dce52457151c8ffa97b3e8337a52761e78b78423a9183dd7b8b51feeb813
|
7
|
+
data.tar.gz: 993d3bf730afeeb71e8f50606df34ff6363eb43ebe6428b097f467e611e1a81b4a94b67a620ed536bfc57fcecf9e2ba89bab720dea84329c5993c80bbaf83f54
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ This is the official Stripe payment gateway extension for [Spree Commerce](https
|
|
9
9
|
|
10
10
|
This Stripe integration is bundled in the [Spree Starter](https://github.com/spree/spree_starter/) for your development convenience.
|
11
11
|
|
12
|
-
Or you could follow the [installation instructions](https://
|
12
|
+
Or you could follow the [installation instructions](https://spreecommerce.org/docs/integrations/payments/stripe).
|
13
13
|
|
14
14
|
If you like what you see, consider giving this repo a GitHub star :star:
|
15
15
|
|
@@ -18,7 +18,11 @@ export default class extends Controller {
|
|
18
18
|
maxRows: Number,
|
19
19
|
maxColumns: Number,
|
20
20
|
buttonWidth: Number,
|
21
|
-
|
21
|
+
checkoutPath: String,
|
22
|
+
checkoutAdvancePath: String,
|
23
|
+
checkoutSelectShippingMethodPath: String,
|
24
|
+
checkoutValidateGiftCardDataPath: String,
|
25
|
+
checkoutValidateOrderForPaymentPath: String,
|
22
26
|
returnUrl: String,
|
23
27
|
}
|
24
28
|
|
@@ -139,7 +143,7 @@ export default class extends Controller {
|
|
139
143
|
}
|
140
144
|
|
141
145
|
// 1st we need to persist the address to the order
|
142
|
-
const saveAddressResponse = await fetch(
|
146
|
+
const saveAddressResponse = await fetch(this.checkoutPathValue, {
|
143
147
|
method: 'PATCH',
|
144
148
|
headers: {
|
145
149
|
'X-Spree-Order-Token': this.orderTokenValue,
|
@@ -153,7 +157,7 @@ export default class extends Controller {
|
|
153
157
|
// In case of any error here we have to allow user try again
|
154
158
|
try {
|
155
159
|
const response = await fetch(
|
156
|
-
`${this.
|
160
|
+
`${this.checkoutAdvancePathValue}?state=delivery&include=shipments.shipping_rates,line_items.vendor`,
|
157
161
|
{
|
158
162
|
method: 'PATCH',
|
159
163
|
headers: {
|
@@ -197,7 +201,7 @@ export default class extends Controller {
|
|
197
201
|
|
198
202
|
this.currentShippingOptionId = shippingRateId
|
199
203
|
|
200
|
-
const response = await fetch(
|
204
|
+
const response = await fetch(this.checkoutSelectShippingMethodPathValue, {
|
201
205
|
method: 'PATCH',
|
202
206
|
headers: {
|
203
207
|
'X-Spree-Order-Token': this.orderTokenValue,
|
@@ -230,9 +234,9 @@ export default class extends Controller {
|
|
230
234
|
return
|
231
235
|
}
|
232
236
|
|
233
|
-
if (this.giftCardCodeValue && this.giftCardAmountValue) {
|
237
|
+
if (this.giftCardCodeValue && this.giftCardAmountValue && this.checkoutValidateGiftCardDataPathValue) {
|
234
238
|
const giftCardValidationResponse = await fetch(
|
235
|
-
|
239
|
+
this.checkoutValidateGiftCardDataPathValue,
|
236
240
|
{
|
237
241
|
method: 'POST',
|
238
242
|
headers: {
|
@@ -252,7 +256,7 @@ export default class extends Controller {
|
|
252
256
|
}
|
253
257
|
|
254
258
|
const validationResponse = await fetch(
|
255
|
-
`${this.
|
259
|
+
`${this.checkoutValidateOrderForPaymentPathValue}?skip_state=true`,
|
256
260
|
{
|
257
261
|
method: 'POST',
|
258
262
|
headers: {
|
@@ -297,7 +301,7 @@ export default class extends Controller {
|
|
297
301
|
do_not_change_state: true
|
298
302
|
}
|
299
303
|
|
300
|
-
const updateResponse = await fetch(
|
304
|
+
const updateResponse = await fetch(this.checkoutPathValue, {
|
301
305
|
method: 'PATCH',
|
302
306
|
headers: {
|
303
307
|
'X-Spree-Order-Token': this.orderTokenValue,
|
@@ -307,7 +311,7 @@ export default class extends Controller {
|
|
307
311
|
})
|
308
312
|
|
309
313
|
if (updateResponse.status === 200) {
|
310
|
-
const advanceResponse = await fetch(`${this.
|
314
|
+
const advanceResponse = await fetch(`${this.checkoutAdvancePathValue}?state=payment`, {
|
311
315
|
method: 'PATCH',
|
312
316
|
headers: {
|
313
317
|
'X-Spree-Order-Token': this.orderTokenValue,
|
@@ -369,7 +373,7 @@ export default class extends Controller {
|
|
369
373
|
|
370
374
|
if (this.shippingRates?.length > 1 && this.currentShippingOptionId !== defaultShippingMethodId) {
|
371
375
|
// reset shipping choice
|
372
|
-
await fetch(
|
376
|
+
await fetch(this.checkoutSelectShippingMethodPathValue, {
|
373
377
|
method: 'PATCH',
|
374
378
|
headers: {
|
375
379
|
'X-Spree-Order-Token': this.orderTokenValue,
|
@@ -380,7 +384,7 @@ export default class extends Controller {
|
|
380
384
|
}
|
381
385
|
|
382
386
|
// reset addresses
|
383
|
-
await fetch(
|
387
|
+
await fetch(this.checkoutPathValue, {
|
384
388
|
method: 'PATCH',
|
385
389
|
headers: {
|
386
390
|
'X-Spree-Order-Token': this.orderTokenValue,
|
@@ -11,7 +11,9 @@ export default class extends Controller {
|
|
11
11
|
colorPrimary: String,
|
12
12
|
colorBackground: String,
|
13
13
|
colorText: String,
|
14
|
-
|
14
|
+
paymentIntentPath: String,
|
15
|
+
checkoutPath: String,
|
16
|
+
checkoutValidateOrderForPaymentPath: String
|
15
17
|
}
|
16
18
|
|
17
19
|
static targets = [
|
@@ -53,7 +55,7 @@ export default class extends Controller {
|
|
53
55
|
}
|
54
56
|
|
55
57
|
const response = await fetch(
|
56
|
-
|
58
|
+
this.paymentIntentPathValue,
|
57
59
|
{
|
58
60
|
method: 'PATCH',
|
59
61
|
headers: this.spreeApiHeaders,
|
@@ -179,7 +181,7 @@ export default class extends Controller {
|
|
179
181
|
|
180
182
|
async validateOrderForPayment() {
|
181
183
|
const response = await fetch(
|
182
|
-
|
184
|
+
this.checkoutValidateOrderForPaymentPathValue,
|
183
185
|
{
|
184
186
|
method: 'POST',
|
185
187
|
headers: this.spreeApiHeaders
|
@@ -204,7 +206,7 @@ export default class extends Controller {
|
|
204
206
|
async updateBillingAddress() {
|
205
207
|
// billing address same as shipping address
|
206
208
|
if (this.billingAddressCheckbox.checked) {
|
207
|
-
const response = await fetch(`${this.
|
209
|
+
const response = await fetch(`${this.checkoutPathValue}?include=billing_address`, {
|
208
210
|
method: 'PATCH',
|
209
211
|
headers: this.spreeApiHeaders,
|
210
212
|
body: JSON.stringify({
|
@@ -228,7 +230,7 @@ export default class extends Controller {
|
|
228
230
|
if (this.billingAddressForm.checkValidity()) {
|
229
231
|
const formData = new FormData(this.billingAddressForm);
|
230
232
|
|
231
|
-
const response = await fetch(`${this.
|
233
|
+
const response = await fetch(`${this.checkoutPathValue}?include=billing_address`, {
|
232
234
|
method: 'PATCH',
|
233
235
|
headers: this.spreeApiHeaders,
|
234
236
|
body: JSON.stringify({
|
@@ -7,7 +7,9 @@
|
|
7
7
|
data-checkout-stripe-order-email-value="<%= @order.email %>"
|
8
8
|
data-checkout-stripe-color-primary-value="<%= hex_color_to_rgb(theme_setting(:primary_color)) %>"
|
9
9
|
data-checkout-stripe-color-text-value="<%= hex_color_to_rgb(theme_setting(:text_color)) %>"
|
10
|
-
data-checkout-stripe-
|
10
|
+
data-checkout-stripe-payment-intent-path-value="<%= spree.api_v2_storefront_stripe_payment_intent_path(current_stripe_payment_intent.id) %>"
|
11
|
+
data-checkout-stripe-checkout-path-value="<%= spree.api_v2_storefront_checkout_path %>"
|
12
|
+
data-checkout-stripe-checkout-validate-order-for-payment-path-value="<%= spree.validate_order_for_payment_api_v2_storefront_checkout_path %>"
|
11
13
|
>
|
12
14
|
<% payment_sources = checkout_payment_sources(payment_method) %>
|
13
15
|
|
@@ -17,7 +17,11 @@
|
|
17
17
|
checkout_stripe_button_max_rows_value: defined?(max_rows) ? max_rows : nil,
|
18
18
|
checkout_stripe_button_max_columns_value: defined?(max_columns) ? max_columns : nil,
|
19
19
|
checkout_stripe_button_button_width_value: defined?(button_width) ? button_width : nil,
|
20
|
-
|
20
|
+
checkout_stripe_button_checkout_path_value: spree.api_v2_storefront_checkout_path,
|
21
|
+
checkout_stripe_button_checkout_advance_path_value: spree.advance_api_v2_storefront_checkout_path,
|
22
|
+
checkout_stripe_button_checkout_select_shipping_method_path_value: spree.select_shipping_method_api_v2_storefront_checkout_path,
|
23
|
+
checkout_stripe_button_checkout_validate_gift_card_data_path_value: respond_to?(:validate_gift_card_data_api_v2_storefront_checkout_path) ? spree.validate_gift_card_data_api_v2_storefront_checkout_path : nil,
|
24
|
+
checkout_stripe_button_checkout_validate_order_for_payment_path_value: spree.validate_order_for_payment_api_v2_storefront_checkout_path,
|
21
25
|
checkout_stripe_button_return_url_value: spree.stripe_payment_intent_url(current_stripe_payment_intent)
|
22
26
|
} do %>
|
23
27
|
<div id="payment-request-button"></div>
|
data/lib/spree_stripe/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_stripe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vendo Connect Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree
|
@@ -279,7 +279,6 @@ files:
|
|
279
279
|
- lib/spree_stripe/testing_support/factories/klarna_payment_source_factory.rb
|
280
280
|
- lib/spree_stripe/testing_support/factories/link_payment_source_factory.rb
|
281
281
|
- lib/spree_stripe/testing_support/factories/payment_intent_factory.rb
|
282
|
-
- lib/spree_stripe/testing_support/factories/payment_source_factory.rb
|
283
282
|
- lib/spree_stripe/testing_support/factories/przelewy24_payment_source_factory.rb
|
284
283
|
- lib/spree_stripe/testing_support/factories/sepa_debit_payment_source_factory.rb
|
285
284
|
- lib/spree_stripe/testing_support/factories/webhook_key_factory.rb
|
@@ -305,7 +304,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
305
304
|
version: '0'
|
306
305
|
requirements:
|
307
306
|
- none
|
308
|
-
rubygems_version: 3.3
|
307
|
+
rubygems_version: 3.5.3
|
309
308
|
signing_key:
|
310
309
|
specification_version: 4
|
311
310
|
summary: Official Spree Commerce Stripe payment gateway extension
|