Hello I have a webhook response coming from Paystack as shown bellow, I want in a case where “event.type=success” and/or referrer is say “website A” and another route when referrer is “Website B”. I used custom webhooks then added a router for 2 routes based on the referrer but the filter is not working. Please how best can I do the filter.
Thank you.
{
"event": "charge.success",
"data": {
"id": 4869633276,
"domain": "test",
"status": "success",
"reference": "T887606184945302",
"amount": 12000,
"message": null,
"gateway_response": "Successful",
"paid_at": "2025-04-13T11:25:17.000Z",
"created_at": "2025-04-13T11:24:51.000Z",
"channel": "card",
"currency": "NGN",
"ip_address": "13.40.30.197",
"metadata": {
"custom_fields": [
{
"display_name": "Transaction Id",
"variable_name": "67fb9sssssss2081a",
"value": "67fb9sssssss2081a"
},
{
"display_name": "Currency",
"variable_name": "currency",
"value": "NGN"
},
{
"display_name": "Customer Name",
"variable_name": "customerName",
"value": "Jedidiah Onwubiko"
},
{
"display_name": "Order Id",
"variable_name": "orderId",
"value": "67fb9ef50f2d440e9759f992"
},
{
"display_name": "Invoice Id",
"variable_name": "invoiceId",
"value": ""
},
{
"display_name": "Location Id",
"variable_name": "locationId",
"value": "fdgdgdgdgdgdgd"
}
],
"referrer": "https://website-a.com/api/paystack/initiate-payment,https://link.fastpaydirect.com"
},
"fees_breakdown": null,
"log": null,
"fees": 180,
"fees_split": null,
"authorization": {
"authorization_code": "AUTH_7u86ye3shm",
"bin": "408408",
"last4": "4081",
"exp_month": "12",
"exp_year": "2030",
"channel": "card",
"card_type": "visa ",
"bank": "TEST BANK",
"country_code": "NG",
"brand": "visa",
"reusable": true,
"signature": "SIG_Prccccccc5JG9zqZo",
"account_name": null,
"receiver_bank_account_number": null,
"receiver_bank": null
},
"customer": {
"id": 183186583,
"first_name": null,
"last_name": null,
"email": "johndoe@gmail.com",
"customer_code": "CUS_htsluzfy3xfxk9n",
"phone": null,
"metadata": null,
"risk_action": "default",
"international_format_phone": null
},
"plan": {},
"subaccount": {},
"split": {},
"order_id": null,
"paidAt": "2025-04-13T11:25:17.000Z",
"requested_amount": 12000,
"pos_transaction_data": null,
"source": {
"type": "web",
"source": "checkout",
"entry_point": "request_inline",
"identifier": null
}
}
}