#heavenly father
1 messages · Page 1 of 1 (latest)
We cannot unfortunately
You'd need to do your own research
We just help with the Stripe API directly in here, so we don't provide recommendations
Sure.. But is my approach good enough or you have a better way.
No that is a good approach
Thanks
No problem
Please one more thing.. I have written code for shipping and as the documentation has it I could select but It picks international by default https://dpaste.org/8rJSz what could be the issue
Try putting the one you want selected as default at the bottom of the list
Ok if that is the way to go why am I not getting options to select https://www.linkpicture.com/view.php?img=LPic6483454339bc11609214585
Oh your code looks slightly wrong
oops..
shipping_address_collection={"allowed_countries": ["US", "CA"]},
shipping_options=[
{
"shipping_rate_data": {
"type": "fixed_amount",
"fixed_amount": {"amount": 0, "currency": "usd"},
"display_name": "Free shipping",
"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",
"delivery_estimate": {
"minimum": {"unit": "business_day", "value": 1},
"maximum": {"unit": "business_day", "value": 1},
},
},
},
],
line_items=[
{
"price_data": {
"currency": "usd",
"product_data": {"name": "T-shirt"},
"unit_amount": 2000,
},
"quantity": 1,
},
],
mode="payment",
success_url="https://example.com/success",
cancel_url="https://example.com/cancel",
)```
This is the example
You need each object with shipping_rate_data wrapped in curly braces:
"shipping_rate_data": {
"type": "fixed_amount",
"fixed_amount": {"amount": 0, "currency": "usd"},
"display_name": "Free shipping",
"delivery_estimate": {
"minimum": {"unit": "business_day", "value": 5},
"maximum": {"unit": "business_day", "value": 7},
},
},
},```
You wrapped the entire list of shipping rates in one set of curly braces
Basically just do a diff between your code and the above example and you'll see what I'm talking about
Oh