#Dan Judge

1 messages ยท Page 1 of 1 (latest)

wraith edgeBOT
shy ravine
#

๐Ÿ‘‹ happy to help

#

what exactly can I check to make sure the customer has absolutely no payment methods?
first thing I would highly recommend using the invoice.created event instead of the invoice.payment_failed event, in order to check if the customer has a valid Payment Method

wraith edgeBOT
rigid basalt
#

Isn't it just an invoice object that's sent either way?

#

catching up on your question....

#

the point of using invoice.created is that you can check if the customer has a payment method before the attempt is actually made(we create the invoice, and then we wait an hour before charging). Seems like it might be more useful then only reacting to the failure, but you're right that either works really

#

(thread unlocked)

vernal sail
#

That payment method list for customers is perfect, thank you.

#

Is there a way to access this via Classes in PHP?

For example, I'm getting customers like this:

\Stripe\Customer::receive();

unique summit
#

Hi there ๐Ÿ‘‹ catching up as my teammate needed to step away.

vernal sail
#

$stripe = new \Stripe\StripeClient('sk_test_NZbNA0pwnqC2cKBuewhhgQMf00B2NO28bR');
$stripe->customers->allPaymentMethods(
'cus_NpISbxuPXM2sn5',
['type' => 'card']
);

#

That's from the docs, but I'm using the other way in PHP

#

Thanks Toby

unique summit
#

I'm not too familiar with writing PHP using that approach, does \Stripe\Customer::allPaymentMethods work?

vernal sail
#

That's where I was heading if I didn't get a reply, so I'll give that a go, ha, cheers Toby

vernal sail
#

Worked perfectly, thread can be closed, thanks guys

unique summit
#

Glad to hear that worked, we're happy to have been able to assist. Best of luck with the rest of the project!