#iwynos-adi_code
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1239547941220253782
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
I am done with saving users credit card details via this https://docs.stripe.com/payments/save-and-reuse
now when everthing is done
i want to charge customer on certtain actions performed by them
yep, have you read the link I shared above? it explains exactly how to do this.
I got it
can you get this thread active for few more minutes and i will try to work on by checking the link you hsared
sure
$stripe = new \Stripe\StripeClient(env('STRIPE_SECRET'));
try {
$stripe->PaymentIntent::create([
'amount' => 1099,
'currency' => 'usd',
// In the latest version of the API, specifying the automatic_payment_methods parameter is optional because Stripe enables its functionality by default.
'automatic_payment_methods' => ['enabled' => true],
'customer' => Auth::user()->stripe_custid,
'payment_method' => 'pm_1PFxeRLIKqu5TqiyeNZw4Kav',
'return_url' => 'https://example.com/order/123/complete',
'off_session' => true,
'confirm' => true,
]);
} catch (\Stripe\Exception\CardException $e) {
// Error code will be authentication_required if authentication is needed
echo 'Error code is:' . $e->getError()->code;
$payment_intent_id = $e->getError()->payment_intent->id;
$payment_intent = \Stripe\PaymentIntent::retrieve($payment_intent_id);
}
});
this is my code
this is tthe error Undefined property: Stripe\Service\CoreServiceFactory::$PaymentIntent
what language is this? PHP?