如何为MPGS PAYMENT_LINK模式设置交易失败重定向页面?
解决MPGS PAYMENT_LINK模式下交易失败重定向的配置方法
要实现交易失败后的页面重定向,你需要在请求体的interaction对象中添加failureUrl参数,指定失败场景下的目标跳转地址。
修改后的请求体示例
{ "apiOperation": "INITIATE_CHECKOUT", "checkoutMode": "PAYMENT_LINK", "order": { "amount": 10.00, "currency": "USD", "id": "---", "reference": "---", "description": "---", "custom": { "type": "QR_PAYLINK" } }, "interaction": { "operation": "PURCHASE", "returnUrl": "---", // 交易成功后的重定向地址 "failureUrl": "https://your-failure-redirect-url.com", // 新增:交易失败后的重定向地址 "merchant": { "url": "https://developer.mastercard.com", "name": "Skateboard Shop", "logo":"---" }, "displayControl": { "billingAddress": "HIDE", "customerEmail": "HIDE", "shipping": "HIDE" } }, "transaction": { "reference": "---" }, "paymentLink": { "expiryDateTime": "---", "numberOfAllowedAttempts": "---" } }
参数说明
failureUrl:接收一个有效的HTTP/HTTPS地址,当交易因支付拒绝、处理超时、用户取消等失败场景发生时,网关会自动将用户浏览器重定向到该地址。- 该参数与已有的
returnUrl配对使用,分别处理成功和失败两种交易结果的跳转逻辑。
内容的提问来源于stack exchange,提问作者peehu gandhi
相关产品推荐
相关产品推荐

