- Print
showPurchasePinOverlay()
- Print
showPurchasePinOverlay()
Present the X1 Platform purchase pin overlay, allowing the X1 Application to leverage that system (including validation of pin and lockout after several failed attempts). The results of the pin challenge are returned back to the application as a JSON object in either the success or failure callback methods.
An example of the purchase pin overlay which will be displayed can be seen below:
Signature:
$badger.showPurchasePinOverlay()
Parameters:
None.
Return Values:
Result will be returned via a success or failure callback with a status together one or more other returned values:
callback | scenario | status | message |
---|---|---|---|
success | The user entered a valid pin in the overlay | SUCCESS | Successful Pin Validation |
success | The user has not enabled the purchase pin so no overlay is shown | PIN_NOT_REQUIRED | Pin not required: purchase_pin not enabled |
failure | Five consecutive invalid PINs have been entered in the overlay and user will be locked out for 60 minutes | LOCKED | Maximum attempts exceeded. Wait minute(s) before retrying |
failure | The user dismissed the overlay without entering a valid PIN. | USER_DISMISSED_OVERLAY | User dismissed Pin overlay |
failure | The X1 Platform failed to query Parental Control Info to determine if a PIN has been enabled | PARENT_CONTROL_QUERY_ERROR | Failed to query Parental Control Info |
failure | The X1 Platform failed to communicate with the associated PIN validation service. This could be a result of a networking error. | SERVICE_COMMUNICATION_ERROR | Failed to communicate with PinOverlayService |
failure | The X1 Platform failed to launch the PIN overlay due to unexpected system errors | OVERLAY_LAUNCH_ERROR | Failed to launch Pin Overlay |
failure | One of the two possible PIN overlays (parental or purchase) are currently displaying and an attempt was made to launch one of them again. Only one PIN overlay is allowed to be displayed at any given time | OVERLAY_LAUNCH_ERROR | Invalid state, a Pin overlay has already been launched |
Usage Example:
When an X1 App calls the method below
var promise = $badger.showPurchasePinOverlay()
The result will be an overlay like below:
If the user enters a pin incorrectly once, they will see the following:
If the user enters a pin incorrectly 5 times in a row, they will see the following: