Premium Fraud Management Tools
Webhooks
Once you're set up to receive webhooks, you can collect information from them to create reports based on different triggers. For example, you could collect the information on notifications for:
- Fraud Protection to be notified when a transaction marked for review has been approved or rejected
- Dispute Opened to compare opened disputes with your transactions sales and create a report on your chargeback ratio
- Disbursement to create a funding report
General workflow
- Set up at least one destination URL to receive webhooks from the gateway
- Parse the contents of the webhook notifications
- Create logic to store the details of the
WebhookNotification
objects for a specific kind of trigger
Fraud Protection
When a transaction has been formally reviewed in the Fraud Protection Advanced dashboard, we'll send a TRANSACTION_REVIEWED
webhook containing information that you can use to update your records:
- Ruby
post "/webhooks" do
webhook_notification = gateway.webhook_notification.parse(
request.params["bt_signature"],
request.params["bt_payload"]
)
# Example values for webhook notification properties
puts webhook_notification.kind # "transaction_reviewed"
puts webhook_notification.transaction_review.transaction_id # "123abc"
puts webhook_notification.timestamp # "Sun Jan 1 00:00:00 UTC 2012"
return 200
end
You can use the transaction ID provided in the webhook's payload to make a Transaction.find API call and retrieve additional information if needed:
- Ruby
transaction = gateway.transaction.find("the_transaction_id")
See also
Next Page: Testing and Go Live →