#Sam77

1 messages · Page 1 of 1 (latest)

crimson quiverBOT
dim oyster
#

Hi

#

How are you collecting a payment method here?

#

Like what integration are you using?

#

Elements?

hoary beacon
#

// Works fine
$session = \Stripe\Checkout\Session::create([
"mode" => 'payment',
"client_reference_id" => '73191',
"customer_email" => 'foomanchoo2@whatever.com',
// etc...

// Error
$session = \Stripe\Checkout\Session::create([
"mode" => 'payment',
"client_reference_id" => '73191',
"customer_email" => 'foomanchoo2@whatever.com',
"customer_address" => [
"city" => 'Woodmere',
"country" => 'US',
"line1" => '366 Eastwood Rd',
"line2" => '',
"postal_code" => '11598',
"state" => 'NY'
],
?? Sales tax = 2.36
?? Shipping = 12.00
// etc...

#

2nd returns error (sales tax and shipping not included in call)

karmic wolf
#

what's the error?

#

like right now you code has ?? in it which isn't real PHP

hoary beacon
#

Yeah, the ?? was just me trying to find out what the tag is called to pass the sales tax and shipping. When I look up sales tax, all I see is instructions for Stripe to handle the sales tax. I've already got it figured out. So I can't pass the postal code? Our customers are very senior (70-90s!) and just want to give them as little as possible to have to enter (i.e. having to again enter the postal code in the checkout).

#

Do I add the tax and shippiung as a product line item?

karmic wolf
#

You can preset the right tax rate yourself

hoary beacon
#

Ok, I'm skimming through. So I still HAVE to set up the table? Because in California, there are already hundreds of districts. I have that all set in our store. Will look into it or just set it up as a line item. Or possibly just pass the grand total (i.e. various items, sales tax and shipping = $123.44). They will get the breakdown later anyway. Just trying to get a bare bones card entry screen with bare amount of input required.

karmic wolf
#

the table of what?

#

I'm sorry I'm not really following you overall, I worry you're rushing to the code and not reading the docs

hoary beacon
#

I just need to read up on it some more. Our cart already calculates the customers tax rate and district info. I was just looking for a way to have that tax rate (say $2.72) show up on the checkout screen. I don't want Stripe to do any tax calculations. Will just do it as a line item. Never mind. I just got the info I needed! THanks for the help

karmic wolf
#

okay so in that case do what I linked earlier

#

create a TaxRate in Stripe and pass that

#

same for shipping

hoary beacon
#

Got it. Thank you very much!