#heavenly father

1 messages · Page 1 of 1 (latest)

sonic egretBOT
glass bone
#

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

narrow sonnet
#

Sure.. But is my approach good enough or you have a better way.

glass bone
#

No that is a good approach

narrow sonnet
#

Thanks

glass bone
#

No problem

narrow sonnet
#

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

glass bone
#

Try putting the one you want selected as default at the bottom of the list

narrow sonnet
glass bone
#

Image isn't showing

#

Just send it directly in here

#

You can attach files

narrow sonnet
glass bone
#

Oh your code looks slightly wrong

narrow sonnet
#

oops..

glass bone
#
  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

narrow sonnet
#

Oh

sonic egretBOT