How to I use Laravel Cashier to charge one time payments using Stripe?
Ok, my requirements are super simple - I don't want multiple payment related columns added to my User table and I've no plan to enable recurring payments / subscriptions to the users.
In fact, I'm creating a "guest" checkout page where a person can simply make a purchase without signing up on the site first.
However, with Cashier, I'm finding it really difficult to achieve this simple task. The flow I want to achieve is this -
User (guest or member ) lands on the purchase page
They see purchase options and make the payment.
They are then shown "Thank you" page and an invoice is sent to their email ID.
I'm using Stripe to make the payment. How should I go about this?
@thebigk you don't need Cashier for this, use Stripe API directly:
\Stripe\Stripe::setApiKey('sk_test_1234');
// `source` is obtained with Stripe.js; see https://stripe.com/docs/payments/accept-a-payment-charges#web-create-token
\Stripe\Charge::create([
'amount' => 2000,
'currency' => 'usd',
'source' => 'tok_visa',
'description' => 'My First Test Charge (created for API docs)',
]);