#001101011

1 messages · Page 1 of 1 (latest)

exotic houndBOT
glossy frost
#

Hi! Let me help you with this.

#

Could you please share a PaymentIntent ID pi_xxx and/or PaymentMethod ID pm_xxx?

cosmic haven
#

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

glossy frost
#

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

cosmic haven
#

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:

glossy frost
#

Okay, this one has 2 inactive mandates

#

Checking the reason

cosmic haven
#

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

glossy frost
#

Could you please share the Request ID? req_xxx

cosmic haven
#

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.

glossy frost
#

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.

cosmic haven
#

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.

glossy frost
#

A new payment method will be created if you collect it again.

cosmic haven
#

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

glossy frost
#

Did you use the same IBAN in this request?

cosmic haven
#

i directly use the previous PM pm_1LnQ4DCUdHTy3xhmTCaXaLWJ

#

the one with inactive mandate

glossy frost
#

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.

cosmic haven
#

it was multiuse though

#

created by end of september 2022

glossy frost
#

I know, and I can't see why it was invalidated. It doesn't happen normally. Will try to investigate further.

fallen nova
#

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.

cosmic haven
#

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 ?

fallen nova
#
  • 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.
cosmic haven
fallen nova
#

I think this is for a different flow, for example if you have a payment method that is not yet attached to a customer.

cosmic haven
#

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 ?

civic osprey
#

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

cosmic haven
#

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

cosmic haven
#

@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 ?

civic osprey
#

what's the ID pm_xxx you're looking at?

cosmic haven
#

for e.g pm_1MTQR1CUdHTy3xhmhGsg9T5G

civic osprey
#

the mandate is in payment_method_details of the Charge where it was first used

#

so here that is pi_3MTQR0CUdHTy3xhm0EDbc0Od

cosmic haven
#

yes but how can i find this charge if a thousand were created ?

civic osprey
cosmic haven
#

that assumes we know the first PI, which is the same problem

#

i dont have the source PI in the PM

civic osprey
# cosmic haven yes but how can i find this charge if a thousand were created ?

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

cosmic haven
#

the bug issue with the listing is that we cant go backward in time

civic osprey
#

it's a bad design that there's no mandate list endpoint unfortunately

civic osprey
cosmic haven
#

we have the most recent PI first, and then the oldest ones AFAIK

civic osprey
#

yep

cosmic haven
#

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)

civic osprey
#

what field specifically is this?

cosmic haven
#

on payment_method -> sepa_debit.generated_from.charge

civic osprey
#

yeah I don't know

#

I agree that should probably be populated

#

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.

cosmic haven
#

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

civic osprey
#

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

cosmic haven
#

np, would love to have a followup to explore other alternative though( with someone else sure)

buoyant flower
#

Hey apologies the server has been busy so I have been slow catching up. Catching up now

cosmic haven
#

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)

buoyant flower
#

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

cosmic haven
#

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

buoyant flower
#

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

cosmic haven
#

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.

cosmic haven
#

any news @buoyant flower ?

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

cosmic haven
#

on card ? i thought mandate were only for sepa_debit

buoyant flower
#

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

cosmic haven
#

ok anyway we will work without

About the test PM (or a way to force expiration / inactive status) any idea ?

buoyant flower
#

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

cosmic haven
#

thx

buoyant flower
#

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:

  1. Is there any recommended way to keep on top of active mandates outside of webhooks for succeeded payments?
  2. Is generated_from ever populated and can that help us see active mandates?
  3. Is there a way to invalidate a mandate for testing purposes?
cosmic haven
#

yes these are the remaining issues !

buoyant flower
#

Actually apologies but I can't send the email out. Can you send one in via https://support.stripe.com/?contact=true ?

#

Just let me know when it is sent and I can grab your ticket

cosmic haven
#

sure but how to put all the context of the question in order not to start over ?

buoyant flower
#

Don't need to summarize too much, can just mention talking to me on Discord and I can fill in the rest

cosmic haven
#

should i put an id of thread or something ?

buoyant flower
#

You can add the URL for this thread but I have no issues adding myself once I've grabbed the ticket

cosmic haven
#

ok ive sent it just now

buoyant flower
#

Grabbed it thank you!

#

Will reach out to the eng team and get back to you with what I hear from them

cosmic haven
#

thx @buoyant flower , have a great day

buoyant flower
#

You too!