Use webhooks to notify your application about payment events.
What is a webhook?
BaygelPay uses webhooks to push real-time notifications to you about your payments, subscriptions and refund. All webhooks use HTTPS and deliver a JSON payload that can be used by your application.
You can use webhook feeds to do things like:
Automatically enable access to a user after a successful payment
Automatically remove access to a user after a canceled subscription
Confirm that a payment has been received by the same customer that initiated it.
When you will receive a webhook?
Upon events such as successful payment, payment failure, subscription trial initiation, subscription payment success, or refund issuance, BagelPay will automatically send a webhook event to the registered webhook endpoint.
If your endpoint fails to receive the webhooks successfully, BagelPay will automatically attempt to resend the request 6 times at 60-second intervals.
If your webhook endpoint is interrupted unexpectedly, the webhook events that were not sent successfully will be saved in the message queue. When you reactivate the webhook endpoint, bagelpay will continue to send the historical messages in the message queue to the webhook endpoint url before the modification.
Steps to receive a webhook
You can start receiving real-time events in your app using the steps:
1
Create a endpoint to receive requests
In your local application, create a new roue that can accept POST requests.