#crenon-payment-methods

1 messages ยท Page 1 of 1 (latest)

gloomy galleon
#

๐Ÿ‘‹ @lofty kestrel Happy to help

lofty kestrel
#

thanks!

#

I'm hoping to get a list of payment methods of type "card" so that I can check them for upcoming expirations and sent notifications to the cardholders

#

here's the code that's returning a blank array:

#
        'type' => 'card',
    ]); ```
lofty kestrel
gloomy galleon
#

The payment methods are stored under the Customer object

lofty kestrel
#

ah, so maybe there's no way to list all the payment methods, platform-wide?

#

i was trying to use this:

#

do you know if there's a better way to get all the stored cards that are expiring soon? I'm trying to notify customers so they can update their cards before their recurring payments occur

#

ive explored using the webhook customer.source.expiring but it's not triggerable through the CLI so testing it seems like a beast

gloomy galleon
#

Listing all payment methods platform wide is not supported. To retrieve all payment methods, you'll first retrieve the list the customers and retrieve their payment methods

#

customer.source.expiring is legacy and it's not supported in PaymentMethod object

lofty kestrel
#

ok gotcha, thank you!

#

i'll work on retrieving the customers and then their methods.

#

thanks for your help!

gloomy galleon
#

No problem! Happy to help ๐Ÿ™‚