Checkout Enablement
This page outlines the importance on how to maintain checkout enablement using XCE
Some partners may wish to prevent the user from continuing through the checkout journey until they have selected an option for XCover protection.
Because XCE is a third party dependency, we do not want to adversely affect the customer checkout journey. To that end, we strongly recommend that partners integrate our widget using the following practices:
Use
onSetpromise in the set signal layer to wait for a response and control the user experience after.If
onSetpromise resolves then we can disable the Checkout Button to wait for users to select an insurance option from the widget.If
onSetpromise catches an error then we shouldn't disable the Checkout Button to avoid affecting the user checkout flow. Note: Any time the request fails you can expectonSetto throw an error so you can catch it and react to it.If the
onSetis never called that means there was an issue loading the script. As long as the Checkout Button is enabled by default this should not cause an issue.
Rejection reasons
When the onSet promise rejects, err.message is one of the following stable codes, and err.cause carries the underlying error for diagnosis:
Code
Meaning
err.cause
XCE_OFFER_REQUEST_FAILED
The offer request failed and nothing was rendered
The underlying error, e.g. the API validation message
XCE_RENDER_FAILED
The offer request succeeded but the element failed to render
The render error
XCE_ONSET_SUPERSEDED
A newer set signal was pushed while this one was still loading; this promise is retired
none
All rejections call for the same action: do not disable the checkout button. The codes and err.cause are diagnostic detail for your logging. For XCE_ONSET_SUPERSEDED, simply ignore that promise; your newer push's onSet carries the current outcome.
Last updated
Was this helpful?

