Cashier 10.0 has migrated from the Sources and Tokens API to the recommended Stripe Payment Methods API.
Transitioning from Sources/Tokens
While the Payment Methods API is backwards compatible, you should update your integration as soon as possible. If a user does not have a Laravel\/Cashier\/PaymentMethod attached, defaultPaymentMethod() may return an instance of Stripe\Card or Stripe\BankAccount instead. You should handle this to migrate them to the new API:
use Stripe\Card as StripeCard;
use Stripe\BankAccount as StripeBankAccount;
$defaultPaymentMethod = $user->defaultPaymentMethod();
if ($defaultPaymentMethod instanceof StripeCard ||
$defaultPaymentMethod instanceof StripeBankAccount) {
// Gather payment method and store it using new payment method APIs...
}
Single Charges
The charge method no longer accepts a token. It now requires a payment method identifier as the second parameter:
$user->charge(1000, $paymentMethod);