Laravel Stripe API錯誤:由於缺乏支持,無法在印度接受付款
<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>