Our checkout UI includes several configuration options.
We need to add a new configuration option called hooks at the "root" of the config.
This object should include multiple properties, whose key should be the events triggered by the Paywall library:
Then, in the checkout UI we should implement the triggers. They should be triggered at the same time as the Javascript events, as POST requests. The body of the POST request should be a json object matching the payload sent by the events. Any 2XX response should be considered a success. Any other should be considered an error and the paywall should do up to 2 retries (maximum of 3 notifications), after 1 and 3 seconds respectively.
Our checkout UI includes several configuration options. We need to add a new configuration option called
hooks
at the "root" of the config. This object should include multiple properties, whose key should be the events triggered by the Paywall library:Each of the value is a URL.
Then, in the checkout UI we should implement the triggers. They should be triggered at the same time as the Javascript events, as POST requests. The body of the POST request should be a
json
object matching the payload sent by the events. Any 2XX response should be considered a success. Any other should be considered an error and the paywall should do up to 2 retries (maximum of 3 notifications), after 1 and 3 seconds respectively.