#deamoner_api

1 messages ยท Page 1 of 1 (latest)

calm brambleBOT
#

๐Ÿ‘‹ 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/1299311909157212175

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

tender loom
#

๐Ÿ‘‹
Could you please share a Stripe Object Id that showcase that calculation ?

near sable
#

pm_1QCe25R8V1frYHNtrurW0cSP

tender loom
#

Could you please share rather a Payment object? like payment_intent Id ?

near sable
#

that id is a payment object

tender loom
#

Nope, that's a PaymentMethod Id

#

which can be used in multiple Charges/PaymentIntents Id

near sable
#

sorry - pi_3QDk7fR8V1frYHNt1di6A2l2

tender loom
#

Thanks, checking..

#

I see this PaymentIntent was created from this Subscription sub_1QDk7fR8V1frYHNtsal8kpwn

#

(299+150) X 35.56 = 159.664 ~160

#

What is the issue here exactly ?

near sable
#

oh wait i'm adding the convience fee and perctage on to the total price

#

but application fee comes off without the fee adding on

#

wait 2.99 * 5% = 15 cents, and I have a flat convience fee of 1.50

tender loom
#

Sorry, I'm not understanding your latest follow up here.

near sable
#
console.log("calculatedFees", calculatedFees);
  console.log("tier.price", tier.price);
  const applicationFeePercent = (
    (calculatedFees.total / (tier.price + calculatedFees.total)) *
    100
  ).toFixed(2);
  console.log("calc1", tier.price + calculatedFees.total);
  console.log(
    "calc2",
    (calculatedFees.total / (tier.price + calculatedFees.total)) * 100
  );
  console.log("applicationFeePercent", applicationFeePercent);
  console.log("number percent", Number(applicationFeePercent));
  console.log(
    "totalcalc with number",
    (Number(tier.price) + Number(calculatedFees.total)) *
      (Number(applicationFeePercent) / 100)
  );
#

In my platform I add a 1.5 convience fee passed on to the customer, plus a 5% transaction fee

#

The fees should be calculated at 1.64

#

but I guess because I am adding the fees on total to the final price that is where I am off

#

yea, that fixed it, thanks