I am currently developing a website using "next js" as the frontend and "Strapi" as the backend for a simple ecommerce project. The payment gateway being utilized is "Stripe". I have implemented the checkout code in both the frontend and backend, and everything works fine in test mode in "Stripe". However, when I switch to using my real credentials, an error is displayed.
{"error": {
"message": "You cannot accept payments using this API as it is no longer supported in India. Please refer to https://stripe.com/docs/payments for accepting payments.",
"type": "invalid_request_error"}}
I am puzzled as to why it works in the demo but not in the real environment.
Below is the code snippets:
- Strapi Backend
"use strict";
/**
* order controller
*/
const stripe = require("stripe")(
"sk_test_my_test_code_from_stripe"
);
// more code here...
Next.js Frontend
import React,{useState} from 'react'
// more code here...
My package.json
{
"name": "project",
"private": true,
"scripts": {
"dev": "next dev",
// more scripts...
},
"dependencies": {
"@apollo/client": "^3.5.5",
// more dependencies...
},
"devDependencies": {
"eslint": "8.7.0",
// more dev dependencies...
}
}