#stupendouspineapple_api

1 messages ¡ Page 1 of 1 (latest)

robust wadiBOT
#

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

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

woeful glade
#

Here is the code which creates the checkout session

List<SessionLineItemOptions> lineItems =
[
    new SessionLineItemOptions
    {
        Name = "Redacted",
        Amount = (long)bill.TotalAmount_Pence,
        Currency = "gbp",
        Quantity = 1
    },
];

Stripe.Checkout.SessionService service = new();

SessionCreateOptions sessionOptions = new()
{
    PaymentMethodTypes = ["card"],
    LineItems = lineItems,
    SuccessUrl = request.SuccessUrl,
    CancelUrl = request.CancelUrl,
    Metadata = request.Metadata,
    PaymentIntentData = new SessionPaymentIntentDataOptions
    {
        Metadata = request.Metadata,
        ApplicationFeeAmount = (long)bill.TotalApplicationFeeIncludingTax_Pence,
        CaptureMethod = "manual"
    },
    ClientReferenceId = request.UserId.ToString(),
    CustomerEmail = request.Email,
};

RequestOptions requestOptions = new()
{
    StripeAccount = request.HostUserStripeAccountId
};

Stripe.Checkout.Session session = await service.CreateAsync(sessionOptions, requestOptions);
#

Here is the code which captures the partial amount

StripeConfiguration.ApiKey = APIConfig.Instance.StripeSecretKey;
PaymentIntentService service = new();

PaymentIntentCaptureOptions paymentIntentCaptureOptions = new()
{
    AmountToCapture = (long)bill.TotalAmount_Pence,
    ApplicationFeeAmount = (long)bill.TotalApplicationFeeIncludingTax_Pence
};

RequestOptions requestOptions = new()
{
    StripeAccount = connectedStripeAccountId
};

PaymentIntent captureResponse = await service.CaptureAsync(paymentIntentId, paymentIntentCaptureOptions, requestOptions);
plush blaze
#

Sorry, unclear what the ask is here? What you describe is how auth and partial capture works. How that is represented on the customer's bank statement is not something we can control

#

The rest of the original 1000 auth is released/refunded

woeful glade
#

Thanks for the clarification. I would expect the charge to appear as pending on the bank account, and then only the 346 actually be taken. The customer instead said they were charged 1000 and had to wait several days for the 654 refund to be returned to them

plush blaze
#

Depends what they mean by 'charged' I guess. How that is ultimately represented to the customer is down to the issuer/bank. But yes the auth will 'hold' the 1000 funds until capture/released

#

The auth will generally decrement their available balance so it may appear as a payment

#

But that's just how auth/holds work

woeful glade
#

Thank you for your help. So that I can fully understand: the Stripe fees are then based only on the amount actually paid?

plush blaze
#

Correct, yes. The fees are calculated/deducated based on the captured amount

woeful glade
#

Okay, I can now explain this to my client! Thanks