showPurchasePinOverlay()

    showPurchasePinOverlay()


    Article summary

    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:

    image.png

    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:

    callbackscenariostatusmessage
    successThe user entered a valid pin in the overlaySUCCESSSuccessful Pin Validation
    successThe user has not enabled the purchase pin so no overlay is shownPIN_NOT_REQUIREDPin not required: purchase_pin not enabled
    failureFive consecutive invalid PINs have been entered in the overlay and user will be locked out for 60 minutesLOCKEDMaximum attempts exceeded. Wait minute(s) before retrying
    failureThe user dismissed the overlay without entering a valid PIN.USER_DISMISSED_OVERLAYUser dismissed Pin overlay
    failureThe X1 Platform failed to query Parental Control Info to determine if a PIN has been enabledPARENT_CONTROL_QUERY_ERRORFailed to query Parental Control Info
    failureThe X1 Platform failed to communicate with the associated PIN validation service. This could be a result of a networking error.SERVICE_COMMUNICATION_ERRORFailed to communicate with PinOverlayService
    failureThe X1 Platform failed to launch the PIN overlay due to unexpected system errorsOVERLAY_LAUNCH_ERRORFailed to launch Pin Overlay
    failureOne 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 timeOVERLAY_LAUNCH_ERRORInvalid 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:

    image.png

    If the user enters a pin incorrectly once, they will see the following:

    image.png

    If the user enters a pin incorrectly 5 times in a row, they will see the following:

    image.png


    Was this article helpful?

    What's Next