Gift Cards
Encoding and decoding URLs for gift cards
Use gift card codes with care. Anyone who knows the code has full access to the gift card funds.
Encoding Gift-Card Parameters
To create gift-card URL code invoke the following method:
Parameters
giftCard
- a GiftCardProperties object which contains all needed parameters to encode
Returns
Promise
returns Base58-encoded string which can be injected into the redeeming URL
Example
Decoding a Gift-Card Code
Use the following method to retrieve a gift-card from the code or URL containing the code:
Parameters
code
- a gift-card code or URL contained code within the gift-code
query parameter.
Returns
Promise
returns the GiftCardProperties of a decoded card. Errors may return InternalError
.
Example
Last updated