Skip to main content

Available payment methods

Use this feature when you show the payment method buttons on your own page or in your app instead of the payment method tiles of the Checkout page. Before the payment, you ask Payment Platform which payment methods and brands are available for it. The answer is the list that the Checkout page would show as tiles for the same parameters, with one exception for the IP address, described in How the list is built. After the customer chooses a method, you create the payment with this method.

Two requests return the list. They work in the same way and return the same codes:

RequestEndpointHash
S2S CARD GET_METHODSPOST /post, form parametersFormula 10
Checkout Get Available Payment MethodsPOST /api/v1/payment/methods, JSONPayment methods signature

Neither request creates a payment or a Checkout session, and neither sends a callback.

Before you start​

  • S2S CARD request. Your merchant needs an enabled S2S CARD protocol mapping, also if you take the payments over Checkout or S2S APM. Without it the request returns Protocol mapping not found. If your merchant accepts requests only from listed IP addresses, the IP address check applies to this request too.
  • Checkout request. Uses the same merchant_key and password as the authentication request.

How it works​

  1. Before each payment, send the request with the operation, the amount, the currency and the payer data you already have. Send it again before every payment rather than storing the list: your routing settings can change at any time.
  2. While you wait for the response, show a loading state instead of the buttons.
  3. Show one button for each code in methods. The response has no names or logos: use your own.
  4. If the customer changes something that you sent in the request, for example the amount or an option that you pass in custom_data, send the request again and update the buttons.
  5. When the customer chooses a method, create the payment with the same parameters that you sent in the request:

How the list is built​

Payment Platform takes the payment methods and brands of your active merchant mappings for the operation, and corrects them with your routing settings for the parameters you send. It is the same logic that selects the payment method tiles on the Checkout page.

You sendUsed by
Operation: order_type (S2S) or operation (Checkout)Only the merchant mappings for this operation are used. For transfer, only payment methods are returned, without brands.
order_amount and order_currency (S2S), order.amount and order.currency (Checkout)Routing conditions on the amount and the currency. For a crypto currency, only crypto brands are returned.
payer_country (S2S), billing_address.country (Checkout)Routing conditions on the payer country.
payer_ipRouting conditions on the country of the IP address. In Checkout, if you do not send payer_ip, the IP address the request comes from is used, that is the IP address of your server, so send the IP address of the customer. The payment method tiles of the Checkout page are built when you create the session, from the IP address the authentication request comes from. For conditions on the country of the IP address, the list can therefore differ from the tiles.
payer_email (S2S), customer.email (Checkout)Routing conditions on the email domain.
custom_dataRouting conditions on custom data.
channel_idOnly the merchant mappings with this channel are used.
moto_type (Checkout only)With a MOTO value, card payment is offered only if one of your MIDs has MOTO enabled. See MOTO payments.

Optional parameters make the list wider. All payer parameters are optional. If a routing condition needs payer data that you did not send, such as the country, the IP address or the email, the condition cannot be checked, and the methods of both of its branches are returned. The same happens with conditions that need card data, such as the BIN or the card brand: the request has no card data. The list is then wider than the route the payment will actually take. For the most accurate list, send everything you will send in the payment.

Custom data. If you send no custom_data at all, conditions on custom data cannot be checked, and the methods of both branches are returned. If you send custom_data but without the key that a condition checks, the condition is not met. For example, with a condition bonus == true, a request without custom_data gets the methods of both branches, while a request with custom_data[other]=1 but without bonus gets only the methods for a payment without the bonus. The values true and false are compared as booleans, in any letter case. Numbers are compared as numbers. Other values must match exactly. For example, a condition bonus == true matches custom_data[bonus]=true and TRUE, but not 1.

Not checked. The request does not check limits of your MIDs and merchant mappings, balancers and percentage distribution, antifraud rules, or whether the MIDs of the route support the currency of the payment. A method can be in the list while its limit is used up or while its MID does not accept the currency, and the payment can then be declined. With a balancer, the list contains the methods of every MID of the route.

The response​

methods is a flat list of codes, one per payment method tile of the Checkout page:

{
"action": "GET_METHODS",
"result": "SUCCESS",
"methods": ["card", "paypal"]
}

The Checkout request returns only the list: {"methods": ["card", "paypal"]}.

  • card stands for card payments. Card brands such as visa or mastercard are not returned separately.
  • Every other code is the code of an alternative payment method brand, the same code as in the Checkout methods parameter and the S2S APM brand parameter. See Payment methods and S2S APM brands.
  • For a crypto currency, only crypto brands are returned.

Errors​

The two requests report that no method is available in different ways. Handle both.

CaseS2S CARD GET_METHODSCheckout /api/v1/payment/methods
No payment method is availableHTTP 400, error_code 100000, No available payment methodsHTTP 400, error_code 0, Not found acceptable methods. In some cases HTTP 200 with an empty list, {"methods": []}: treat it the same way.
Wrong hashHTTP 400, Request data is invalid. with hash: Hash is not valid. in errorsHTTP 400, Request data is invalid. with hash: Hash is not valid. in errors
A required parameter is missing or not validHTTP 400, Request data is invalid. with the parameter in errors, for example order_amount: This value should not be blank.HTTP 400, Request data is invalid. with the parameter in errors, for example order.amount: This value should not be blank.
No enabled S2S CARD protocol mappingProtocol mapping not found. in errorsNot applicable
Request from an IP address that is not allowed for your merchantRequest from this ip is not allowed. in errorsNot applicable

Pass the chosen method to Checkout​

Send the code the customer chose in the methods array of the authentication request:

{
"merchant_key": "0f6a2b4c-8d1e-11ee-b9d1-0242ac120002",
"operation": "purchase",
"methods": ["paypal"],
"order": {
"number": "order-1234",
"amount": "10.00",
"currency": "USD",
"description": "Deposit"
},
"custom_data": { "bonus": "true" },
"success_url": "https://example.com/success",
"hash": "..."
}
  • With one method in methods, the Checkout page skips the payment method tiles and opens the payment with this method directly. With several methods, the customer chooses among them.
  • The methods you send in methods are not checked against your routing settings. Send only a code that the request returned for the same parameters. The payment itself still goes through your routing: if the route of the payment has no MID for the chosen method, the payment fails.
  • Send the same amount, currency, customer and billing data and custom_data as in the request for the list, so the payment takes the route the list was built for.
  • A code that the Checkout page does not support returns HTTP 400 with methods: Not found acceptable methods in errors. A supported code for which your merchant has no available payment method returns HTTP 400 with Not found acceptable methods.

Checkout in an iframe​

If you show the Checkout page in an iframe on your page, some payment providers and 3DS pages do not open inside an iframe. Use url_target in the authentication request to choose the browsing context (_self, _parent or _top) in which the Checkout page opens the pages of payment providers it redirects to and returns the customer at the end, and make sure your page handles a payment page that opens outside the iframe. See iFrame.

What's next​