我正在創建一個電子商務網站,希望透過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(); }
但還是報錯
看看這篇文章兄弟,應該管
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.