Updated the payment integration to be dynamic

This commit is contained in:
Tiago Ribeiro
2024-05-16 13:30:38 +01:00
parent e13aea9f7d
commit a65b72adad
2 changed files with 2 additions and 2 deletions

View File

@@ -40,7 +40,7 @@ export default function PaymobPayment({user, price, setIsPaymentLoading, currenc
amount: price * 1000,
currency: "OMR",
items: [],
payment_methods: [1540],
payment_methods: [],
customer: {
email: user.email,
first_name: user.name.split(" ")[0],

View File

@@ -41,7 +41,7 @@ async function post(req: NextApiRequest, res: NextApiResponse) {
const response = await axios.post<IntentionResult>(
"https://oman.paymob.com/v1/intention/",
{...intention, payment_methods: [1540], items: []},
{...intention, payment_methods: [parseInt(process.env.PAYMOB_INTEGRATION_ID || "0")], items: []},
{headers: {Authorization: `Token ${process.env.PAYMOB_SECRET_KEY}`}},
);
const intentionResult = response.data;