#manal_37518

1 messages · Page 1 of 1 (latest)

red templeBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

copper cargo
#

Hi there!

#

if you use PaymentIntent, you don't need to use a customer.

acoustic elbow
#

The issue i m having is that it is creating a customer on page load so even the client doesnt submit button it shows dta on stripe dashboard

#

payment controller that redirects to payment page ( public function create(PaymentCreateType $request): Factory|View
{
$stripe = new StripeClient(config('services.stripe.secret'));

    $customer = $stripe->customers->create([]);

    $paymentIntent = $stripe->paymentIntents->create([
        'customer' => $customer->id,
        'setup_future_usage' => 'off_session',
        'amount' => 390,
        'currency' => config('services.stripe.currency'),
        'automatic_payment_methods' => [
            'enabled' => 'true',
        ],
    ]);

    return view('front.pages.payments.'. $request->type, [
        'guest' => Session::getGuest(),
        'paymentIntent' => $paymentIntent
    ]);
}

)

copper cargo
#

well like I said you don't need a customer at all when using PaymentIntent

#

oh wait, you are using setup_future_usage, so having a customer does make sense

#

two things:

  • Stripe doens't have limits in the number of customer you can have. so it's okay to have many customers.
  • If you really don't want this, you could use our new deferred payment flow: https://stripe.com/docs/payments/accept-a-payment-deferred, where you create the PaymentIntent after the user has entered their payment information
acoustic elbow
#

great thank you

#

can i use the same way and just update the script so it will be used after submit

#

is that possible ?

copper cargo
#

the default integration: first create the PaymentIntent, and then use that to show the Payment Element (I belive that's what you are using)
the deferred integration: first show the Payment Element, and then later create the PaymentIntent

#

you have to chose which one you want

acoustic elbow
#

all i want is to shoiw form but not send anything until client submits the form

copper cargo
acoustic elbow
#

thank you