Link Search Menu Expand Document

Wallet Balance Element

Overview

The Wallet Balance Element shows the Balance value in the specified wallet for a user. For example this can be used to show:

  • the Balance value of a user’s loyalty points
  • the Balance value of a user’s cashback balance

Using the Wallet Balance Element

To include a Wallet Balance Element Element on a webpage do the following:

  • Add the following script tags at the top of the page
<script type="module" src="https://elements.spaaza.com/elem/spaaza-environment.js"></script>
<script type="module" src="https://elements.spaaza.com/elem/spaaza-wallet-balance.js"></script>
  • Add the Environment tag to the contents of the page (below the script tags). Include the Wallet Balance Element within the Environment tag.
<spaaza-environment config="your_config_goes_here">
    <spaaza-wallet-balance id="1234" loading="2"></spaaza-wallet-balance>
    <!-- other Spaaza Elements and HTML goes here  -->
</spaaza-environment>    

Element Properties

The following properties can be passed to the Wallet Balance Element.

Property Description
id (required) The id of the wallet whose mutations for the user you want to show. You can find the id of the wallet in Spaaza Conssole when you view the wallet page.
decimals (optional) The number of decimals to display. The default is 2.
details (optional) If set to true the Balance value will be shown with the title, subtitle and description of the Wallet. These can all be set in Console when you view the Wallet page. The default is false.