This page has moved and will be redirected soon. See Migrated topics for the complete list.
The Payment Provider Gateway documentation uses the Magento 2.3 (now Adobe Commerce and Magento Open Source) of the Braintree module as a reference application. The Braintree module was removed in version 2.4.0. The concepts described in this guide are still applicable to version 2.4.0, but the code samples are not supported.

Configure payment method by area

You can define whether the payment method is available for the storefront and checkout in the payment method configuration in config.xml:

  • can_use_checkout: whether payment method is available in storefront checkout
  • can_use_internal: whether payment method is available in Admin order creation

If your payment flow should be different for storefront and Admin panel, you can use a separate DI configuration for each area:

  • %Vendor_Module%/etc/adminhtml/di.xml: DI configuration for the Admin panel
  • %Vendor_Module%/etc/frontend/di.xml: DI configuration for the storefront


For example, on the storefront 3D Secure verification is integrated for the Braintree payment method, but it should not be available in Admin panel The DI configuration for authorization request builder for admin area looks like following:

<virtualType name="BraintreeAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
        <argument name="builders" xsi:type="array">
            <item name="customer" xsi:type="string">Magento\Braintree\Gateway\Request\CustomerDataBuilder</item>
            <item name="payment" xsi:type="string">Magento\Braintree\Gateway\Request\PaymentDataBuilder</item>

While the general app/code/Magento/Braintree/etc/di.xml does not have 3D secure verification builder for Admin panel, but virtual type has the same name (object will be created according to context of area).