Routes
Webhooks
Introduction
This Page provides an overview of the routes defined for the Webhooks purpose endpoints in the Toolstation E-Comm Api.
List of Routes for Webhooks
/webhooks/_ping/webhooks/braintree
GET: webhooks/_ping
- Method:
GET - Controller:
PingController - Description: Endpoint to check if the Payments is valid and running successfully. This is a common endpoint for health checks or status pings.
POST: webhooks/braintree
- Method:
POST - Controller:
PaymentWebHookController - Request:
HandleBraintreeWebhookRequest - Description: Endpoint to handle Braintree webhooks.
this __invoke function is responsible for handling Braintree webhook notifications and processing payments. It checks the validity of the payment, retrieves the relevant data, and creates a new order if necessary. It also logs various messages to track the progress of the payment processing and returns a 200 OK response if the payment is successful.
public function __invoke(HandleBraintreeWebhookRequest $request): JsonResponse|Response
{
// Function implementation goes here
}
Request Parameters for /webhooks/braintree:
- Header :-
Accept-Language:- en-UK,en bt_signature: The signature of the webhook notification (string, required).bt_payload: The payload of the webhook notification (string, required).
Response
Response Code: 200 OK
Response:
OK
- Error Response:-
Status:422 Unknown"error": { "code": "422.99", "message": "Unprocessable Entity", "info": "https://developers.example.com", "data": { "message": "The given data was invalid.", "errors": { "bt_payload": [ "The bt payload field is required." ] } } }