#jackmullinkosson_api
1 messages · Page 1 of 1 (latest)
đź‘‹ Welcome to your new thread!
⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
đź”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1259894057484812309
📝 Have more to share? Add details, code, screenshots, videos, etc. below.
Hello
Can you clarify if you mean adding Stripe fee (the fee that stripe collects) to the total or application fee (the fee that your platform collects)?
The application fee, the fee that my platform collects
Gotcha. So you can create an inline price for the application fee amount that you're setting by using price_data parameter
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items-price_data
So just add a line item which is the same as the application fee. That makes sense!
Oh
Well ignore my last message about updating the transfer_data
it may just do the same thing
It's not necessary, right
yup
yeah that's what I was thinking because the application fee is already deducted from what is sent to the vendor
Correct, I was thinking about something else
I'd give it a try in test mode to be certain
Ok thanks. And one question about the tax, although I have automatic_tax: {
enabled: true,
}, it's showing that it's $0.00 on checkout. Is that because I need to send the customer address in order for stripe to calculate the taxes? Because I don't actually have access to the customer's address, I thought that that would be based on the payment method the customer uses
Or is it just showing $0.00 because I'm in test mode?
You'd also need tax registration to collect Tax using Checkout
I'd recommend reading through: https://docs.stripe.com/tax/checkout
It has step by step instructions to enable Stripe Tax with Checkout
I see. So since I'm not using an existing customer, it should create a new customer and thus use the billing address. The documentation says:
"Checkout uses the shipping address entered during the session to determine the customer’s location for calculating tax. If you don’t collect shipping information, Checkout uses the billing address."
Correct
https://docs.stripe.com/tax/checkout#new-customers
If you don’t pass in an existing customer when creating a Checkout session, Checkout creates a new customer and automatically saves billing address and shipping information. For tax collection purposes, Checkout uses billing and shipping addresses to determine the customer’s location.
Ah, since I'm not using products or prices either, I think what I'm missing is setting the tax_behavior on checkout
Hi, after setting the tax behavior I'm still getting an issue where after entering an address no taxes is collected
It says the tax will update as I enter the address but then it just shows 0. I'm not using pricing or products, just line items, and I'm creating a new customer, not using an existing one.
I wonder if this is only the case on test mode?
const session = await stripe.checkout.sessions.create({
mode: "payment",
line_items,
payment_intent_data: {
transfer_data: {
destination: body.acct_id,
},
application_fee_amount: fee,
},
automatic_tax: {
enabled: true,
},
success_url: ${new URL(req.url).origin}/profile,
cancel_url: ${new URL(req.url).origin}/${body.postId},
custom_fields: [
{
key: "phone",
label: {
custom: "Phone Number",
type: "custom",
},
type: "numeric",
numeric: body?.phone ? { default_value: body.phone } : undefined,
},
],
metadata,
});