Newer Version Available
Building a Synchronous Gateway Adapter
A synchronous gateway adapter implements the PaymentGatewayAdapter Interface. In this topic, we’ll break down a sample asynchronous adapter by looking at PaymentGatewayAdapter, and then the processRequest class, which drives most of the communication between the payment platform and the payment gateway.
PaymentGatewayAdapter
Processing an Initial Payment Request
When the payments platform receives a payments API request, it passes the request to your gateway adapter for further evaluation. The adapter begins the request evaluation process by calling the processRequest method, which represents the first step in a synchronous payment flow. We can break the processRequest implementation into three parts.
First, it builds a payment request object that the gateway can understand.
Then, the adapter sends the request to the payment gateway.