C. Gift Card
C1. Create a Gift Card
- User clicks to view a gift card detail in Merchant Mini Program.
- The mini program sends a request to Merchant Backend to obtain the gift card detail by using TemplateID
- The mini program displays the gift card detail once received from Merchant Backend
- User confirms to issue the gift card in the mini program.
- The mini program will issue a payment request if purchase is required. please refer to the online payment integration listed below, merchant can choice to use either IPAY or ABOSS approach.
- When user payment is completed, the mini program will send a request to Merchant Backend to issue the gift card by using Merchant ID, OpenID and TemplateID
- Merchant Backend creates the gift card record and is associated with a BizSerialID, it is used to identify the gift card record in their system.
- Merchant Backend sends a createPass request (alipay.intl.user.pass.createPass) to AlipayHK Backend by using MerchantID, OpenID, TemplateID, BizSerialID, start date, end date, and code message.
- AlipayHK Backend handles the createPass request associated with a PassID, an unique identifier in AlipayHK Backend, for the new gift card.
- AlipayHK Backend returns the handling result with the PassID to Merchant Backend.
- Merchant Backend updates its gift card record to associate with the PassID from AlipayHK Backend.
- Merchant Backend returns the Pass issue record to the mini program.
- The mini program displays the issued gift card.
C2. Share a Gift Card
- Pass Sender requests to share a gift card in the Merchant Mini Program. The mini program sends a gift card update request to Merchant Backend to reset the owner and change the status to 'panding to share' by using BizSerialID. Merchant Backend will then send a updatePass (alipay.intl.user.pass.updatePass) request to AlipayHK Backend to close the gift card in Pass Sender's wallet by using MerchantID, OpenID and PassID to update the Gift Card status to 'CLOSED'. AlipayHK Backend responds to the handling result to Merchant Backend. Merchant Backend will commit the gift card updates and return the handling result to the mini program. The mini program will complete the pass sharing request and display the Pass sharing URL to Pass Sender. Pass Sender can further forward the pass sharing URL via any social platform.
- Pass Receiver clicks the pass sharing URL with BizSerialID to open the Merchant Mini Program. IT retrieves the gift card detail by using BizSerialID from Merchant Backend. When Merchant Backend responds the gift card detail, the mini program display to Pass Receiver.
- Pass Receiver confirms the receive the gift card in the mini program. It sends a gift card update request to Merchant Backend by using BizSerialID, OpenID. Merchant Backend sends a createPass (alipay.intl.user.pass.createPass) request to AlipayHK Backend to add the Gift Card to Pass Receiver's Wallet by using MerchantID, OpenID, TemplateID, BizSerialI, start date, end date, and code message. Upon AlipayHK Backend returning the handling result with PassID to Merchant Backend, it will update the gift card record with OpenID, PassID, and status 'available'. After all, Merchant Backend will commit all changes and return the handling result to the mini program.
C3. Redeem a Gift Card
- User opens his/her in-app gift card wallet and selects a gift card. AlipayHK APP will request the gift card detail by sending a request to AlipayHK Backend with PassID. AlipayHK Backend will return the gift 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.
- Alternative approach, a user opens the Merchant Mini Program and selects a gift card. The mini program will request the gift card detail by sending a request to Merchant Backend with BizSerialID. Merchant Backend will return the gift 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.
- Merchant POS sends a gift card redemption request to Merchant Backend by using BizSerial and VerifyCode. Merchant Backend will check the validity of the gift card.
- If the gift card is not valid, Merchant Backend will return a redemption failure result to Merchant POS. The POS will fail the message of the gift card redemption.
- If the gift card is valid, Merchant Backend will udpate the gift card record status to 'used' by using BizSerialID. Afterward, it will send a updatePass (alipay.intl.user.pass.updatePass) to AlipayHK Backend to update gift card status to 'USED' by using MerchantID, PassID and VerifyCode. AlipayHK Backend will update the gift card record and return the handling result to Merchant Backend. Merchant Backend will commit all changes upon receives the response from AlipayHK Backend and return the redemption result to Merchant POS. The POS will display the redemption result and continue to process the sales order.
C4. Closed a Gift Card
- Merchant Backend initializes a gift card update request to update its status to 'closed' by using BizSerialID.
- Merchant Backend will send a updatePass (alipay.intl.user.pass.updatePass) request to AlipayHK Backend to update the gift card status to 'CLOSED' by using MerhcantID, OpenID and PassID. AlipayHK Backend will update to close the gift card record and return the handling result to Merchant Backend.