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. The webhook_notification.kind for OAuth webhooks will be one of the following:

  • Braintree::WebhookNotification::Kind::OAuthAccessRevoked

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.

merchant_id string

The ID of the connected merchant.

oauth_application_client_id 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.

Ruby
Copy
Copied
gateway = Braintree::Gateway.new(
  :environment => :sandbox,
  :merchant_id => "use_your_merchant_id",
  :public_key => "use_your_public_key",
  :private_key => "use_your_private_key",
)

notification = gateway.webhook_notification.parse(
  bt_signature,
  bt_payload,
)

notification.kind
# Braintree::WebhookNotification::Kind::OAuthAccessRevoked

notification.oauth_access_revocation.merchant_id
# "merchant_id"

Still have questions?

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