Checking payment method availability
When working with different payment methods, in some cases you may need to get updates on their availability, for example, to keep the list of methods available to your customers accurate and up to date. The ecommpay payment platform supports the capability of checking payment method availability via an API both for individual and for all integrated methods. At the same time, however, keep in mind that even if the payment method is available, the problems when processing payments made with this method can still occur.
To check payment method availability, use requests to the /v2/info/available-methods/{payment_direction}/list endpoints where payment_direction
indicates the payment category you need: payin
for purchases of any type and payout
for payouts. When working with these requests, keep in mind the following:
The payment platform supports the capability of checking payment method availability for processing purchases and payouts. Use requests to the /v2/info/available-methods/{payment_direction}/list endpoints where payment_direction
indicates the payment category you need: payin
for purchases of any type and payout
for payouts. In addition, keep in mind the following:
- Each request must contain the
general
object with two parameters:project_id
—project identifier obtained from ecommpay during integration.signature
—request signature generated after all required parameters are specified (for details, see Signature generation and verificationlearn more).
- If you need to check payment method availability for one or several specific payment methods, pass the
payment_method_list
array that specifies the payment method code for each method individually as a value of thepayment_method
parameter.
A payment method availability request is processed according to the synchronous model of interaction between the web server and the payment platform. This implies that the request is fully processed within one HTTP session and uses only the resources of the payment platform. The response to the correct request contains an HTTP response status code (200
) and the required data without detailed request processing information. If the request is incorrect, or there have been issues with its acceptance and processing, then the response contains an HTTP response status code, request processing status error
and the detailed description of the error that occurred. To learn more about HTTP response status codes, see Interaction concepts, and to learn more about the response codes that provide information on operation processing in the payment platform, see Information of operations performing.
Payment method availability requests are synchronous. The response to the correct request contains an HTTP response status code (200
) and the required data without detailed request processing information. If the request is incorrect, or there have been issues with its acceptance and processing, then the response contains an HTTP response status code (learn more), request processing status error
and the detailed description of the error that occurred (learn more).
The body of the response to the correct request contains the project identifier, the signature, and the payment method availability array.