D. Member card
D1. Create a member card
- User clicks to open the member registration page in Merchant Mini Program and fill in the information required to complete the member registration.
- The mini program sends a request to Merchant Backend to create the member card and obtain MemberID
- The mini program displays the member card detail with MemberID once received from Merchant Backend.
- User confirms to push the member card into AlipayHK Card Wallet. The mini program will send a request to Merchant Backend to issue the member card by using MerchantID, OpenID and TemplateID
- Merchant Backend sends a createPass request (alipay.intl.user.pass.createPass) to AlipayHK Backend by using MerchantID, OpenID, TemplateID, BizSerialID (MemberID), start date, end date, and other info such as member privilege and reward points.
- AlipayHK Backend handles the createPass request associated with a PassID, a unique identifier in AlipayHK Backend, for the new member card.
- AlipayHK Backend returns the handling result with the PassID to Merchant Backend.
- Merchant Backend updates its member card record to associate with the PassID from AlipayHK Backend.
- Merchant Backend returns the Pass issue record to the mini program.
D2. Verify a member card
- User opens his/her AlipayHK card wallet and selects a member card. AlipayHK APP will request the card detail by sending a request to AlipayHK Backend with PassID. AlipayHK Backend will return the card detail. Merchant cashiers can use a POS scanner to scan the QR code/barcode from the user's gift card wallet to parse and obtain the BizSerialID (MemberID).
- Alternative approach, a user opens the Merchant Mini Program and displays the member card. The mini program will request the card detail by sending a request to Merchant Backend with BizSerialID (MemberID). Merchant Backend will return the card detail. Merchant cashiers can use a POS scanner to scan the QR code/barcode from the user's mini program to parse and obtain the BizSerialID (MemberID).
- Merchant POS sends a membership verification request to Merchant Backend by using BizSerialID (MemberID) and VerifyCode. Merchant Backend will check the membership validity.
- If the member card is not valid, Merchant Backend will return a failure result to Merchant POS. The POS will fail the message.
- If the member card is valid, Merchant Backend will process the payment transaction with memberID.
- Upon the payment is completed, the Merchant Backend can send a updatePass (alipay.intl.user.pass.updatePass) to AlipayHK Backend to update member privilege and reward points by using MerchantID, PassID, and VerifyCode. Please refer to section B5. Update a member card.
D3. Update a member card
- When member card details including member privilege and reward points are updated, Merchant Backend send a updatePass (alipay.intl.user.pass.updatePass) to AlipayHK Backend to update member card details by using MerchantID, PassID, and VerifyCode. AlipayHK Backend will update the member card record and return the handling result to Merchant Backend. Merchant Backend will commit all changes upon receiving the response from AlipayHK Backend.
D4. Remove a member card
- Merchant Backend initializes a member card update request to update its status to 'closed' by using BizSerialID (MemberID).
- Merchant Backend will send a updatePass (alipay.intl.user.pass.updatePass) request to AlipayHK Backend to update the card status to 'CLOSED' by using MerhcantID, OpenID and PassID. AlipayHK Backend will update to close the member card record and return the handling result to Merchant Backend.