React-Native Phonepe SDK用于PhonePe集成,如果我将SDK的base64响应和shasha 256哈希密钥传递给PhonePe自定义UPI Open Intent,它总是给出{“error”:“Transaction Interrupted!",“status”:“FAILURE”}错误,但如果尝试标准 checkout (要求用户输入UPI ID和付款请求)一切正常。用于测试自定义up intent API文档的测试凭据我尝试在API中传递相同的值它工作正常它返回重定向URL但在sdk中它抛出错误
app.js
import PhonePePaymentSDK from 'react-native-phonepe-pg';
PhonePePaymentSDK.init(
"UAT",
"PGTESTPAYUAT",
"F4:1E:2F:64:BA:E6:19:1A:A7:C2:29:6D:5F:5D:2F:0A:29:E8:6E:5B",
true
).then(result => {
console.log("sdk intitialisation successfull", result);
// setMessage("Message: SDK Initialisation ->" + JSON.stringify(result));
}).catch(error => {
setMessage("error:" + error.message);
})
PhonePePaymentSDK.startPGTransaction( "ewogICJtZXJjaGFudElkIjogIlBHVEVTVFBBWVVBVCIsCiAgIm1lcmNoYW50VHJhbnNhY3Rpb25JZCI6ICJ0cmFuc2FjdGlvbl8xMjMiLAogICJtZXJjaGFudFVzZXJJZCI6ICI5MDIyMzI1MCIsCiAgImFtb3VudCI6IDEwMDAsCiAgIm1vYmlsZU51bWJlciI6ICI5OTk5OTk5OTk5IiwKICAiY2FsbGJhY2tVcmwiOiAiaHR0cHM6Ly93ZWJob29rLnNpdGUvY2FsbGJhY2stdXJsIiwKICAicGF5bWVudEluc3RydW1lbnQiOiB7CiAgICAidHlwZSI6ICJVUElfSU5URU5UIiwKICAgICJ0YXJnZXRBcHAiOiAiY29tLnBob25lcGUuYXBwIgogIH0sCiAgImRldmljZUNvbnRleHQiOiB7CiAgICAiZGV2aWNlT1MiOiAiQU5EUk9JRCIKICB9Cn0=", //base64 string
"2b5b25e756441323391dd1612810c59f021463bb0082cdf5fe18c9a6f1a5dc21###1",//check sum value
"/pg/v1/pay",
{ 'Content-Type': 'application/json' },
"com.phonepe.app",
"https://webhook.site/callback-url"
).then(a => {
console.log("tracsaction res", a);
}).catch(error => {
console.log("trsaction api error", error);
})
字符串
响应对象示例响应对象
{
"merchantId": "PGTESTPAYUAT",
"merchantTransactionId": "transaction_123",
"merchantUserId": "90223250",
"amount": 1000,
"mobileNumber": "9999999999",
"callbackUrl": "https://webhook.site/callback-url",
"paymentInstrument": {
"type": "UPI_INTENT",
"targetApp": "com.phonepe.app"
},
"deviceContext": {
"deviceOS": "ANDROID"
}
}
型
试验新月
2条答案
按热度按时间gab6jxml1#
我使用世博会的应用程序,所以不能使用phonepe-sdk,这就是为什么我试图使网页支付网关React,然后我会重定向用户到网页通过
<WebView />
但问题是,我试图使用Paytm使网关,我卡住了一个多星期的错误解决,无法解决,所以现在尝试使用Phonepe。如果这不起作用,那么最后一个选择将是Google Pay -这看起来很容易集成,但需要更多的步骤,如验证。sbtkgmzw2#
您可以使用此软件包
react-native-phonepesdk
代替。