#001101011
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
Could you please share a PaymentIntent ID pi_xxx and/or PaymentMethod ID pm_xxx?
sure
pm_1LpscvCUdHTy3xhmjxnUbw5H
no payment intent could be generated as the error is rasied when creating the PI (AFAIK this is due to the set of param confirmation_mode='automatic' and confirm=True)
FYI we also use off_session=True
I see an active mandate associated with this PM, not sure why it's not valid. Could you please share a request ID? req_xxx
Sorry my bad ! the PM i sent is for a pb totally different
we are struggling with this PM pm_1LnQ4DCUdHTy3xhmTCaXaLWJ
here is an associated request id froma few moment ago req_oRYPOJtP0VFdZ8:
there was an issue a few months ago with stripe and SEPA, it may be possible that at this time stripe regenerated a mandate automatically
we did not implement a custom flow to regenerate the mandate of a PM (is it possible) on our side
Could you please share the Request ID? req_xxx
When we try to generate the PI ? it's this one : req_oRYPOJtP0VFdZ8
To fix the issue without thinking too much, i guess we can create a new SI with the PM id in it, but honestly things are really obscure on what will be created / refreshed / reactivated
And also.. if this is the right move.
This will surely solve the problem. However, I understand it would be ideal if you didn't need to bother the customers again. Let me check if this is possible.
I also dont know the prerequisites such as if the new IBAN data must be the same as the previous one, if the pm id will change, etc.
But that can be sorted out by testing.
A new payment method will be created if you collect it again.
but then, why can we pass the pm id in the param of the creation of the SI ?
the link between SI / PM / mandate tbh is very unclear..
strangely enough, i am able to create a PI manually, and then use the PM to validate the PI (as a customer).
the id is pi_3MTP1uCUdHTy3xhm0Zrm7dZ4
no idea is this is deemed to fail though
Did you use the same IBAN in this request?
i directly use the previous PM pm_1LnQ4DCUdHTy3xhmTCaXaLWJ
the one with inactive mandate
I don't think it's possible to re-collect the mandate for an existing PaymentMethod. Please try to Setup the PaymentMethod again if possible.
If it's multi-use it should be valid for long time.
I know, and I can't see why it was invalidated. It doesn't happen normally. Will try to investigate further.
Hi! I'm taking over this thread.
The mandate was made invalid because there was a dispute or chargeback on a previous payment made against the payment method.
So you need to run another SetupIntent with the customer to accept the payment details again and create a new mandate.
Hi @fallen nova !
Thank you for the information, is this behaviour consistent e.g: every PM/mandate will be made invalid in the same conditions ?
So can you confirm me :
- what happens to the PM if we try to register a new SI wth the PM passed as an arg : a new PMid is generated ? the new mandate is attached to the previous one ?
- is there any other way to refresh the mandate ?
i am also quite unsure if there is a good way to "find back the mandate"
We are able to do that when the PM was created via a SetupIntent, but what if is was saved while making a charge ?
- what happens to the PM if we try to register a new SI wth the PM passed as an arg
No, I think you would need to create a new SetupIntent and ask the user to re-enter all their payment information.
ok but then what is the point of passing the old pm id as proposed here https://stripe.com/docs/api/setup_intents/create#create_setup_intent-payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I think this is for a different flow, for example if you have a payment method that is not yet attached to a customer.
thx for confirmation! Quite good about implementing the logic now, i just my previous questions :
im quite unsure if there is a good way to "find back the mandate". We are able to do that when the PM was created via a SetupIntent, but what if is was saved while making a charge ?
-
is there any other way to refresh the mandate ?
-
is this behaviour consistent e.g: every PM/mandate will be made invalid in the same conditions ?
unfortuantely there's no good list API for mandates so the only way to know it is to read the ID from the SetupIntent it came from.
the only way to refresh it is to re-collect the bank details
should be consistent
so if the PM was setup from a pamyentintent we should parse the PI ? OK we will implement the 2 flows
thank you for clarification
@civic osprey I do have another question
I am now trying to get the mandate from a PI (or charge)
This looks basically impossible.
- I fetch the PM -> the field generated_from contains two null values for charge // setup_attempt
How whould i do ?
what's the ID pm_xxx you're looking at?
for e.g pm_1MTQR1CUdHTy3xhmhGsg9T5G
the mandate is in payment_method_details of the Charge where it was first used
so here that is pi_3MTQR0CUdHTy3xhm0EDbc0Od
yes but how can i find this charge if a thousand were created ?
the latest_charge on that object is py_3MTQR0CUdHTy3xhm0OE88b8p and if you retrieve that you can get https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate
that assumes we know the first PI, which is the same problem
i dont have the source PI in the PM
I don't think there's a great way, beyond just saving the information from a webhook at the time of each payment, or using https://stripe.com/docs/api/payment_intents/list#list_payment_intents-customer to look at payments for that customer and find it from there
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
the bug issue with the listing is that we cant go backward in time
it's a bad design that there's no mandate list endpoint unfortunately
what does that mean?
we have the most recent PI first, and then the oldest ones AFAIK
yep
arf, and any reason why the "generate_from", which looks like a gerat candidate, is null ? this field in the PM would be perfect, it evenhas the charge field
(theorically)
what field specifically is this?
on payment_method -> sepa_debit.generated_from.charge
yeah I don't know
I agree that should probably be populated
maybe it only is if you do the payment in the recommended integration with client-side confirmation in stripe.js https://stripe.com/docs/js/payment_intents/confirm_sepa_debit_payment (I see you passed the pm_xx to the backend and confirmed the PaymentInten in backend python code). Not sure.
pretty sure it's that actually
I have to run , sorry, my colleagues can help with any follow up questions about how best to find the mandate object for a given PaymentMethod.
i dont have the field populated in production objects either, which are generated via the recommended implementation
no success with using the latest stripe_version of the API either
if i could simply get the oldest charge and/or PI associated with a PM we would be able to solve the situation though
yep unfortunately there's no straightforward way
you can list PaymentIntents like I said.
just paginate through it, the last one is the oldest one. Or use webhooks to save some of this in your database on an ongoing basis
also sorry, really have to go now
np, would love to have a followup to explore other alternative though( with someone else sure)
Hey apologies the server has been busy so I have been slow catching up. Catching up now
maybe some trick with the search endpoint of Charge ?
hello Pompey, np
The core issue here is how to find the mandate associated with a PM of type sepa_debit in the case where the PM was registered via a PI and not a SI
our only solution is to list all PI (or charge basically the same) from newest to oldest, associated with the PM, then find the oldest one, and from here we can get the mandate in the charge object
(which is highly suboptimal)
Yeah unfortunately that is the best interface we have for this at the moment
It is a heavily requested feature to be able to do this more straightforwardly but at the moment we don't have that functionality
It might make sense to store the mandate on your payment method objects as metadata, or store the mandate ID locally to avoid Stripe looksups at all
the issue is we have dozen of thousand (if not more) PM saved on multiple stripee accouns
saving in metadata is a bit hard as we are doing the recommended flow which is confirming the PI inside the frontend, i dont think we can do that from here
maybe via the implementation of custom webhook, which add quite an overhead in coding/maintenance
any hint on why the generated_from field inside sepa_debit field of the PM is not populated ? Inside there is a charge property (unfortunaltey null) that looks like a great fit
Unfortunately I think any solution here will be suboptimal in some way. I am definitely using this to add to the existing feedback for the heavily requested improvements to this interface, but I don't think the solutions you just listed there are the best ones available at the moment if you are storing that data on the Stripe side
Looking in to that field
thx
side-note question: we will work on testing all this and coding a way for end user to replace an expired mandate (thus an "expired PM) with a new one.
Do you know how we can generate a PM with an expired (inactive) mandate ? I cant find something in the stripe test card /PM
We really need to test that to be sure we can catch these events live.
any news @buoyant flower ?
Apologies server got very busy and haven't found much but am still looking. Also will check in to how to get an inactive mandate in test mode. I don't think we have a specific card that does it but I think there are actions you can take that can invalidate them
on card ? i thought mandate were only for sepa_debit
I meant IBAN though we do have card mandates for Indian customers as RBI regulations require it.
I am still not getting generated_from to be populated unfortunately, I don't know if that field has an intended purpose or is just broken here
ok anyway we will work without
About the test PM (or a way to force expiration / inactive status) any idea ?
I thought that creating a dispute would do that but it looks like it doesn't work for SEPA mandates from testing just now
I am still looking. I think there is a way to do this
thx
Unfortunately I'm just not finding answers here at the moment. I think I will have to reach out to our engineering team behind SEPA here and ask them for clarification on all of these points, though they won't be able to get back quickly so I think you may have to write in an email to our support team so I can grab it
Just to be on the same page, our main remaining questions are:
- Is there any recommended way to keep on top of active mandates outside of webhooks for succeeded payments?
- Is
generated_fromever populated and can that help us see active mandates? - Is there a way to invalidate a mandate for testing purposes?
yes these are the remaining issues !
Actually apologies but I can't send the email out. Can you send one in via https://support.stripe.com/?contact=true ?
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Just let me know when it is sent and I can grab your ticket
sure but how to put all the context of the question in order not to start over ?
Don't need to summarize too much, can just mention talking to me on Discord and I can fill in the rest
should i put an id of thread or something ?
You can add the URL for this thread but I have no issues adding myself once I've grabbed the ticket
ok ive sent it just now
Grabbed it thank you!
Will reach out to the eng team and get back to you with what I hear from them
thx @buoyant flower , have a great day
You too!