You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何为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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 07:27:08