#Sudarshanan G
1 messages ยท Page 1 of 1 (latest)
Hi ๐ can you elaborate on the problems you're running into?
yeah, What I need is, I need to store card details in stripe and retrieve it later. so that customer can use their stored card to finish payment
but I'm not able to store/retrieve card details
I'm using laravel and react for implementation
I used this line of code to create/retrieve cards. But always it throws source is null error.
create: $customer->sources->create(['source' => $paymentMethod->id]);
retrieve: $customer->sources->data
Are you using Laravel Cashier?
Gotcha, so for new integrations I wouldn't recommend using Sources, they're a more legacy approach and Payment Methods are our recommended replacement for them.
I would recommend following the process shown here for setting up payment methods for future usage:
https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements
You'll also want to list the Customer's Payment Methods instead of their Sources:
https://stripe.com/docs/api/payment_methods/customer_list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
okay thanks I will check