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.

Adding a new payment integration (payment method)

Out-of-the-box Magento implements integration with PayPal, Braintree, and Authorize.Net payment service providers. These integrations allow you to create and handle transactions based on order details.

You can create integration with other payment providers, using Magento payment provider gateway.

The Magento payment provider gateway allows creating secure and PCI-compliant integrations with payment services. To keep PCI compliance, you must not store sensitive credit card information.

The topics in this chapter explain how to add an integration with a custom payment service provider (in other words, add a new payment method) and implement the authorize payment action for this payment method. For illustration, we use code samples from the Braintree payment integration.

To simplify the development of a new payment integration, Magento developed the Payment sample module. It contains all required infrastructure and you can use it as starting point.

To add a new payment method, take the following high-level steps:

  1. Configure general payment method module options. Described in the Payment method module configuration topic.
  2. Configure payment method options. Described in Payment method configuration.
  3. Implement and configure payment method facade - the entity allowing to process payment actions between Magento sales management and payment processor. Described in Payment method facade and Payment info rendering in Admin checkout
  4. Implement and configure payment actions (like authorize, void and so on). Described in Add a gateway command

Your payment method might be available from either storefront and Admin, or both. And also can have a different configuration for each area. The keynotes on how to configure where the method can be used, and how to implement different behavior, are described in the Configure payment method by area topic.

Terms Used

Term Description
Payment additional information Array of data where you can store any payment-related information