feature/add-client #21

Merged
benoybose merged 30 commits from feature/add-client into dev 2025-04-21 09:19:04 +00:00
Showing only changes of commit 77efd40c86 - Show all commits

View File

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