#jpmishra1010

1 messages · Page 1 of 1 (latest)

silver canopyBOT
thick plinth
#

Hi there, it means the payment requires customer's action in order to proceed (usually due to 3DS)

steep path
#

After doing this, we are getting this response.

#

Let me share you the details

#

$amount=2;
\Stripe\Stripe::setApiKey(env('STRIPE_SECRET'));
$stripe = new \Stripe\StripeClient(env('STRIPE_SECRET'));
$customer = $stripe->customers->create([
'email' => session()->get('user.email'),
'name' => session()->get('user.username'),
"source"=>$request->stripeToken,

    ]);

   $output= \Stripe\PaymentIntent::create ([
    'payment_method_types'=>['card'],

            "amount" => $amount * 100,
#

// $coupon=Package::find($pac[]);
$package=Package::find($ex);
$amount=$package->international_price;
$amount=2;
\Stripe\Stripe::setApiKey(env('STRIPE_SECRET'));
$stripe = new \Stripe\StripeClient(env('STRIPE_SECRET'));
$customer = $stripe->customers->create([
'email' => session()->get('user.email'),
'name' => session()->get('user.username'),
"source"=>$request->stripeToken,

    ]);

   $output= \Stripe\PaymentIntent::create ([
    'payment_method_types'=>['card'],

            "amount" => $amount * 100,
            "currency" => "inr",
            'customer'=>$customer->id,
            "description" => "Test payment " ,
            'payment_method' => "$card_id",
    ]);


 
   $output2= $stripe->paymentIntents->confirm(
        $output->id
      );

      if($output2->status!='succeeded'){
        return $output2->status;
      }
#

Please check this

thick plinth
#

Just share with me the paymentIntent ID

steep path
#

pi_3Lp3TgSAx1WgSsNQ0Ff7FHmC

thick plinth
#

OK, so the paymentIntent status becomes requires_action after you confirm it from backend. So you need to confirm it from frontend (via stripe.confirmPayment()) to launch the 3DS flow for your customer to authenticate the payment.

steep path
#

So I use 2DS it won't work?

thick plinth
#

I don't know what you mean by 2DS.

steep path
#

Ok I am trying with 3DS, if needed help. Will respond again here.

Thank you for your quick response.