#ceducharme_api
1 messages · Page 1 of 1 (latest)
đź‘‹ 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/1414946678884270183
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
Hi, let me know if you need more details or code sample of how I create payment methods and/or subscriptions!
what's your payment flow exactly to create the bank PaymentMethod?
User clicks Add Pre-authorized Debit that triggers creating a setup intent on the server to get client_secret and then open a modal with stripe PaymentElement component in it.
Creating the setupIntent with the following params: {
customer,
usage: "off_session",
payment_method_types: [ "acss_debit"],
payment_method_options: {
acss_debit: {
currency: "cad",
mandate_options: {
payment_schedule: "combined",
transaction_type: "business",
interval_description: "when issued invoices become due | quand les factures émises arrivent à échéance",
}
},
}
Then user fills the form and clicks Continue which triggers stripe.confirmSetup on the client
so you are first creating a SetupIntent, and then using the Payment Element to collect the payment method details?
Yes exactly that for bank accounts only since client_secret is required before hand when using PaymentElement, when adding a credit card I create the setup intent only after user submits the form to prevent creating customers that might never be ones.
When I look at the bank payment method created and attached to the customer the mandate is there and seems to be valid to be used for off_session payment confirmation
which payment method are you looking at exactly? pm_1S1XkFFOEj3lF4AUYamsUt1u?
Yes pm_1S1XkFFOEj3lF4AUYamsUt1u
In the dashboard the mandate Id is there and was created with the proper mandate options
here's the SetupInent that created that Payment Method, which originally failed: https://dashboard.stripe.com/test/logs/req_xS22hRniXMD2Gw
could you create a new SetupIntent/PaymentMethod, without that error?
now can you collect the payment method
and then try starting a subscription with that new PaymentMethod?
Just did that, the payment intent on the invoice is in requires_confirmation status, so it did not confirmed it automatically
Hey there, taking over for @oak temple as they needed to step away. Looking into this now
Good, let me know if you have any questions
Sorry, lots of active threads right now, still looking things over
Looking at req_2F69UJrL0n5Px3 where you made the POST /v1/payment_intents/:id/confirm request, you can add the parameter off_sessoin set to true, since you're doing this server side
Set to true to indicate that the customer isn’t in your checkout flow during this payment attempt and can’t authenticate. Use this parameter in scenarios where you collect card details and charge them later.
Can you check to see if this works?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
When I'm creating the subscription I set the off_session to true. That was an attemp trying to confirm payment intent after creating the subscription, but I don't think it's the way since it's pretty hacky (extracting the payment intent id from the client secret). I've commented that part in my code to let billing handle it as it should, I could make a simpler confirmation that doesn't try to set the mandate and just confirm without any options if you think It could work. The problem seems to be more with the way the payment intent is automatically created, since it doesn't seem to be aware theres a mandate on the payment method it's trying to use
Got it. Looking at this subscription creation request req_PGzlAGWAKyBe3V, you are using payment_behavior: "default_incomplete". This is unnecessary, because you already have the customer and payment method setup as the default. If you remove this parameter, it should work for your use case
Just tried it, now I get payment failed event on the invoice and payment intent is still in requires_confirmation status
Can you provide the Request ID?