#oxmarco_code
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/1247164912845852713
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
const session = await this.stripe.checkout.sessions.create({
line_items: [
{
price_data: {
tax_behavior: 'exclusive',
currency,
product_data: {
name: 'file',
images: [img],
},
unit_amount: price,
},
quantity: 1,
},
],
mode: 'payment',
success_url: redirectSuccess,
cancel_url: redirectCancel,
automatic_tax: {
enabled: false,
},
tax_id_collection: {
enabled: false,
},
invoice_creation: {
enabled: false,
},
payment_intent_data: {
application_fee_amount: price / 10, // 10%
capture_method: 'automatic',
transfer_data: {
destination: stripeAccountId,
},
},
metadata,
});
No, there's no built-in way to make the fees visible, but you can manually create Products and Prices for this.
should I just add more items to the line_items array?
and call them like stripe fee and app fee
Yes, that would work.
wouldn't that mess up the application fee though?
say price is $10, then I add stripe fee on top 1.5%+$0.25, then 10% app fee
Yes, normally you wouldn't pass the fees onto your customer, so you will have to work around it and do all the calculations yourself: https://support.stripe.com/questions/passing-the-stripe-fee-on-to-customers
Please note:
In some jurisdictions, charging processing fees to your customers is prohibited by law.
I see, if I stick to my current code, who is paying stripe fees?
The Platform account, but since you collect application fee from your Connected account, it should cover that.
ok then the connected account will pay both the stripe fee and the app fee, right?
Yes
Well, not exactly. CA will just pay the application fee, and then your Platform will pay the Stripe fee, but given the former is 10%, it should cover the Stripe fee.
I see, some items are like $0.5
app fee would collect $0.05 but the min Stripe fee is $0.25
thus I need to make the min price $2.5 if I want to make sure the stripe fee is covered
Yes, that sounds right.
ok, one last thing, would it be possible to review the complete flow before I go to prod?
Sure, you can try almost every Stripe feature in Test mode - using your test keys
1. Register user
return await this.stripe.accounts.create({
email,
controller: {
losses: {
payments: 'application',
},
fees: {
payer: 'application',
},
stripe_dashboard: {
type: 'none',
},
requirement_collection: 'application',
},
capabilities: {
card_payments: {
requested: true,
},
transfers: {
requested: true,
},
},
business_type: 'individual',
business_profile: {
mcc: '5815', // digital_goods_media
url: `https://example.com/users/${userId}`,
},
country: 'DE', // TODO get from ip
tos_acceptance: {
date: Math.floor(Date.now() / 1000),
ip,
},
});
2. Onboard user
return await this.stripe.accountLinks.create({
account: stripeAccountId,
refresh_url: 'https://example.com/profile?verification=false',
return_url: 'https://example.com/profile?verification=true',
type: 'account_onboarding',
});
3. Listen to wekhooks
const event = await this.stripeService.processWebhook(
requestBody,
signature,
);
if (event.type === 'checkout.session.completed') {
await this.processCheckout(event);
} else if (event.type === 'account.updated') {
await this.processAccountUpdate(event);
}
my questions are:
- is this process correct?
- should I validate the
account.updatedhook to make sure the user has successfully been onboarded - are payments sent to the user on a rolling basis or do I need to create payouts manually?
Hi there ๐
- looks right, are you running into problems during your testing that you're trying to troubleshoot?
- Absolutely
- It doesn't look like you're overriding Payout settings to be manual, so they will be sent automatically.
hey ๐
- no, but the documentation is a bit confusing, probably due to the extreme flexibility of Stripe APIs
- Can I just watch the webhook data or should I call a specific endpoint to validate the user status?
- is there any fee savings when using manual vs automatic payouts?
You need to look at the contents of the account.updated Event. Some key fields to check are charges_enabled, payouts_enabled, and the requirements hash. They give you a good sense of the state of the account.
I'm not sure if there any cost savings, we aren't familiar with fees in this forum and mostly focus on helping with our API. You'll want to contact our Support team for questions regarding pricing and fees:
https://support.stripe.com/?contact=true
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
ok perfect then
on this, I think a few items are duplicated
like automatic_tax and tax_id_collection
Nope, those control different features.
automatic_tax
Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions.
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-automatic_tax
vs
tax_id_collection
Controls tax ID collection settings for the session.
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-tax_id_collection
ok perfect
that was all
I guess I can ask the commercial support for tax-related questions, right?
Sure, if it's a question about integrating one of our tax related products into your integration, we're likely the better channel for that. If the question is about pricing for our tax products, or if you disagree with how we calculated tax for a given transaction, then those are better handled by our Support team.
well my question is simple, my company is located in a country that doesn't have taxes (Gibraltar) serving mainly UK and DE customers, should I charge taxes or not?
That's a question that you should ask your legal advisor/tax advisor.
Stripe tax is not available for Gibraltar
I assume then I can't activate the automatic_tax flag
I'm not too familiar with the regional limitations there. I'd expect you'd encounter an error if you're trying to use something that isn't available to your account though, when you make the request to create the session.
๐ sounds good
Oh one thing
can I avoid setting the country upon registration?
return await this.stripe.accounts.create({
email,
controller: {
losses: {
payments: 'application',
},
fees: {
payer: 'application',
},
stripe_dashboard: {
type: 'none',
},
requirement_collection: 'application',
},
capabilities: {
card_payments: {
requested: true,
},
transfers: {
requested: true,
},
},
business_type: 'individual',
business_profile: {
mcc: '5815', // digital_goods_media
url: `https://privatedrops.me/users/${userId}`,
},
country: 'DE', // TODO get from ip
tos_acceptance: {
date: Math.floor(Date.now() / 1000),
ip,
},
});
here country: 'DE', // TODO get from ip
Should be able to, do you get an error when you try to do so?
no