notify removePaymentMethod
DWS uses this API to send the unbinding result to the merchant asynchronously. With this API call, the needed information is stored in JSON.
Note:
- The merchant must provide their URL for DWS to notify, and furthermore, DWS only notifies the successful result.
Structure
A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:
Note: Set the data type of each field (except array) as String. This means that you must use double quotation marks (" ") to enclose the field value. Examples:
- If the data type of a field is Integer and its value is 20, set it as "20".
- If the data type of a field is Boolean and its value is
true
, set it as "true".
Request parameters
Field | Data type | Required | Description | Examples |
referenceCustomerId | String | Yes | Customer ID in the merchant system. More information about this field:
| "216610000006358131449" |
requestId | String | Yes | The unique ID that is assigned by a merchant to identify a payment method adding request. DWS uses this field for idempotence control. More information about this field:
Note: This field is an API idempotency field. | "2015032412007101547201355678" |
paymentMethodDetail | Yes | The details of this payment method. | { "paymentMethodDetailType":"card", "card": { "cardToken": "85246e15131d44feb36c80e1a1e39" } } | |
operateSource | String | Yes | Operate source. Valid values are:
More information about this field:
| "MERCHANT" |
Response parameters
Field | Data type | Required | Description | Examples |
result | Yes | The request result, which contains information such as status and error codes. | / |
Result processing logic
The notify.removePaymentMethod interface cannot accept the failure that is caused by business reasons. If the processing fails due to some business reasons, the merchant must first accept the notification and return SUCCESS
to DWS.
In the response, the result.resultStatus field indicates the result of the notify.removePaymentMethod request. The following table describes each result status:
Result status | Description |
S | The notify.removePaymentMethod request is accepted successfully. The corresponding result.resultCode is |
U | The status of the notify.removePaymentMethod request is unknown. The corresponding result.resultCode is |
F | The notify.removePaymentMethod request failed. The corresponding result.resultCode and result.resultMessage may vary based on different situations. For details, see the following Error codes section. |
Error codes
Result code | Result status | Result message | Further action |
SUCCESS | S | Success | / |
PROCESS_FAIL | F | A general business failure occurred. Don't retry. | Human intervention is usually needed. It is recommended that you contact the technical support team to troubleshoot the issue. |
PARAM_ILLEGAL | F | Illegal parameters. For example, non-numeric input, invalid date. | Check and verify whether the request fields, including the header fields and body fields, are correct and valid. For details on the fields of each API, see the specific API Structure section. |
UNKNOWN_EXCEPTION | U | API failed due to unknown reasons. | Call the interface again to resolve the issue. If the issue persists, contact Alipay Technical Support. |
REPEAT_REQ_INCONSISTENT | F | Repeat request inconsistent. | Ensure the fields in the requests are the same. |
INVALID_SIGNATURE | F | Signature is invalid. | Check whether the private key used to sign a request matches the public key of Alipay Developer Center. |
ACCESS_DENIED | F | Access denied. | Contact Alipay Technical Support for detailed reasons. |
Samples
Request:
DWS sends the unbinding result notification to the merchant.
{
"referenceCustomerId": "216610000006358131449",
"requestId": "2015032412007101547201355678",
"operateSource": "MERCHANT",
"paymentMethodDetail": {
"paymentMethodDetailType":"card",
"card": {
"cardToken": "85246e15131d44feb36c80e1a1e39"
}
}
}
Response:
The merchant returns an acknowledged receipt to DWS.
{
"result":{
"resultStatus":"S",
"resultCode":"SUCCESS",
"resultMsg":"success"
}
}