我已经通过 Firebase 云功能在 UAT 测试模式下实现并集成了 Phonepe 支付网关,但在迁移到 Live 模式时遇到了问题。 这是代码-
exports.Transaction = onCall({maxInstances:10},async(request)=>{
const amount = parseFloat(request.data.amount) * 100;
const eventPayload = {
merchantId: "PGTESTPAYUAT",
merchantTransactionId: "MT7850590068188108",
merchantUserId: "MUID123",
amount: amount,
redirectUrl: "https://ball24.in",
redirectMode: "POST",
callbackUrl: "https://ball24.in",
mobileNumber: "9999999999",
paymentInstrument: {
type: "PAY_PAGE",
},
};
const encodedPayload = Buffer.from(JSON.stringify(eventPayload)).toString("base64");
const saltKey = "099eb0cd-02cf-4e2a-8aca-3e6c6aff0399";
const saltIndex = 1;
const string = encodedPayload + "/pg/v1/pay" + saltKey;
const sha256 = crypto.createHash("sha256").update(string).digest("hex");
const finalXHeader = sha256 + "###" + saltIndex;
const headers = {
"Content-Type": "application/json",
"X-VERIFY": finalXHeader,
};
const phonePayUrl = "https://api-preprod.phonepe.com/apis/pg-sandbox/pg/v1/pay";
const response = await fetch(phonePayUrl, {
method: "POST",
body: JSON.stringify({ request: encodedPayload }),
headers: headers,
});
const data = await response.json();
// const paymentUrl = data.data.instrumentResponse.redirectInfo.url;
return data;
})
现在,一旦我将凭据更改为 Live 凭据,并将主机 url 替换为生产 url - https://api.phonepe.com/apis/hermes 。我收到错误 - 未找到资源。 我应该做什么。在互联网上找不到任何东西。电话支持也忽略邮件。 请有人帮忙
UAT沙箱的代码工作正常。但无法迁移到Live模式。请帮助
所以我也有同样的问题,所以我解决它的方法是使用 python SDK 而不是 SDK Less 方法。效果就像一个魅力。