#iwynos-adi_code

1 messages ¡ Page 1 of 1 (latest)

light stratusBOT
#

👋 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.

peak kindle
#

hi there!

silk terrace
#

now when everthing is done
i want to charge customer on certtain actions performed by them

peak kindle
#

yep, have you read the link I shared above? it explains exactly how to do this.

silk terrace
#

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

peak kindle
#

sure

silk terrace
#

$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

peak kindle
#

what language is this? PHP?

silk terrace
#

done its working

#

thankyou for your help