Closed u01jmg3 closed 5 years ago
Hey @u01jmg3, no problem. In Cashier 10 it's possible to attach multiple payment methods to a customer. You can retrieve the default billing payment method with with the defaultPaymentMethod
method: https://laravel.com/docs/5.8/billing#retrieving-payment-methods
Does that answers your question? Let me know if anything is unclear in the docs/upgrade guide.
What happens if the customer is brand new? My use case is customers paying for a conference who may never have used our site before and may never again. They stop by, register for a conference and then pay. They're then invoiced immediately.
Already came across these in your docs:
$user->paymentMethods(); // null
$user->defaultPaymentMethod(); // null
// dd($request->all());
// "_token" => "Q......................................."
// "stripeToken" => "tok_........................"
// "stripeTokenType" => "card"
// "stripeEmail" => "user@land.com"
(To note I am testing using the Stripe test card details (4242
etc.).)
That's strange because $user->paymentMethods();
should return an exception when you try to access it as a non-Stripe customer.
I'm not sure what you're asking though. Your original example above is the correct one. It's the same thing you had to do with the token based api only now with the payment methods api.
invoiceFor
method to generate an invoice for whatever you want to invoice your customer for. (make sure you handle SCA if you're in the EU)Thanks @driesvints - you've put me on the right track.
@u01jmg3 Did you figure this out?
Hello,
Previously for one off invoice payments I could do:
I see this has changed and from your Charges test you must now call
updateDefaultPaymentMethod()
.What is the recommended way to determine the customer's payment method? Using the request? I see you have hard coded the method
pm_card_visa
in every test.(Apologies if this is more of a question but it came up during my upgrade to
v10
.)