#sapient_api

1 messages ¡ Page 1 of 1 (latest)

maiden sluiceBOT
#

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

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

quick tapir
balmy cradle
#

In my project, I am charging Stripe processing fee from the customer but when a customer makes a payment through acss_debit then this fee is less due to which first in my project I will ask the customer how he wants to pay. If a customer selects acss_debit then for example $12 will be charged from them but if a customer selects acss_debit and makes the payment through card then it is said to be wrong. If during the payment I find out how the payment is being made then I can stop it. If possible then let me know.

quick tapir
#

Sorry, not sure I understand. Where does the customer select their payment method?

maiden sluiceBOT
lean cape
#

hi! I'm taking over this thread.

balmy cradle
#

When the customer makes a payment, I ask them how they will pay, then the stripe provides something like I send them acss_debit and if they pay by card, the payment does not succeed.
const session = await stripe.checkout.sessions.create({
mode: "payment",
line_items: stripe_product_price_ids,
payment_method_types: ["acss_debit", "card"],
payment_method_options: {
acss_debit: {
mandate_options: {
payment_schedule: "interval",
interval_description: "On ",
transaction_type: "personal",
},
verification_method: "automatic",
},
})}

lean cape
#

Where do you ask hwo the customer will pay? On the Checkout Session page itself, or before you redirect the user to the Checkout Session.

balmy cradle
#

Yes, it will be just a string value, which I want to pass to Stripe's stripe.checkout.session function. If Stripe has such a functionality to pass in stripe.checkout.session, then Stripe will know whether the payment is made by card or by acss_debit. If the string value is acss_debit and the customer pays by card, then the payment should fail. If this is possible, please tell me.

lean cape
#

Sure, in your code you wrote this: payment_method_types: ["acss_debit", "card"],. So update this line to online include acss_debit or card, depending on what the user choose earlier in the flow.

balmy cradle
#

please explain me in details

lean cape
#

which part is not clear?

#
  • Using payment_method_types: ["acss_debit", "card"] means both acss and card are accepted
  • Using payment_method_types: [ "card"] means only card is accepted
  • Using payment_method_types: ["acss_debit"] means only acss is accepted