Compare commits

..

No commits in common. "77efd40c869de0667e838a64343c9c2509ff371c" and "f5770faf9fa9e705955dccf016f8a89fe7927601" have entirely different histories.

View File

@ -402,14 +402,15 @@ export const createCashfreeOrder = onRequest({
return;
}
const isTest = true;
const hashKey = `hash_${Date.now()}_${uid.substring(0, 1)}_${orderId}`;
let apiUrl = process.env.CASHFREE_URL;
const apiUrl = isTest
? 'https://sandbox.cashfree.com/pg/orders'
: 'https://api.cashfree.com/pg/orders';
try {
const cashfreeResponse = await axios.post(
apiUrl!,
apiUrl,
{
order_id: orderId,
hash_key: hashKey,
@ -505,11 +506,14 @@ export const verifyCashfreePayment = onRequest({
const clientId = process.env.CASHFREE_CLIENT_ID;
const clientSecret = process.env.CASHFREE_CLIENT_SECRET;
const isTest = process.env.CASHFREE_ENVIRONMENT !== 'production';
const apiUrl = process.env.CASHFREE_URL;
const apiUrl = isTest
? `https://sandbox.cashfree.com/pg/orders/${orderId}`
: `https://api.cashfree.com/pg/orders/${orderId}`;
const cashfreeResponse = await axios.get(
apiUrl!,
apiUrl,
{
headers: {
'x-api-version': '2022-09-01',