Add a payment action
For each payment action available for the payment method, you must implement the following:
- Creating a request with payment details. Described in Get payment information from frontend to backend.
- Request processing using response handler and response validator.
- Specify and configure the gateway command. Described in the Gateway Command topic.
- Add the command to the commands pool, as described in Command Pool.
Configure the command
The gateway command for the payment action must be configured in the
di.xml file of your module. Conventionally, its location must be
Configure the command as described in Gateway Command.
authorize payment action for Braintree
Configuring the gateway command and adding it to command pool (
In the command configuration we see that
BraintreeAuthorizeRequest is specified as
requestBuilder, that is a
Let’s look closer on the
requestBuilder arguments. This argument value is a list of builders, builder composite.
BraintreeAuthorizeRequest builder contains the following builders (
The most important builder in this pool is
payment builder. It is responsible for the payment information part of the request.
Please see the Get payment information from frontend to backend for details about how payment information can be handled.
- Add a custom payment method to checkout: how to add a custom payment integration to checkout page.