New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
支付宝支付相关 #191
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MonkeyKing 对于后台返回了签名字符串进行支付宝支付没有进行相关的文档,只是在【请问支持现在支付宝最新的APP支付吗?】这个问题的回复中找到了相关步骤说明,已成功调起支付,在此贡献一下粗略的代码,给后面集成支付宝支付的朋友节省点时间
// 1、拿到服务端生成的字符串
let dataString = json["data"].stringValue
// 2、拼接成一个json
let json: [String: Any] = ["fromAppUrlScheme":"ap11111111","requestType":"SafePay","dataString":dataString]
// 3、拼接完后,对整个json进行 url encode
let encodeString = json.jsonString()?.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
// 4、最前面加上:alipay://alipayclient/?
let url = URL(string: "alipay://alipayclient/?(encodeString ?? "")")
let order = MonkeyKing.Order.alipay(url: url!)
MonkeyKing.deliver(order) { (result) in
}
The text was updated successfully, but these errors were encountered: