#Paulera-PI Search

1 messages ยท Page 1 of 1 (latest)

pale jay
#

๐Ÿ‘‹ happy to help

#

these are the only fields searchable for Payment Intents

tough fog
#

๐Ÿ˜ข

#

Thank you!!!

pale jay
#

let me know if you need any more help

tough fog
#

Hm. Could I do something in Stripe to configure the ID to be stored as a metadata then use the query field to return all intents for a list of IDs that are now stored in the metadata field?

pale jay
#

there's nothing that could stop you from doing that technically

#

but is it really a good idea?

#

what are you trying to achieve beyond the how? maybe I could suggest some other path

tough fog
#

Batch cancellation of payment intents.

pale jay
#

based on a criteria?

#

how are you collecting all of the ids?

tough fog
#

Based on business rules, yes. I store them on my side.

pale jay
#

couldn't you use the query fields to get them instead of storing the ids?

#

would you mind me asking what are the criteria?

tough fog
#

I'm already storing them on my side, so no overhead here.

pale jay
#

but what if you don't need to?

#

what I'm trying to say is that maybe there's another approach that would be more straight forward

tough fog
#

Yeah, thank you. I know what you meant, but I'm already storing them and I don't need to stop doing it.

pale jay
#

then you'd have to retrieve them 1 by 1 then

tough fog
#

Criteria based on the payment intent itself would be status in (requires_payment_method, requires_action) and should be in that state for a certain time (let's say, 1 day or else).

pale jay
#

are you using webhooks?

tough fog
#

Yes, I am

pale jay
#

one thing you could do is to add a metadata that marks them as "cancellable"

tough fog
#

Hm. But what steps you had in mind? If you don't mind me asking. I didn't get the whole idea. ๐Ÿ˜†

pale jay
#

yeah sorry, I'm juggling a lot of threads and wasn't able to fully work my way through my thought process there ๐Ÿคฆ

tough fog
#

I appreciate you time and effort to help me and others. Thank you ๐Ÿ™‡โ€โ™€๏ธ

pale jay
#

so basically what I was thinking of doing is something like when your webhook receives the payment_intent.failed or payment_intent.requires_action you would update the PI and set the metadata to something like this: {cancel_time: now+x}

#

and when the payment_intent.succeeded event happens remove the metadata

#

when you run your cron job now all you have to do is use the Query fields metadata["cancel_time"] < time

#

and you can add something like -status:succeeded

#

to get only the non-succeeding ones

tough fog
#

Ooooh. Yeah, that sounds neat.

#

Hey, I don't want to hold on this anymore. ๐Ÿ˜†
You've given me a lot to work with! I'll bring all of this home and think about the best solution.

#

I really appreciate your help!!