Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

extjac's avatar

Stripe connect & payment Intents

I am using stripe connect and I implemented stripe charge

$charge = $stripe->charges->create([
                'source' => $stripeToken, 
                'amount' => $amount,
                "application_fee_amount" => $application_fee_amount, 
                'currency' => 'usd',
],  ['stripe_account' => $customerAccount ]);
if( $charge->status == 'succeeded' )
{
//Insert payment into the payment tabe
// send recipt
//etc/
}

but after having a call with Stripe team they asked to migrate to Stripe Payment Intent.

$stripe->paymentIntents->create([
                'amount' => $amount,
                "application_fee_amount" => $application_fee_amount, 
                'currency' => 'usd',
 'automatic_payment_methods' => [ 'enabled' => true ],
],  ['stripe_account' => $customerAccount ]);

I have been testing payment intent and one of the things I dont see is the server side payment confirmation. It seems that the payment intent only comes with client confirmation.

I was wondering if you have have implemented Stripe paymentIntents without cashier successfully and with server side payment confirmation.

0 likes
10 replies
click's avatar

what do you mean with "server side payment confirmation"? That your app receives a confirmation that the payment was completed? Or that your app send a message to Stripe to "confirm" the payment?

Stripe has really good documentation available. The payment intent in combination with their payment elements are working really well. The benefit is that your server is not handling any card details as the client enters the card information in an iframe of Stripe. This is a great security benefit.

Payment Intents explained: https://stripe.com/docs/payments/intents and their javascript payment elements: https://stripe.com/docs/payments/payment-element

extjac's avatar

@click for example, with stripe charge you can get the "success" response right away, and then have logic.

$charge = $stripe->charges->create();
if( $charge->status == 'succeeded' )
{
//logic
}

However, with paymentIntents you have the success URL redirect. But it is just a get request.

    const {error} = await stripe.confirmPayment({
        elements,
            confirmParams: {
            return_url: '{{ url("/success")  }}',
        },
    });
martinbean's avatar

@extjac PaymentIntents are asynchronous. You start the payment process from the client side. The user completes the payment (as they may have to confirm the payment with their bank or card issuer). You then receive a webhook once a PaymentIntent has succeeded. This is so your application still processes the payment even if the user leaves your website. Otherwise you may charge the user but not fulfil their order, and then have a very angry customer.

extjac's avatar

@martinbean i get the webbooks. The issue I am having with the webbook approach, is that my SaaS App is multi-tenant and each tenant has its own DB, own URL, etc. So the way i see it is that i would need to add an endpoint for each tenant. However, with stripe->charge() i get the payment response on the backend and i dont need to worry about the webhooks. any suggestions are welcome.

martinbean's avatar

@extjac It might help if you explain what it is you’re actually trying to capture a payment for.

extjac's avatar

@martinbean let's just say that people will register for an event and they will pay the event in full or just a deposit. The will pay in different currencies such as USD, CAD, EUR, SEK, and many other.

Currently, I use $stripe->charge->create() to capture if the payment was successful; then, I will insert the payment details into the payments table so customers can see their balance.

short example:

$charge = $stripe->charges->create(['amount'=>100, 'currency'=>'usd']);

if( $charge->status == 'succeeded' )
{
//logic
}

With paymentIntents, I think I am losing the ability to get the response in the backend (controller) if the payment was successful without the need of a webhooks.

With paymentIntents Stripe will give you the option to redirect/add a URL if the was "successful". But it is not secure (i think) to read from there.

    const {error} = await stripe.confirmPayment({
        elements,
            confirmParams: {
            return_url: '{{ url("/success")  }}',
        },
    });

Again, the main issue i am having with payment Intents is that i would need to add a webhook endpoint for each customer URL.

So i was wondering if there is a better way to do it.

extjac's avatar

@martinbean each customer has its own instance of the App. with its own DB. Instead of using one DB for all customers like a "traditional" multi-tenant I am using a DB for each customers.

martinbean's avatar

@extjac Surely you should be using Stripe Connect so each tenant can connect their own Stripe account?

extjac's avatar

@martinbean Yes. Actually, thanks to you I started using it some time ago because you told me. It works ok with $stripe->charge->create(). And its cool because i dont need webhooks.

But now with paymentIntent it seems I would need to add webhooks for each customer or develop something that can listen to all payments notifications from all customers/websites and do something after.

That's why i was asking if there was a way to finalize payments on the server without using webhooks; like $stripe->charge->create()

Please or to participate in this conversation.