I have a stripe customer already added, I am figuring out to add new card to customer. I searched around but couldn't found anything confirmed to asnwer my following questions.
- Do stripe have any form of their own to add new card ?
Is following is the correct way to add new card ?
$customer = \Stripe\Customer::retrieve(Auth::user()->stripe_key); // Got the customer details successfully from the above call. $card = $customer->cards->create( array( "card" => array( "number"=> "4242424242424242", "exp_month" => "12", "exp_year" => "2016", "cvc" => "123" ) ) );
Stripe does not have a direct form specifically for adding a new card to a customer, however you can use Checkout or Elements to collect the customer's card details.
The process for adding a new card to a customer would be as follows:
[0] - https://stripe.com/docs/checkout or https://stripe.com/docs/stripe-js/elements/quickstart
[1] - https://stripe.com/docs/api/php#create_card