Support the ongoing development of Laravel.io →
Authentication Requests Architecture
Last updated 2 years ago.
0

Understand now I need to create a customer profile on stripe before I can 'update' the subscription.. hmm any ideas on how to create a subscription w/out having them enter in their cc info the very first time?

Edit for clarify: To put this better, any way to create a stripe customer without a card, on the API side of things, I see you can on Stripe's dashboard.

Last updated 2 years ago.
0

Solution was to use Stripe's native API interface (not Cashier) to..

  1. Create a Customer (without a card)
  2. Add a pre-generated coupon (100% off) to the customer's account
  3. Assign a plan to the customer.

No support what so ever in Cashier, hopefully soon.

Last updated 2 years ago.
0

We had a quite similar issue/need, where we wanted to instantly charge, but also store the user for later, and solved it this way:

public function stripeStoreAndCharge($user, $stripeToken) {

    // Needs "use Laravel\Cashier\StripeGateway;"
    $stripe = new StripeGateway($user);

    // Create a Stripe customer, incl. his card data
    $customer = $stripe->createStripeCustomer(
        $stripeToken,
        ['email' => $user->email]
    );

    // Store Stripe ID, etc. in the database.
    $stripe->updateLocalStripeData($customer);

    // Finally we can charge the customer, now and later, as we just stored his details.
    $user->charge(10000, ['currency' => 'php']);
}

You could probably also just use what the stripe/stripe-php package provides, but this here seemed simpler.

I'm just posting this for reference, because I also had a hard time realizing that this case wasn't covered by Cashier. ;)

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Braunson braunson Joined 20 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.