#sreekanth_api

1 messages · Page 1 of 1 (latest)

slate marshBOT
grave forgeBOT
#

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.

slate marshBOT
#

đź‘‹ 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/1240907525629411360

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

tough moth
#

hi

#

We have a requirement where the user can select two charities to make a donation, splitting the amount equally between them. How can we achieve that in one step?

high rain
#

hello! i'm sorry but i don't understand, can you illustrate what you want to achieve with an example?

tough moth
#

In our app, users can make donations to various charities. We have implemented a feature where if a user selects two charities, the total donation amount they enter will be split equally between these charities. For example, if a user chooses Charity A and Charity B and decides to donate $100, the app will automatically divide this amount into two equal parts, resulting in a $50 donation to each charity. This ensures that the user's total donation is efficiently and evenly distributed between the selected charities.

#

For this example, if there are two charities, we loop through each charity and make a payment in the backend.

#

issue is that, if user has 3d secure payment... do we need to ask user to authenticate payment each time ?

high rain
#

You only collect payment and authenticate once :

  • If you're using the Payment Element, you will need to create your own page that displays what the customer is paying for. You define the combined amount that the donor is paying for when creating the PaymentIntent - so it's only one payment
  • if you're using Checkout Sessions, you would define two prices / items so that it's clear to the donor what they're donating for. Payment is still only once and for the total amount (not separate payments)
tough moth
#

We are not using any payment elements or checkout sessions; we are doing off-session payments in the backend.

#

If we make one payment for the combined total amount, what happens if the user wants to cancel one of the subscriptions?

high rain
#

why are you doing off-session payments in the backend when the customer is on-session?

tough moth
high rain
#

I don't have full context here, but to answer your question specifically. If you make 2 separate charges, then yes, it's possible the customer might need to authenticate twice.

If you indicate it's off-session, and the payment method was correctly setup for off-session payments, it would be unlikely that the bank would request for 3DS. If they do, then yes, you could end up needing to ask the customer to authenticate twice

tough moth
#

okay

#

Another question: If a user has multiple saved cards, before payment, can we prefill the data of the selected card onto the payment elements?

high rain
#

no, that's not possible. The Payment Element is used to collect payment method details, you can't "prefill" data of the selected card there.

If you want to offer existing payment methods to be used for payment, you would present those separately. If the donor uses Link (https://docs.stripe.com/payments/link) and you've enabled Link as a Payment Method in your Dashboard settings, the Payment Element will automatically display a previously used/saved payment method for them to pay with : https://docs.stripe.com/payments/link/payment-element-link

Let your customers check out faster with Link.

Link in the Payment Element lets your customers check out faster.

tough moth
high rain
#

that's not the right way to go about collecting payment for already saved cards really if the customer is currently on your app/website

"on session” is when the customer pays on your app/website, “off session” is when the payment is initiated automatically or by the merchant. If the customer is paying on your app/website (even if it's a saved payment method), that's considered as on-session and you shouldn't be indicating that the customer is off-session.

You would use confirmPayment (with the PaymentIntent's client_secret) and with the existing payment method id passed into https://docs.stripe.com/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method

tough moth
#

for one time payment and subscriptions same right?

high rain
#

yep that's right

tough moth
#

okay, thanks

tough moth
high rain
#

Like I mentioned, the Payment Element is used to collect payment method details, you can't "prefill" data of the selected card there.

Usually what you would do is to present the saved payment methods, and in a section below, "add/pay a new card" and display the Payment Element