gpt4 book ai didi

ios - 使用超链接集成 UPI 后如何获得响应

转载 作者:IT王子 更新时间:2023-10-29 05:44:56 28 4
gpt4 key购买 nike

在我的 iOS 应用程序中,我需要接受用户的付款。我正在使用 UPI。我已遵循 UPI 提供的以下文档

http://www.npci.org.in/documents/UPI-Linking-Specs-ver-1.1_draft.pdf

我已经按照文档中的说明创建了一个深层链接。 UIApplication.shared.open 用于打开深层链接 url,以便它打开我手机中安装的任何 PSP(支付服务提供商)应用程序(如 PhonePe、BHIM 等)

func payButtonClicked() {

guard let urlString = "upi://pay?pa=samplevpa@ybl&pn=Sample Name&am=1&cu=INR".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
else {
return
}

guard let url = URL(string: urlString) else {
return
}

if !UIApplication.shared.canOpenURL(url) {
print("url cannot be opened")
return
}

UIApplication.shared.open(url, options: [:], completionHandler: { (success) in

print(success)

})

}

我已经使用自定义 URL 方案注册了我的应用程序,并在 plist 文件中为 ApplicationQueriesScheme 添加了方案 upi

<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>SampleApp</string>
</array>
<key>CFBundleURLName</key>
<string>com.company.SampleApp</string>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>upi</string>
</array>

它正在打开 PSP 应用程序,我可以进行交易。问题是我无法从 PSP 应用程序获得响应。 UIApplication.shared.open 方法没有回调方法。我需要从 PSP 应用程序获取交易状态并将状态显示给用户。任何帮助表示赞赏

最佳答案

NPCI UPI 链接规范声明支付链接中使用的URL 参数用于信息目的,支付应用程序可以用来向付款人点击链接提供额外信息。

该链接仅应显示商家或调用交易的一方的交易详情。

并不意味着作为回调 URL 或用于完成交易的网络 Hook 。

关于ios - 使用超链接集成 UPI 后如何获得响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46178769/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com