Implementing error handling

1. Idempotence

Idempotence means that in response to the same requests sent multiple times, AlipayHK will send back only one unique result.

To create a membership card: AlipayHK checks the idempotence by using merchantId, templateCode and bizSerialId. If existing record is found, errors will be returned.

To update a membership card: AlipayHK checks the idempotence by using merchantId, templateCode and passId. If existing record is found, errors will be returned.

2. 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.