PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, November 11, 2022

[FIXED] When using `automatic_tax`, each shipping option needs to have a defined `tax_behavior` set. error while automatic tax in stripe

 November 11, 2022     express, javascript, payment-gateway, stripe-payments     No comments   

Issue

While calculating tax according to the shipping region I am getting this error

Error while hitting the checkout API

I have used the following code the checkout

Code for the checkout


Solution

If you're using Shipping Options with Checkout and automatic tax, then you need to set shipping_options.shipping_rate_data.tax_behavior when you create the Session. You can see it in the API reference here: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-shipping_options-shipping_rate_data-tax_behavior



Answered By - karbi
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing