This article applies to Contextual Commerce. (Looking for Classic Commerce documentation?)
For publishers who want to grant immediate access to content or services based on the results of a Popup Storefront transaction - e.g. taking action on the page immediately following the "popup closed" event - it is important to note that relying on webhooks such as the order.completed browser webhook to obtain data about a completed purchase is not recommended in the interest of security.
For this reason, it is recommended that you use the FastSpring API to validate orders placed via your Popup Storefront, before granting access to content or services.
Here is the recommended process:
- Wait for the order ID to be passed to the callback function.
- Once the order ID has been obtained, make an AJAX request to the server which, in turn, makes a backend-to-backend call to the FastSpring API (/orders endpoint) with the order ID obtained from the popup store.
- Act upon the order based on the response from FastSpring's backend, which can be trusted.