Confirming Sub-merchant Onboarding
Availability
If you're a new merchant looking for a marketplace solution,
contact our Sales team.
Note
The
{{ formatVariable "bt_signature" serverSdk.name }} and
{{ formatVariable "bt_payload" serverSdk.name }} variables in the code snippets below
represent parameters received from the webhook POST request. For more information, read the
documentation on parsing webhooks.
Sub-merchant approved
Once you have webhooks configured, you can listen for a
SubMerchantAccountApproved webhook that looks like this:
- PHP
$notification = $gateway->webhookNotification()->parse($btSignature, $btPayload);
$notification->kind == Braintree\WebhookNotification::SUB_MERCHANT_ACCOUNT_APPROVED; // true
$notification->merchantAccount->status; // "active"
$notification->merchantAccount->id; // "blue_ladders_store"
$notification->merchantAccount->masterMerchantAccount->id; // "14ladders_marketplace"
$notification->merchantAccount->masterMerchantAccount->status; // "active"Sub-merchant declined
You can also listen for a SubMerchantAccountDeclined webhook that looks like this:
- PHP
$notification = $gateway->webhookNotification()->parse($bt_signature, $bt_payload);
$notification->kind == Braintree\WebhookNotification::SUB_MERCHANT_ACCOUNT_DECLINED; // true
$notification->message; // "Credit score is too low"
$notification->errors; // Braintree\Error\ValidationErrorCollection Object ( . . . )Declined, the webhook will contain
validation errors
indicating why the sub-merchant was declined. There are several reasons this can occur:
- Failed OFAC
- Failed Mastercard MATCH
- Failed KYC
- SSN invalid
- SSN matches deceased person