#Paulera-PI Search
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
these are the only fields searchable for Payment Intents
let me know if you need any more help
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?
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
Batch cancellation of payment intents.
Based on business rules, yes. I store them on my side.
couldn't you use the query fields to get them instead of storing the ids?
would you mind me asking what are the criteria?
I'm already storing them on my side, so no overhead here.
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
Yeah, thank you. I know what you meant, but I'm already storing them and I don't need to stop doing it.
then you'd have to retrieve them 1 by 1 then
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).
are you using webhooks?
Yes, I am
one thing you could do is to add a metadata that marks them as "cancellable"
Hm. But what steps you had in mind? If you don't mind me asking. I didn't get the whole idea. ๐
yeah sorry, I'm juggling a lot of threads and wasn't able to fully work my way through my thought process there ๐คฆ
I appreciate you time and effort to help me and others. Thank you ๐โโ๏ธ
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