-
-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is shipping_options not supported? #247
Comments
Hi @szabcsee, I think we just didn't originally have the option for For the future, do you have a preferred way of passing these values to |
Also, this might be the same issue as #246 |
Hey I just ran into the need to support this - and am going to have a go at adding it to the library. We will see where I can get to. It might end up being a working draft that can be used by the library maintainers to create a permanent solution. |
Just a comment to update that I tried to add this support in - but was having a lot of trouble just getting CRA from the repo to work properly. Some of that was env variables at first - but I also couldn't get the I think in theory support for shipping options should be pretty easy - handled similarly to
Here is an example of what that looks like. My suggestion is that we can start out offering beta support with just an array type and leave it up to developers to properly pass the required object shape... shipping_options: [
{
shipping_rate_data: {
type: 'fixed_amount',
fixed_amount: {
amount: 0,
currency: 'usd',
},
display_name: 'Free shipping',
# Delivers between 5-7 business days
delivery_estimate: {
minimum: {
unit: 'business_day',
value: 5,
},
maximum: {
unit: 'business_day',
value: 7,
},
}
}
},
{
shipping_rate_data: {
type: 'fixed_amount',
fixed_amount: {
amount: 1500,
currency: 'usd',
},
display_name: 'Next day air',
# Delivers in exactly 1 business day
delivery_estimate: {
minimum: {
unit: 'business_day',
value: 1,
},
maximum: {
unit: 'business_day',
value: 1,
},
}
}
},
] |
Okay - so I tried hard coding in the shipping options parameter just to test if I could get it all working and talking to Stripe without USC. I ran into an "Integration Error", which I thought at first was USC but was actually coming from Stripe. Turns out there is some inconsistency in their API surface area. https://stripe.com/docs/payments/checkout/shipping and https://stripe.com/docs/js/checkout/redirect_to_checkout Are not perfectly aligned. It does not look like redirectToCheckout supports shippingOptions yet from what I can tell. But I would assume that is coming in the future maybe? It would be nice if someone from Stripe could confirm this or give some insight as that first link really makes it seem as if Stripe should support the shipping_options parameter. |
Closing - I think Eric got it! |
Is there a reason why shipping_options is not added to the redirectToCheckout? Or it is and I am missing something?
The text was updated successfully, but these errors were encountered: