Implement error handling
Idempotence
Idempotence means that in response to the same requests sent multiple times, AlipayHK should send back only one unique result.
To add a pass: AlipayHK checks the idempotence by using MerchantID, TemplateID and BizSerialID. If existing record is found, errors will be returned.
To redeem/close a pass: AlipayHK checks the idempotence by using OpenID, PassID and status. If pass record is found with status 'Used' or 'Closed', errors will be returned.
Timeout or system error
Because HTTPS requests depend on network stabilities, timeout might occur on interface requests. At the same time, AlipayHK might return SYSTEM_ERROR for internal system problems. In both cases, partners can retry to get aligned with the final pass status.
Returned Result | Description |
PARAM_ILLEGAL | Illegal parameters |
USER_NOT_EXSITS | User does not exist |
PASS_HAS_EXIT | Pass is existed |
PASS_TEMPLATE_HAS_NOT_EXIT | Pass template does not exist |
PASS_TYPE_NOT_MATCH | Pass type does not match to template |
PASS_PRODUCT_TYPE_NOT_MATCH | Pass product type does not match to template |
PASS_IS_NULL | Pass is null |
PASS_HAS_NOT_EXIST | Pass does not exist |
PASS_USED_OCCUPIED | Pass has been redeemed |
PASS_UPDATE_FAIL | Fail to update pass status (Only pass with 'active' status can be updated. |