availability

OAuth is in closed beta in production, and open beta in sandbox. To express interest in the production beta release, contact our Business Development team.

Notification kinds

The notification kind, returned by calling kind on the notification object, reveals what triggered the webhook. For a OAuth webhook, $webhookNotification->kind will be one of the following:

  • Braintree_WebhookNotification::OAUTH_ACCESS_REVOKED

The following table describes the conditions that trigger each kind of webhook.

Notification Type Description
oauth_access_revocation

A connected merchant has revoked API access.

Attributes

kind enum

The kind of webhook notification.

timestamp date

The UTC date/time at which the webhook was triggered.

merchantId string

The ID of the connected merchant.

oauthApplicationClientId string

The OAuth application client ID.

OAuth access revoked

Below is a full example of how to trigger a webhook when a connected merchant has revoked access to their account.

PHP
Copy
Copied
$gateway = new Braintree_Gateway([
    'environment' => 'sandbox'
    'merchantId' => 'use_your_merchant_id',
    'publicKey' => 'use_your_public_key',
    'privateKey' => 'use_your_private_key'
]);

$notification = $gateway->webhookNotification()->parse(
    $btSignature,
    $btPayload
);

$notification->kind;
// Braintree_WebhookNotification::OAUTH_ACCESS_REVOKED

$notification->oauthAccessRevocation->merchantId;
// "merchant_id"

Still have questions?

If you can’t find an answer, contact our Support team