Laravel Stripe API Error: Unable to accept payments in India due to lack of support
P粉399090746
2023-08-08 12:17:35
<p>I am creating an e-commerce website and want to provide payment gateway through Stripe but I am getting error: "You cannot accept payments using this API as it is no longer supported in India. Please refer to https://stripe. com/docs/payments to learn more about accepting payments." Here, I'm using Laravel as the backend. <br /><br />My controller code is: </p><p><strong></strong></p>
<pre class="brush:php;toolbar:false;">public function stripePost(Request $request)
{
StripeStripe::setApiKey(env('STRIPE_SECRET'));
StripeCharge::create ([
"amount" => 100 * 100,
"currency" => "inr",
"source" => $request->stripeToken,
"description" => "Thankyou "
]);
Session::flash('success', 'Payment successful!');
return back();
}</pre>
<p>I tried changing it</p>
<pre class="brush:php;toolbar:false;">public function stripePost(Request $request)
{
StripeStripe::setApiKey(env('STRIPE_SECRET'));
Stripe::PaymentIntent.create([
"amount" => 100 * 100,
"currency" => "inr",
"source" => $request->stripeToken,
"description" => "Thankyou "
]);
Session::flash('success', 'Payment successful!');
return back();
}</pre>
<p>But still error</p>
Read this article, brothers, you should take care of it
https://wordpress.org/support/topic/stripe-india-not-supported/#:~:text=As part of our collaboration with Stripe directly,,beta. The filter above will add India in.