spree_stripe 1.1.0 → 1.2.1
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/app/javascript/spree_stripe/controllers/stripe_controller.js +6 -5
- data/app/serializers/spree_stripe/v2/storefront/payment_method_serializer_decorator.rb +15 -0
- data/app/views/spree/checkout/payment/_spree_stripe.html.erb +1 -0
- data/lib/spree_stripe/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a540c933bff10c811a20b24b6a5505e88909ca2ab850f79d8a9379bfba38cf8d
|
4
|
+
data.tar.gz: 9200f901dc465383b6b514e8296181be8c99d435159bba8a3f87af170c17e897
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94184ca73d24e1d467f595ed674ccc7f03e888ce64021d72d1bb2c22454fe010bb0ac8f57451d2e43e7d1ecca956d73398c9e14d3a77b0638203eb5ef34005b6
|
7
|
+
data.tar.gz: 0357bcb45f3ff71cdb950cae6180a19a08f658b7084c15bb92c777a477d7b0fe1e264b8c259729b7d48dc3109c3c26695e92aa2b137c5636288e2573a5cee9fa
|
@@ -10,7 +10,8 @@ export default class extends Controller {
|
|
10
10
|
orderToken: String,
|
11
11
|
colorPrimary: String,
|
12
12
|
colorBackground: String,
|
13
|
-
colorText: String
|
13
|
+
colorText: String,
|
14
|
+
storeUrl: String
|
14
15
|
}
|
15
16
|
|
16
17
|
static targets = [
|
@@ -52,7 +53,7 @@ export default class extends Controller {
|
|
52
53
|
}
|
53
54
|
|
54
55
|
const response = await fetch(
|
55
|
-
|
56
|
+
`${this.storeUrlValue}/api/v2/storefront/stripe/payment_intents/${this.paymentIntentValue.id}`,
|
56
57
|
{
|
57
58
|
method: 'PATCH',
|
58
59
|
headers: this.spreeApiHeaders,
|
@@ -178,7 +179,7 @@ export default class extends Controller {
|
|
178
179
|
|
179
180
|
async validateOrderForPayment() {
|
180
181
|
const response = await fetch(
|
181
|
-
|
182
|
+
`${this.storeUrlValue}/api/v2/storefront/checkout/validate_order_for_payment`,
|
182
183
|
{
|
183
184
|
method: 'POST',
|
184
185
|
headers: this.spreeApiHeaders
|
@@ -203,7 +204,7 @@ export default class extends Controller {
|
|
203
204
|
async updateBillingAddress() {
|
204
205
|
// billing address same as shipping address
|
205
206
|
if (this.billingAddressCheckbox.checked) {
|
206
|
-
const response = await fetch(
|
207
|
+
const response = await fetch(`${this.storeUrlValue}/api/v2/storefront/checkout?include=billing_address`, {
|
207
208
|
method: 'PATCH',
|
208
209
|
headers: this.spreeApiHeaders,
|
209
210
|
body: JSON.stringify({
|
@@ -227,7 +228,7 @@ export default class extends Controller {
|
|
227
228
|
if (this.billingAddressForm.checkValidity()) {
|
228
229
|
const formData = new FormData(this.billingAddressForm);
|
229
230
|
|
230
|
-
const response = await fetch(
|
231
|
+
const response = await fetch(`${this.storeUrlValue}/api/v2/storefront/checkout?include=billing_address`, {
|
231
232
|
method: 'PATCH',
|
232
233
|
headers: this.spreeApiHeaders,
|
233
234
|
body: JSON.stringify({
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module SpreeStripe
|
2
|
+
module V2
|
3
|
+
module Storefront
|
4
|
+
module PaymentMethodSerializerDecorator
|
5
|
+
def self.prepended(base)
|
6
|
+
base.attribute :publishable_key do |pm|
|
7
|
+
pm.try(:preferred_publishable_key)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
Spree::V2::Storefront::PaymentMethodSerializer.prepend(SpreeStripe::V2::Storefront::PaymentMethodSerializerDecorator)
|
@@ -7,6 +7,7 @@
|
|
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-store-url-value="<%= current_store.formatted_url_or_custom_domain %>"
|
10
11
|
>
|
11
12
|
<% payment_sources = checkout_payment_sources(payment_method) %>
|
12
13
|
|
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.1
|
4
|
+
version: 1.2.1
|
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-04-
|
11
|
+
date: 2025-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree
|
@@ -242,6 +242,7 @@ files:
|
|
242
242
|
- app/serializers/spree/v2/storefront/payment_intent_serializer.rb
|
243
243
|
- app/serializers/spree/v2/storefront/przelewy24_serializer.rb
|
244
244
|
- app/serializers/spree/v2/storefront/sepa_debit_serializer.rb
|
245
|
+
- app/serializers/spree_stripe/v2/storefront/payment_method_serializer_decorator.rb
|
245
246
|
- app/services/spree_stripe/complete_order.rb
|
246
247
|
- app/services/spree_stripe/create_gateway_webhooks.rb
|
247
248
|
- app/services/spree_stripe/create_payment.rb
|