我正在创建一个电子商务网站,希望通过Stripe提供支付网关,但出现了错误:“您无法使用此API接受付款,因为它在印度不再受支持。请参考https://stripe.com/docs/payments以了解有关接受付款的更多信息。”在这里,我使用Laravel作为后端。
我的控制器代码是:
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();
}
我试着改了一下
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();
}
但还是报错
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
看看这个文章兄弟,应该管
https://wordpress.org/support/topic/stripe-india-not-supported/#:~:text=As%20part%20of%20our%20collaboration%20with%20Stripe%20directly%2C,beta.%20The%20filter%20above%20will%20add%20India%20in.