1. After Payment
Merchant Connect API
  • 版本记录
  • Integration Guide
    • EC Payment
      • Merchant API
        • Overview
        • Payment
        • Payment Methods
        • Response code
        • After Payment
          • Capture
          • Cancel
          • Refund
          • Cancel or Refund
          • Accept Notification
        • Features
          • Account Status Inquiry (ASI)
          • COF
          • Multi-Currency Transaction
          • Recurring
          • Smart Routing
          • Transaction Retry
          • Payout
          • Authentication
            • 3D Secure
            • FIDO Authentication
            • Authentication only
          • Tokenization
            • Gateway Tokenization
            • Create a gateway token
            • Network Tokenization
            • Pay with gateway token
            • Manage token
            • Network Token update notification
            • Card Based Network Token
    • In-store Payment
      • Merchant API (线下卡支付)
        • ZPK
          • ZPK
        • Payment
          • Payment
        • After Payment
          • Capture
          • Cancel
          • Refund
          • Cancel or Refund
          • Accept Notification
  • API Explorer
    • API Rules
  • PaymentMethod
    • PaymentMethod
      POST
    • PaymentMethod
      PUT
    • PaymentMethod
      GET
    • PaymentMethod
      DELETE
  • FXRateInquiry
    • FXRateInquiry
      POST
    • FXRateInquiry
      GET
  • Payment
    • Payment
      POST
    • Payment
      GET
    • Payment
      PUT
  • Payout
    • Payout
    • Payout
  • Capture
    • Capture
    • Capture
  • Cancel
    • Cancel
    • Cancel
  • Refund
    • Refund
    • Refund
  • Cryptogram
    • Cryptogram
    • Cryptogram
  • CancelOrRefund
    • Cancel or Refund
    • Cancel or Refund
  • Notification
    • Notification for PaymentMethod
    • Notification for Payment
    • Notification for Capture
    • Notification for Cancel
    • Notification for Refund
    • Notification for DataSubmission
    • Notification for MPM Static QR Code
    • Notification for Token Status Update
    • Notification for Settlement
    • Notification for Reversal
    • Notification for Cryptogram
    • Notification for Payout
  • HealthCheck
    • HealthCheck
  • ZPK
    • ZPK
  • 附录
    • Result Code
    • Appendix: Payment Method Variant
    • Appendix: Payment Brands
  • Coupon Write-off
    • Coupon Write-off
  • Coupon Reversal
    • Coupon Reversal
  1. After Payment

Cancel or Refund

适用于线上(EC)和线下门店(In-Store)场景。
无论原交易处于何种状态,商户都可以使用该接口关闭交易或退还交易金额。EVO Cloud 会判断交易状态,并自动发起撤销或退款。

发起撤销或退款请求#

步骤 1:发起撤销或退款请求#

当您获取到的支付结果中 payment.status 为 Captured 或 Authorised 时,可以从服务端向 EVO Cloud 以下接口发起 HTTP POST 请求:
/g2/v1/payment/mer/{sid}/cancelOrRefund
对初始支付进行退款,并指定以下参数:
查询参数是否必填说明
merchantTransIDM初始支付的 merchantTransInfo.merchantTransID。
Body 参数是否必填说明
merchantTransInfoM退款交易的参考信息,包括唯一的 merchantTransID,以及表示您发起请求时间的 merchantTransTime。
transAmountO退款的币种和金额。金额必须符合该币种的最小单位规则。
initiatingReasonO您可在该字段中说明发起本次请求的原因。
webhookO接收通知的 URL。传入该参数后,支付成功时将收到 EVO Cloud 的通知。
metadataO您可在请求中自定义的参考信息,会在响应中原样返回。
请求成功时,响应中会包含 cancel 或 refund 对象以及 payment 对象,提供原支付的状态和相关信息。
cancel 或 refund 对象详细说明:
1.
cancel.status 或 refund.status:完成的状态,必填,取值可为 Success、Failed 或 Received。如果 XXX.status 为 Received,您需要再发起一次 HTTP GET 请求获取完成的最终状态(详情请参阅步骤 2),或等待 EVO Cloud 的通知 Webhook。
2.
cancelOrRefund:用于表示该交易已被退款或撤销。

步骤 2:查询撤销或退款结果#

如果 refund.status 或 cancel.status 为 Received,且您未使用通知 Webhook,可以向 EVO Cloud 查询最终结果。
从服务端向 EVO Cloud 以下接口发起 HTTP GET 请求:
/g2/v1/payment/mer/{sid}/cancelOrRefund
并指定以下参数:
查询参数是否必填说明
merchantTransIDM初始撤销或退款交易的 merchantTransInfo.merchantTransID。

异常处理#

向 EVO Cloud 发起 HTTP POST 请求时: 建议请求发送后至少等待 45 秒。如果在该时间内未收到响应,需要向 EVO Cloud 查询结果,请参阅步骤 2 发起请求。
向 EVO Cloud 发起 HTTP GET 请求时: 您可以多次发起请求直至获取结果,建议每次后续请求前至少等待 45 秒。如果多次请求后仍无法获取结果,可以改为重新发起一次 cancelOrRefund 请求。
上一页
Refund
下一页
Accept Notification
Built with