Card and Coupon Signature Error Troubleshooting Methods

If the developer encounters a signature error when calling the addcard interface, please follow the steps below to troubleshoot the error: 

Step1.  Check whether the signature algorithm is correct. Developers can use Chrome to open the coupon signature debugging tool. Developers can also refer to the signature writing method of coupons in JS-SDK Demo.

See also: Sample code and JS-SDK Demo

 

Step2. Check whether the parameters in CardExt are correct

   - Check whether the card_id of the custom code code does not pass in the code parameter in cardext, or the code parameter is passed in the card in the non-custom code mode, both of which may lead to parameter errors or signature errors;

  - Check whether there is a card_id whose bind_openid is true and the openid parameter is not passed in cardext, or the card_id whose bind_openid is false has the openid parameter passed in, both of which may lead to parameter errors or signature errors;

  - Check whether four parameters A, B, C, and D are passed in in cardext, but three parameters of A, B, C or five parameters of A, B, C, D, and E are used when signing, In this case, there must be a signature error;

 

Step3. Check if the ticket is correct/valid  

   - Check whether the appid of the current ticekt is the appid of the created card_id;

   - Check whether the interface for obtaining the current ticket is correct, and confirm that the type of the obtained ticket is type=wx_card;

   - Check if the ticket is expired/invalid;

 

Common errors and causes of Addcard interface: 

Get page tips wrong reason Modification method

Completed (addcard)

Currently out of stock Call the increase inventory interface to increase inventory

The nonce_Str and timestamp values ​​in the cardext parameter in the addcard interface are duplicated

Ensure that the nonce_Str and timestamp values ​​in the cardext parameter in different requests are repeated
Custom code cannot be delivered in real time When js pulls up the receiving page, the code cannot be delivered in real time

Parameter error (addcard)

The cardext parameter does not match the card_id attribute The developer must first check the card_id details, focusing on whether to use
a custom code, whether to bind openid, and whether it is a custom code imported in code mode .
The code field must be filled in the cardext to participate in the signature;
Pass in the openid field
code is too long or malformed Check whether the code parameter exceeds 20 digits or contains special characters

Signature error (addcard)

Signature algorithm error Use the http://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=cardsign
tool to verify the signature algorithm
ticket error Confirm that the ticket used is the card coupon api_ticket instead of jsapi_ticket
and is within the validity period
Cardext internal parameters do not align with participating signature parameters If the parameters that need to participate in the signature are filled in the cardext, the fields must also be included in the signature in the
signature algorithm
cardext parameter format error cardext itself is a string, not an object. If the format is
incorrect, the iOS system will prompt a signature error

The pull card list is empty
(choosecard)

Signature error The signature field passed in when pulling up the card and coupon list is incorrect, or the parameters involved in the signature
are not aligned with the parameters passed in the interface.
Filter condition error The shopid or card_type is passed in the filter condition, but there is actually no
coupon corresponding to the store or card type

Please read carefully

Official document: https://mp.weixin.qq.com/s/WhYpWmfuhUBw2wseTXdt2A

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325293914&siteId=291194637