Premium Fraud Management Tools

Webhooks

Availability
Fraud Protection webhooks are only available for merchants using Fraud Protection Advanced. For an overview on available Fraud Tools, see our Support article. If you are using standard Fraud Protection instead of Fraud Protection Advanced, you can skip this step and proceed to our Testing & Go Live Page to complete your integration.

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 workflowAnchorIcon

  • 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 ProtectionAnchorIcon

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:

  1. PHP
if (
    isset($_POST["bt_signature"]) &&
    isset($_POST["bt_payload"])
) {
    $webhookNotification = $gateway->webhookNotification()->parse(
        $_POST["bt_signature"], $_POST["bt_payload"]
    );

    // Example values for webhook notification properties
    $message = $webhookNotification->kind; // "transaction_reviewed"
    $message = $webhookNotification->transactionReview->transactionId; // "123abc"
    $message = $webhookNotification->timestamp->format('D M j G:i:s T Y'); // "Sun Jan 1 00:00:00 UTC 2012"

    file_put_contents("/tmp/webhook.log", $message, FILE_APPEND);

    header("HTTP/1.1 200 OK");
}

Notice how we are using file_put_contents to store the result of the received Webhooks to /tmp/webhooks.log.

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:

  1. PHP
$transaction = $gateway->transaction()->find('the_transaction_id');

See alsoAnchorIcon

If you accept cookies, we’ll use them to improve and customize your experience and enable our partners to show you personalized PayPal ads when you visit other sites. Manage cookies and learn more