#jayvir_code

1 messages ¡ Page 1 of 1 (latest)

analog ventureBOT
#

👋 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/1356556347403014237

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

undone copper
#

need help in application fee percent in subscption

#

const subscription = await stripe.subscriptions.create(
{
customer: customerId,
items: [
{
price: priceId,
},
],
payment_behavior: 'allow_incomplete',
proration_behavior: 'none',
default_payment_method: paymentMethodId,
cancel_at: cancelAtTimestamp,
application_fee_percent: applicationFeePercent,
billing_cycle_anchor: billingCycleAnchor,
collection_method: 'charge_automatically',
payment_settings: {
payment_method_options: {
card: {
request_three_d_secure: 'automatic',
},
},
},
metadata: metadata,
},
{
stripeAccount: connectedAccountId,
},
);

#

Payment amount
US$265.50 USD
Fees

  • US$15.49 USD
    Stripe processing fees
  • US$8.00 USD
    abc Interactive, Inc. application fee
  • US$7.49 USD
    Net amount
    US$250.01 USD

need help in issue - fees should be 15.50
abc Interactive, Inc. application fee

  • US$7.50 USD

@fresh thistle hope you got issue

fresh thistle
#

Hi, let me help you with this.

#

265.50 * 0.0282 = 7.4871 -> 7.49
The calculation seems to be correct.

#

It was rounded up.

undone copper
#

let feePercent = Number(((skFee / installmentTotal) * 100).toFixed(2));

#

i need it to be 7.50 for amount - 265.50

#

what changes should i make as
stripe support upto 2 decimal only

fresh thistle
#

Yes, using percentages won't give you an exact number you're looking for.
You could try 2.83% and collect a slightly smaller fee.

Otherwise, you can update the exact fee amount on each new Invoice. For that, you need to listen to the invoice.created webhook event, and make a request to update the Invoice directly to set the application_fee_amount=750: https://docs.stripe.com/api/invoices/update#update_invoice-application_fee_amount

undone copper
#

@fresh thistle
thats not good solution
need more concrete solution

fresh thistle
#

Why is it not good exactly?
What do you mean by "concrete"?

undone copper
#

@fresh thistle provide me better solution then this

fresh thistle
#

Please answer my questions above.

undone copper
#

i just want directly manage when i create/update subscprition
not during invoice like u mentioned

fresh thistle
#

It's not possible, unfortunately.