Laravel Stripe API错误:由于缺乏支持,无法在印度接受付款
P粉399090746
2023-08-08 12:17:35
<p>我正在创建一个电子商务网站,希望通过Stripe提供支付网关,但出现了错误:“您无法使用此API接受付款,因为它在印度不再受支持。请参考https://stripe.com/docs/payments以了解有关接受付款的更多信息。”在这里,我使用Laravel作为后端。<br /><br />我的控制器代码是:</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>我试着改了一下</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>但还是报错</p>
看看这个文章兄弟,应该管
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.