Skip to content

扣款结果通知

  • Endpoint: POST /subscriptionPaymentResultNotifyUrl
  • Tags: 收单/订阅计划管理

Description

当订阅计划激活后,PayerMax会按照商户创建订阅计划时指定的扣款周期进行扣款,每一期扣款成功后,都会通知商户扣款结果;当某期扣款失败后,PayerMax将会进行重试,并会在扣款重试后发送扣款结果通知。

Parameters

FieldInTypeRequiredConstraintsDescription
Content-TypeheaderstringYes
signheaderstringYes签名信息请参考技术文档

Parameter Examples

  • Content-Type: "application/json"
  • sign: "FPFVT3o227JrFRbqu19boZCpVVTF9KznxyRawUmxpfXilHV/0yK46haPhAjNu1hPUMy7Vw/ILXhfzffNm4Fj0apWknlTY9OJxnSoQxS9BTFtc61tn5yV1q69x/kkBl82/qwg+XTJ4fOzy7Mar3VaC1E2PlDA6RkkKBUyNE6RYgsdB+Su7an4+4HVTNAnoe74WyvBgxTLMNg28igBTdqxaO3w/UBY6ObVp7vkqkQGdL1Y+HgmMYaAVwrM3+ALWGId0sJ+YqTY4WJ+0xCRGhaSnybiIjZsQEYyID68WNUfuavDLDsEhaMm/HfQvf5p0R1Ltovp3wwJnEbQcjY458iX5A=="

Request Body

Content-Type: application/json

FieldTypeRequiredConstraintsDescriptionEnum
codestringYesmaxLength: 32返回码。
msgstringYesmaxLength: 256返回描述。
keyVersionstringYesmaxLength: 8密钥版本。当前值为:1
appIdstringYesmaxLength: 64商户app id
merchantNostringNomaxLength: 32商户Id
notifyTimestringYesmaxLength: 32通知时间,符合rfc3339规范,格式:yyyy-MM-dd'T'HH:mm:ss.SSSXXX
notifyTypestringYesmaxLength: 32通知类型:SUBSCRIPTION_PAYMENT
dataobjectYes
data.subscriptionRequestIdstringYesmaxLength: 64商户创建订阅计划的单号。
data.userIdstringYesmaxLength: 64用户ID。
data.subscriptionPlanobjectYes订阅计划
data.subscriptionPlan.subscriptionNostringYesmaxLength: 64PMMAX订阅计划号。
data.subscriptionPaymentDetailobjectYes扣款详情。
data.subscriptionPaymentDetail.subscriptionIndexnumberYes扣款期数。
data.subscriptionPaymentDetail.paymentStatusstringYesmaxLength: 32本期订单状态。 PENDING:支付中 SUCCESS:支付成功 FAILED:支付失败
data.subscriptionPaymentDetail.periodStartTimestringYes本期开始时间。如:2025-01-13T15:59:59+0000
data.subscriptionPaymentDetail.periodEndTimestringYes本期结束时间,如:2025-02-13T15:59:59+0000。
data.subscriptionPaymentDetail.payAmountobjectYes支付金额。
data.subscriptionPaymentDetail.payAmount.amountnumberNo金额。
data.subscriptionPaymentDetail.payAmount.currencystringNomaxLength: 3币种。
data.subscriptionPaymentDetail.paymentMethodTypestringYesmaxLength: 64支付方式。
data.subscriptionPaymentDetail.cardOrgstringYesmaxLength: 64卡组。
data.subscriptionPaymentDetail.lastPaymentInfoobjectYes本期最新一次支付详情。
data.subscriptionPaymentDetail.lastPaymentInfo.lastPaymentStatusstringYesmaxLength: 32支付结果。 PENDING:支付中 SUCCESS:支付成功 FAILED:支付失败
data.subscriptionPaymentDetail.lastPaymentInfo.payTimestringYes支付时间,如:2025-01-12T15:59:59+0000。
data.subscriptionPaymentDetail.lastPaymentInfo.tradeTokenstringNomaxLength: 64支付单号,可用于退款。 注:成功时必有该值。
data.subscriptionPaymentDetail.lastPaymentInfo.errorCodestringNomaxLength: 64扣款失败code。
data.subscriptionPaymentDetail.lastPaymentInfo.errorMsgstringNomaxLength: 512扣款失败msg。
data.subscriptionPaymentDetail.cardInfoobjectNo卡信息
data.subscriptionPaymentDetail.cardInfo.cardOrgstringNomaxLength: 32卡组织,当paymentMethodType为CARD时返回,只有交易成功且用户选择卡组织支付时才返回
data.subscriptionPaymentDetail.cardInfo.countrystringNomaxLength: 2发卡国家
data.subscriptionPaymentDetail.cardInfo.cardTypestringNomaxLength: 32卡类型,DEBIT、CREDIT等。
data.subscriptionPaymentDetail.cardInfo.totalCardOrgarray[string]No卡的所有卡组织,双标卡会返回两个。
data.subscriptionPaymentDetail.cardInfo.typestringNomaxLength: 32卡性质。PAN为真实卡;NETWORK_TOKEN为虚拟卡,如APPLEPAY。
data.subscriptionPaymentDetail.cardInfo.sourcestringNomaxLength: 32卡信息来源。CARD、APPLEPAYGOOGLEPAY_PANGOOGLEPAY_CRYPTOGRAMNETWORK_TOKEN
data.subscriptionPaymentDetail.cardInfo.cardBinNostringNomaxLength: 16卡bin号。
data.subscriptionPaymentDetail.cardInfo.cardNumberstringNomaxLength: 32卡号,掩码返回。
data.subscriptionPaymentDetail.cardInfo.cardHolderNamestringNomaxLength: 128持卡人姓名,掩码返回。
data.subscriptionPaymentDetail.cardInfo.cardLast4stringNomaxLength: 4真实卡号后四位。
data.subscriptionPaymentDetail.cardInfo.cardExpirationYearstringNomaxLength: 2卡有效年。
data.subscriptionPaymentDetail.cardInfo.cardExpirationMonthstringNomaxLength: 2卡有效月。

Example: 1

扣款成功

json
{
  "code": "APPLY_SUCCESS",
  "msg": "",
  "keyVersion": "1",
  "appId": "3b242b56a8b64274bcc37dac281120e3",
  "merchantNo": "020213827212251",
  "notifyTime": "2022-01-17T09:33:54.540+00:00",
  "notifyType": "SUBSCRIPTION_PAYMENT",
  "data": {
    "subscriptionRequestId": "testRequestId0001",
    "userId": "testUserId0001",
    "subscriptionPlan": {
      "subscriptionNo": "SUB20250417120949065211234"
    },
    "subscriptionPaymentDetail": {
      "subscriptionIndex": 0,
      "paymentStatus": "SUCCESS",
      "periodStartTime": "2025-01-13T15:59:59+0000",
      "periodEndTime": "2025-02-13T15:59:59+0000",
      "payAmount": {
        "amount": 128.39,
        "currency": "USD"
      },
      "paymentMethodType": "CARD",
      "cardOrg": "VISA",
      "lastPaymentInfo": {
        "tradeToken": "T20250417174800970112345",
        "lastPaymentStatus": "SUCCESS",
        "payTime": "2025-01-12T15:59:59+0000"
      }
    }
  }
}

Example: 2

扣款失败

json
{
  "code": "APPLY_SUCCESS",
  "msg": "",
  "keyVersion": "1",
  "appId": "3b242b56a8b64274bcc37dac281120e3",
  "merchantNo": "020213827212251",
  "notifyTime": "2022-01-17T09:33:54.540+00:00",
  "notifyType": "SUBSCRIPTION_PAYMENT",
  "data": {
    "subscriptionRequestId": "testRequestId0001",
    "userId": "testUserId0001",
    "subscriptionPlan": {
      "subscriptionNo": "SUB20250417120949065211234"
    },
    "subscriptionPaymentDetail": {
      "subscriptionIndex": 0,
      "paymentStatus": "PENDING",
      "periodStartTime": "2025-01-13T15:59:59+0000",
      "periodEndTime": "2025-02-13T15:59:59+0000",
      "payAmount": {
        "amount": 128.39,
        "currency": "USD"
      },
      "paymentMethodType": "CARD",
      "cardOrg": "VISA",
      "lastPaymentInfo": {
        "tradeToken": "T20250417174800970112345",
        "lastPaymentStatus": "FAILED",
        "payTime": "2025-01-12T15:59:59+0000",
        "errorCode": "BALANCE_INSUFFICIENT",
        "errorMsg": "Insufficient balance to pay, please confirm payment account available balance."
      }
    }
  }
}

Responses

200

FieldTypeRequiredConstraintsDescriptionEnum
codestringYes仅可响应 ‘SUCCESS’(仅代表成功收到通知,不代表订单状态)
msgstringYes响应 ‘Success’(仅代表成功收到通知,不代表订单状态)

Response Example

json
{
  "msg": "Success",
  "code": "SUCCESS"
}

此页面的内容有帮助吗?

感谢您帮助改进 PayerMax 产品文档!

Released under the MIT License.