Reputation: 8726
I'm trying to charge a customer's specific credit card using laravel.
I've tried this:
$charge = Charge::create([
'amount' => $amount*100,
'currency' => $currency,
'card' => $stripe_card,
'customer' => $customer_id
]);
But the payment is went through even though the card id $stripe_card
was null. How can this happen? Is it taking the customer's default card?
Upvotes: 0
Views: 111
Reputation: 4648
If $stripe_card
was null, the Stripe API Library would not have sent the card property as part of the API call. If you do not specify a card id for the customer, the default card would be charged.
Upvotes: 2