#linqisnice_best-practices

1 messages ¡ Page 1 of 1 (latest)

dull flareBOT
#

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

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

steep perchBOT
#

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.

hybrid wing
#

Can you provide some more context on the question? What is a transaction fee in this query?

ashen aspen
#

Sorry. So, when I create charges with on_behalf_of, since the connected accounts are express, my understanding is that we, the platform, need to incur fees on charges if we don't want to lose money. But the ApplicationFee property in the paymentintent object is long, and the minimum value is one unit of currency. But this value is different in different currencies. So 1 usd is 8x 1 sek for example

#

feel free to correct anything i said as well, i think my understandign is correct with regards to express/onbehalfof

hybrid wing
#

You seem to be confusing the processing/Stripe fees and the application fee

ashen aspen
#

Are you sure? I had a discussion with a stripe support agent earlier (on your website). I was told there are two alternatives; one is that Stripe handles the charge and everything, and one is that stripe charges US, the platform (0.25% + 5 sek in this case)

#

and then i was told we need to collect application fees from onbehalfof charges on connected accounts

#

"(08:56:18 AM) Karan: You are responsible for processing fees from Stripe, and you can collect fees from your users to earn revenue on every transaction."

hybrid wing
#

If you're doing destination charges with Express accounts then the platform pays the processing fees. You can of course pass than onto the connected account via the application fee

#

But that's not the sole application purpose of the application fee

ashen aspen
#
        var options = new SessionCreateOptions
        {
            LineItems = await CreateSessionLineItems(products, currency, connectedAccountId),
            UiMode = "embedded",
            Mode = "payment",
            ReturnUrl = $"",
            PaymentIntentData = new SessionPaymentIntentDataOptions
            {
                OnBehalfOf = connectedAccountId,
                TransferData = new SessionPaymentIntentDataTransferDataOptions
                {
                    Destination = connectedAccountId
                },
                Metadata = new Dictionary<string, string>
                {
                    {
                        StripeMetadataKeys.OrderId, orderId
                    },
                    {
                        StripeMetadataKeys.Source, "regular_checkout"
                    },
                    {
                        StripeMetadataKeys.CustomerLanguage, customerLanguage.ToString()
                    }
                },
                ApplicationFeeAmount = (long)(products.Sum(product => product.Quantity * product.Price) * 0.01m)
            },
            Currency = currency.ToString().ToLower(),
            ExpiresAt = DateTime.UtcNow.AddMinutes(30)
        };

This is the object

hybrid wing
#

Overall, not really sure what your question is:

But the ApplicationFee property in the paymentintent object is long, and the minimum value is one unit of currency. But this value is different in different currencies. So 1 usd is 8x 1 sek for example
What does this mean?

ashen aspen
#

so its express account + destination charges

#

so let me understand: with my current setup, stripe will charge us 0.25% + 5 sek, correct?

And WE, the platform, can collect money from all charges initiated by our connect accounts (or well initiated by our platform but u get it)?

#

which would cover the stripe charge + more if we want to take a bigger cut?

#

and for this, i should use the ApplicationFee property in the paymentintentdata object?

ashen aspen
hybrid wing
#

so let me understand: with my current setup, stripe will charge us 0.25% + 5 sek, correct?
I'm not sure on the exact sticker pricing you'd pay, plus will vary depending on the payment type. But seems roughly accurate

which would cover the stripe charge + more if we want to take a bigger cut?
Yes

hybrid wing
ashen aspen
#

I forgot, doesnt stripe process payments and amounts in the currency's smallest possible unit? so for usd it would be cents, so amount = 100 is not 100 usd but rather 1 usd?

#

so if I set ApplicationFee = 1 and currency is usd, that means 1 cent?

hybrid wing
#

Correct

ashen aspen
#

I think this is where the confusion comes from

#

makes sense. then I think that actually settles it,thanks a lot!

#

is there a reason why the PaymentLinkPaymentIntentDataOptions doesnt take ApplicationFee but SessionPaymentIntentDataOptions does?

#

furthermore... PaymentLinkCreateOptions has a ApplicationFeePercent field

#

but no such field for SessionPaymentIntentDataOptions

#

the ApplicationFeePercent field seems to suggest its related to subscription invoices

hybrid wing
#

Yes, you can only use % fees with recurring payments (subscriptions)

#

That field is in the subscription_data hash

ashen aspen
#

ok, so we charge either with a paymentlink or checkout session, but for checkout session, you can configure application fee on the attached PaymentIntent object but this is not the case with PaymentLink, which directly has an applicationfee property

#

but it specifies that

#

"Can only be applied when there are no line items with recurring prices."

#

im not entirely sure how to interpret that

#

the opposite of a recurring subscription? i.e. one time purchase?

hybrid wing
#

Yes

ashen aspen
#

ok thanks, then I guess that should be enough?

hybrid wing
#

For PL you'd use application_fee_amount, for Checkout you'd use payment_intent_data[application_fee_amount]. It's just how the API was designed