#daryl_code
1 messages Β· Page 1 of 1 (latest)
π Welcome to your new thread!
β²οΈ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
β±οΈ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1434778022795546678
π Have more to share? Add more details, code, screenshots, videos, etc. below.
Hey! do give me some time to take a look at this
Sorry, just to clarify, is your question about how to retain a certain fee for a partcular payment method (e.g. Paynow/card)?
And could you clarify what you mean by destination account ?
Hi Teddy
previously this is my approach:
const stripe = getStripe();
const connectedAccountId = process.env.STRIPE_CONNECTED_ACCOUNT_ID;
if (!connectedAccountId) {
res.status(500).json({ error: "Connected account not configured" });
return;
}
const platformFee = 100; // $1.00 NET profit
// β
Estimate Stripe fees (worst case: international card)
const estimatedStripeFees = Math.round(amount * 0.039) + 50; // $0.93 for $10.90
// β
Application fee = Platform fee + Stripe fees
const applicationFeeAmount = platformFee + estimatedStripeFees; // $1.00 + $0.93 = $1.93
const session = await stripe.checkout.sessions.create({
payment_method_types: ["card", "paynow"],
line_items: [
{
price_data: {
currency,
product_data: {
name: promotionTitle,
description: `Voucher for ${promotionTitle}`,
},
unit_amount: amount,
},
quantity: 1,
},
],
mode: "payment",
success_url: successUrl,
cancel_url: cancelUrl,
// β
DESTINATION CHARGES with application fee covering Stripe fees
payment_intent_data: {
application_fee_amount: applicationFeeAmount, // $1.93
transfer_data: {
destination: connectedAccountId,
amount: amount, // Transfer FULL $10.90 to merchant
},
metadata: {
promotion_id: promotionId,
wink_id: winkId,
redemption_frequency: metadata?.redemption_frequency || "once",
},
},
metadata: {
promotion_id: promotionId,
wink_id: winkId,
redemption_frequency: metadata?.redemption_frequency || "once",
created_at: new Date().toISOString(),
},
expires_at: Math.floor(Date.now() / 1000) + 30 * 60,
});
where I delcare an estimatedStripeFees (the worst case scenario)
my question is how am I suppose to do this as Stripe always require me to fill in the transfer data first for me to make the transaction. However if I do not know what payment method customer is using first, I could not give a number to transfer to merchant (my destination account)
what I want to achieve is that everytime customer make a payment I keep $1.00 from the total amount. The remaining - stripe fee will be pass on to the merchant (destination account)
Ah i see, do give me some time to look into this!
I tried doing manual transfer after a successful transaction but I got an error of insufficient available fund in your Stripe account. (But I do not think this is a smart approach as well because transferring amount will have small fees right?) Is there another approach I can look for? Don't mind if you could assist me with this problem
We have this tool called the Platform Pricing tool which helps Platform accounts who are responsible for paying Stripe fees and want to use application fees to recover payment processing costs
If your platform is responsible for paying Stripe fees, the platform pricing tool allows you to set pricing logic for all platform processing fees you charge your connected accounts.
sorry how does this works
basically what it allows you to create pricing that has different application fees based on the properties of a transaction.
For e.g. you can set a certain rule for when a PayNow payment is made through the checkout session
How the tool looks like
Do note that if you use the paltform pricing tool, you need not specify the application_fee_amount when creating the destination charge:
https://docs.stripe.com/connect/destination-charges?platform=web&ui=stripe-hosted#collect-fees
Set your pricing rules in-house, specifying fees directly in a PaymentIntent using either the application_fee_amount or transfer_data[amount] parameter. Fees set with this method override the pricing logic specified in the Platform Pricing Tool.
yes understand still figuring out how to use this platform pricing tool
don't mind if u can explain how to use it. Be it the type of payment, I want to only receive $1 on my end and the remaining amount will go to the connected account (deducting the stripe fee).
how am I suppose to set that over here
Just to clarify, when you say :
remaining amount will go to the connected account (deducting the stripe fee).
Do you mean that the Stripe fee is charged on to the connected accounts and not the Platform account?
yes is that possible?
So essentially, the Stripe Fee that is expected be charged be added to the application fee?
everytime the customer make a payment I notice I receive (amount - stripe fee)
I am fine with either stripe fee is charge on my connected account or the platform account. As long as I received only $1 and the remaining amount goes to the connected account will do
remaining amount means (amount - stripe fee- $1.00(platform fee))
I went on to set this, but I don't see any changes. Care to let me know where I am doing it wrongly
Could you send me your Payment Intent for a recent transaction that was made?
It should have the prefix pi_xxxx
ch_3SPHZ92UDTySi58h1r0uUpBx
pi_3SPHZ92UDTySi58h1TCMKVVt
I tired testing this :
Calculating fees failed Transaction pi_3SPHZ92UDTySi58h1TCMKVVt is invalid.
You configured PayNow int he screenshot you sent, but pi_3SPHZ92UDTySi58h1TCMKVVt was a card payment
For Card Payments you have to select the condition as Card
hi u thr
Hello! Apologies was answering other threads
I noticed that this wasnt a Destination Charge
Could you try it on a destiantion charge?
sorry what do u mean try it on destination charges.
i have this part of the code, am I suppose to fill in the charges here?
payment_intent_data: {
transfer_data: {
destination: connectedAccountId,
// β
Leave amount blank - let Platform Pricing Tool handle fees!
// The amount merchant receives = customer paid - platform pricing fees
},
},
hi anyone could assist me with this
π Hi there, I'm taking over for my colleague. Let me catch up
ok please do thanks I am having a big trouble
The Payment Intent you shared (pi_3SPHMX2UDTySi58h0W2AAsuc) was created from a Checkout Session, but it was not a Connect charge⦠there was no Stripe-Header or transfer_data.destination included when creating the Checkout Session
payment_intent_data: {
transfer_data: {
destination: connectedAccountId,
// β
Leave amount blank - let Platform Pricing Tool handle fees!
// The amount merchant receives = customer paid - platform pricing fees
},
},
Including this will have transfer_data.destination right
When creating a Checkout Session, yes
ok let me try again however, is this rules enough for my requirement (I stated earlier before)
You can use that page to test against various scenarios
You can also use the "Card border" rule to check for domestic vs international cards
can I check with u why is the paynow transaction fee 0.15SGD
1.3% of 10.9 is 0.14sgd
It says that the payment processing fee is 0.14 SGD and you pay tax on that, which is 0.01 SGD = 0.15 SGD
so when would the tax occur?
because I am trying to reverse engineer it
by calculating the stripe processing fee + 1 each time they use paynow
Paynow stripe processing fee is 1.3% so when would this tax comes in?
You pay 1.3% on the Stripe fee: https://support.stripe.com/questions/global-taxation-of-stripe-fees
This is calculated at the same time as the Stripe fee. You can see it for the payment above in this Balance Transaction, for example: txn_3SPJAS2UDTySi58h1N10yzuH
sorry I dont see any numbers does it mean it uses Singapore 9% GST?
As your account is based in Singapore, that looks to be correct: https://support.stripe.com/questions/taxes-on-stripe-fees-for-singapore-based-businesses
The tax on the fee is shown with the description of GST here: https://dashboard.stripe.com/acct_1S2kpa2UDTySi58h/test/workbench/inspector/txn_3SPJAS2UDTySi58h1N10yzuH
ok thanks but GST does not apply to Cards?
hey there π taking over for my colleague
to confirm, are you asking about whether this fee should have been exempt from GST in Singapore?
because when making paynow payments there is tax
but when using card payment I don't see tax
is card payment exempted from GST in Singapore?
yes, checking internally I can confirm that card processing fees are exempted from GST, but Stripe does charge GST on PayNow processing fees
thank you so much