Display payment methods
To provide the best user experience to your customer, you should let them choose their preferred payment method in your checkout before even creating the Order and redirecting them to Montonio. You can fetch the list of availbale payment methods for your store using the GET /stores/payment-methods endpoint.
You should then use that data to display the methods in your checkout.
This guide will show you how to fetch the list of available payment methods and will point you towards our UI widgets to display the methods easily.
What payment methods can be used?
An Order can be paid for using one of the available payment methods, specified when creating the Order. The available payment methods per currency are:
| Payment method | Supported currencies | System name |
|---|---|---|
| Bank Payments | EUR, PLN | paymentInitiation |
| Card Payments | EUR, PLN | cardPayments |
| MobilePay | EUR | mobilePay |
| BLIK | PLN | blik |
| Buy Now Pay Later | EUR | bnpl |
| Hire Purchase | EUR | hirePurchase |
Within Bank Payments there’s an additional subset of methods. These methods are the specific Payment Initiation banks for each country. The list of banks per country is returned as part of the API request detailed below. The pricing page on our website also details the available banks per country.
Fetching enabled payment methods
To get all enabled payment methods for your store, use the GET /stores/payment-methods endpoint. The response will contain a list of all available payment methods and their additional options. paymentInitiation will also contain a list of available banks, so that you can let the customer make their bank selection already in your checkout.
You can read about API authentication and other available endpoints here or you can dive straight in with the complete example below:
Complete example
/** * We recommend using the jsonwebtoken package to generate * Json Web Tokens. You can install it with npm: * > npm install jsonwebtoken * More information can be found at * https://www.npmjs.com/package/jsonwebtoken */import jwt from 'jsonwebtoken';import axios from 'axios';
/** * Note: Please make sure to make these calls from your server, * and not from the client. This is to prevent your secret key * from being exposed to the public. */
// 1. Create the authorization token payloadconst payload = { accessKey: 'MY_ACCESS_KEY' // your store's Access Key from the Partner System};
// 2. Generate the tokenconst token = jwt.sign( payload, 'MY_SECRET_KEY', // your store's Secret Key from the Partner System { algorithm: 'HS256', expiresIn: '10m' });
// console.log(token); // eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiIxZTU0ZTM4NS1hODBiLTRhYzQtYTY1MC1kNmZkNmY3OTA2NGIiLCJpYXQiOjE2OTE3NTQ0OTEsImV4cCI6MTY5MTc1NTA5MX0.nbv7DKAThu_4vaymKPJoTVqQHMZtZ7Hoonk6EAOEIkM
// 3. Make the requestaxios.get('https://stargate.montonio.com/api/stores/payment-methods', { headers: { 'Authorization': `Bearer ${token}` }}).then(response => { const { data } = response; console.log(data.paymentMethods); // use this data to render the payment methods});<?php/** * We recommend using Firebase's php-jwt package to generate * Json Web Tokens. You can install it with composer: * > composer require firebase/php-jwt * More information can be found at * https://github.com/firebase/php-jwt */
// Should be loaded only once in the app, check composer docs for the specific framework you are usingrequire __DIR__ . '/vendor/autoload.php';
use \Firebase\JWT\JWT;
// 1. Create the authorization token payload$payload = [ 'accessKey' => 'YOUR_ACCESS_KEY',];
// add expiry to the token for JWT validation$payload['exp'] = time() + (10 * 60);
// 2. Generate the token using Firebase's JWT library$token = JWT::encode($payload, 'MY_SECRET_KEY', 'HS256');// var_dump($token);// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiIxZTU0ZTM4NS1hODBiLTRhYzQtYTY1MC1kNmZkNmY3OTA2NGIiLCJpYXQiOjE2OTE3NTQ0OTEsImV4cCI6MTY5MTc1NTA5MX0.nbv7DKAThu_4vaymKPJoTVqQHMZtZ7Hoonk6EAOEIkM
// 3. Make the request$ch = curl_init();curl_setopt($ch, CURLOPT_URL, "https://sandbox-stargate.montonio.com/api/stores/payment-methods");curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', "Authorization: Bearer ${token}"]);
$result = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);curl_close($ch);
if ($status >= 400) { var_dump($result); // "{"statusCode":401,"message":"STORE_NOT_FOUND","error":"Unauthorized"}" exit;}
// 4. Decode the list of enabled payment methods$data = json_decode($result, true);var_dump($data['paymentMethods']); // use the data to render the payment methods// if empty that means the paymentMethods have not been enabled for you store, contact customer support'''We recommend using the PyJWT package to generateJson Web Tokens. You can install it with pip:> pip3 install PyJWTMore information can be found athttps://pyjwt.readthedocs.io/en/latest/'''import jwtimport datetimeimport requests
# 1. Create the authorization token payloadpayload = { 'accessKey': 'MY_ACCESS_KEY', 'exp': datetime.datetime.now(timezone.utc) + datetime.timedelta(minutes=10)}
# 2. Generate the tokentoken = jwt.encode(payload, 'MY_SECRET_KEY', algorithm='HS256')
print(token)# eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiIxZTU0ZTM4NS1hODBiLTRhYzQtYTY1MC1kNmZkNmY3OTA2NGIiLCJpYXQiOjE2OTE3NTQ0OTEsImV4cCI6MTY5MTc1NTA5MX0.nbv7DKAThu_4vaymKPJoTVqQHMZtZ7Hoonk6EAOEIkM
# 3. Make the requestheaders = { 'Authorization': f'Bearer {token}'}response = requests.get('https://stargate.montonio.com/api/stores/payment-methods', headers=headers)data = response.json()
print(data['paymentMethods'])# use this data to render the payment methodsGET /stores/payment-methods
Endpoint path
GET /stores/payment-methodsAuthentication
Authentication for all endpoints is described in the Authentication section of the API reference. Be sure to follow the instructions for GET endpoints.
Headers
| Key | Required | Value |
|---|---|---|
| Authorization | yes | Bearer [your_token] |
Example request
curl -X GET \ 'https://stargate.montonio.com/api/stores/payment-methods' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiJNWV9BQ0NFU1NfS0VZIiwiaWF0IjoxNjc1OTM4NjM3LCJleHAiOjE2NzU5NDIyMzd9.f-wXP8t5HGhr5XKAl3eCeWbHnY3SO9DcY5WiWo06-uQ'Example response
Show / Hide Response Data
{ "uuid": "0bafe86b-c5cf-4c88-ba28-484a8585f0f4", "name": "Montonio Store", "paymentMethods": { "blik": { "processor": "blik", "logoUrl": "https://public.montonio.com/images/logos/blik.png" }, "cardPayments": { "processor": "adyen", "logoUrl": "https://public.montonio.com/images/logos/visa-mc-ap-gp.png", "requiredToBeEnabled": true }, "mobilePay": { "processor": "adyen", "logoUrl": "https://public.montonio.com/images/logos/mobilepay.png", "requiredToBeEnabled": true }, "bnpl": { "processor": "inbank", "logoUrl": "https://public.montonio.com/images/logos/inbank_bnpl.png" }, "hirePurchase": { "processor": "inbank", "logoUrl": "https://public.montonio.com/images/logos/inbank_hire_purchase.png" }, "paymentInitiation": { "processor": "montonio", "setup": { "PL": { "supportedCurrencies": [ "EUR", "PLN" ], "paymentMethods": [ { "name": "Revolut Poland", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/revolut.png", "supportedCurrencies": [ "EUR", "PLN" ], "uiPosition": 1, "code": "RVUALT2V" }, { "name": "PKO Bank Polski", "logoUrl": "https://public.montonio.com/images/aspsps_logos/pko-polski.png", "supportedCurrencies": [ "PLN" ], "uiPosition": 2, "code": "BPKOPLPW" }, { "name": "Pekao", "logoUrl": "https://public.montonio.com/images/aspsps_logos/pekao.png", "supportedCurrencies": [ "PLN" ], "uiPosition": 3, "code": "PKOPPLPW" }, { "name": "mBank", "logoUrl": "https://public.montonio.com/images/aspsps_logos/mbank.png", "supportedCurrencies": [ "PLN" ], "uiPosition": 4, "code": "BREXPLPW" }, { "name": "Santander Bank Polska", "logoUrl": "https://public.montonio.com/images/aspsps_logos/santander.png", "supportedCurrencies": [ "PLN" ], "uiPosition": 5, "code": "WBKPPLPP" }, { "name": "Ing Poland", "logoUrl": "https://public.montonio.com/images/aspsps_logos/ing.png", "supportedCurrencies": [ "PLN" ], "uiPosition": 6, "code": "INGBPLPW" }, { "name": "Alior", "logoUrl": "https://public.montonio.com/images/aspsps_logos/alior.png", "supportedCurrencies": [ "PLN" ], "uiPosition": 7, "code": "ALBPPLPW" }, { "name": "BNP Paribas", "logoUrl": "https://public.montonio.com/images/aspsps_logos/bnp-paribas.png", "supportedCurrencies": [ "PLN" ], "uiPosition": 8, "code": "PPABPLPK" }, { "name": "Millenium", "logoUrl": "https://public.montonio.com/images/aspsps_logos/millennium.png", "supportedCurrencies": [ "PLN" ], "uiPosition": 9, "code": "BIGBPLPW" }, { "name": "Inteligo", "logoUrl": "https://public.montonio.com/images/aspsps_logos/inteligo.png", "supportedCurrencies": [ "PLN" ], "uiPosition": 10, "code": "IBNKPAPA" }, { "name": "Credit Agricole", "logoUrl": "https://public.montonio.com/images/aspsps_logos/credit-agricole.png", "supportedCurrencies": [ "PLN" ], "uiPosition": 11, "code": "AGRIPLPR" }, { "name": "N26 Poland", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/n26.svg", "supportedCurrencies": [ "EUR" ], "uiPosition": 12, "code": "NTSBDEB1" } ] }, "FI": { "supportedCurrencies": [ "EUR" ], "paymentMethods": [ { "name": "OP Financial Group", "logoUrl": "https://public.montonio.com/images/aspsps_logos/op.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 1, "code": "OKOYFIHH" }, { "name": "Nordea", "logoUrl": "https://public.montonio.com/images/aspsps_logos/nordea.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 2, "code": "NDEAFIHH" }, { "name": "Danske Bank", "logoUrl": "https://public.montonio.com/images/aspsps_logos/danske.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 3, "code": "DABAFIHH" }, { "name": "Säästöpankki", "logoUrl": "https://public.montonio.com/images/aspsps_logos/saastopankki.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 4, "code": "ITELFIHH" }, { "name": "POP Pankki", "logoUrl": "https://public.montonio.com/images/aspsps_logos/pop.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 5, "code": "POPFFI22" }, { "name": "Oma Säästöpankki", "logoUrl": "https://public.montonio.com/images/aspsps_logos/omasp.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 6, "code": "OMSAFI2S" }, { "name": "S-Pankki", "logoUrl": "https://public.montonio.com/images/aspsps_logos/s-pankki.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 7, "code": "SBANFIHH" }, { "name": "Alandsbanken", "logoUrl": "https://public.montonio.com/images/aspsps_logos/alandsbanken-fi.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 8, "code": "AABAFI22" }, { "name": "Revolut Finland", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/revolut.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 10, "code": "RVUALT2V" }, { "name": "N26 Finland", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/n26.svg", "supportedCurrencies": [ "EUR" ], "uiPosition": 11, "code": "NTSBDEB1" } ] }, "DE": { "supportedCurrencies": [ "EUR" ], "paymentMethods": [ { "name": "Sparkasse", "logoUrl": "https://public.montonio.com/images/aspsps_logos/sparkasse.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 1, "code": "SPARKASSE" }, { "name": "Postbank", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/postbank.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 1, "code": "PBNKDEFFTIP" }, { "name": "Deutsche Bank", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/deutschebank.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 5, "code": "DEUTDEFFXXX" }, { "name": "Sparda-Bank", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/sparda.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 7, "code": "SPARDA" }, { "name": "Commerzbank", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/commerzbank.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 8, "code": "COBADEFF" }, { "name": "N26 Germany", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/n26.svg", "supportedCurrencies": [ "EUR" ], "uiPosition": 9, "code": "NTSBDEB1" }, { "name": "HypoVereinsbank (UniCredit)", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/hypovereinsbank-unicredit.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 10, "code": "HYVEDEMMXXX" }, { "name": "Comdirect", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/comdirect.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 11, "code": "COBADEHD" }, { "name": "Norisbank", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/noris.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 11, "code": "NORSDE51XXX" }, { "name": "Revolut Germany", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/revolut.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 12, "code": "RVUALT2V" }, { "name": "Consors Bank", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/consorsbank.svg", "supportedCurrencies": [ "EUR" ], "uiPosition": 13, "code": "CSDBDE71XXX" } ] }, "LT": { "supportedCurrencies": [ "EUR" ], "paymentMethods": [ { "name": "Swedbank Lithuania", "logoUrl": "https://public.montonio.com/images/aspsps_logos/swedbank.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 1, "code": "HABALT22" }, { "name": "SEB Lithuania", "logoUrl": "https://public.montonio.com/images/aspsps_logos/seb.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 2, "code": "CBVILT2X" }, { "name": "Luminor Lithuania", "logoUrl": "https://public.montonio.com/images/aspsps_logos/luminor.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 3, "code": "AGBLLT2X" }, { "name": "Šiaulių bankas", "logoUrl": "https://public.montonio.com/images/aspsps_logos/siauliu.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 4, "code": "CBSBLT26" }, { "name": "Citadele Lithuania", "logoUrl": "https://public.montonio.com/images/aspsps_logos/citadele.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 5, "code": "INDULT2X" }, { "name": "Revolut Lithuania", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/revolut.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 6, "code": "RVUALT2V" } ] }, "EE": { "supportedCurrencies": [ "EUR" ], "paymentMethods": [ { "name": "Swedbank Estonia", "logoUrl": "https://public.montonio.com/images/aspsps_logos/swedbank.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 1, "code": "HABAEE2X" }, { "name": "SEB Estonia", "logoUrl": "https://public.montonio.com/images/aspsps_logos/seb.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 2, "code": "EEUHEE2X" }, { "name": "LHV Estonia", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/lhv.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 3, "code": "LHVBEE22" }, { "name": "Luminor Estonia", "logoUrl": "https://public.montonio.com/images/aspsps_logos/luminor.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 4, "code": "RIKOEE22" }, { "name": "Coop Pank", "logoUrl": "https://public.montonio.com/images/aspsps_logos/coop.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 5, "code": "EKRDEE22" }, { "name": "Citadele Estonia", "logoUrl": "https://public.montonio.com/images/aspsps_logos/citadele.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 6, "code": "PARXEE22" }, { "name": "Revolut Estonia", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/revolut.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 7, "code": "RVUALT2V" }, { "name": "N26 Estonia", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/n26.svg", "supportedCurrencies": [ "EUR" ], "uiPosition": 8, "code": "NTSBDEB1" } ] }, "LV": { "supportedCurrencies": [ "EUR" ], "paymentMethods": [ { "name": "Revolut Latvia", "logoUrl": "https://public.montonio.com/images/aspsps_logos/v2/revolut.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 1, "code": "RVUALT2V" }, { "name": "Swedbank Latvia", "logoUrl": "https://public.montonio.com/images/aspsps_logos/swedbank.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 2, "code": "HABALV22" }, { "name": "SEB Latvia", "logoUrl": "https://public.montonio.com/images/aspsps_logos/seb.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 3, "code": "UNLALV2X" }, { "name": "Citadele Latvia", "logoUrl": "https://public.montonio.com/images/aspsps_logos/citadele.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 4, "code": "PARXLV22" }, { "name": "Luminor Latvia", "logoUrl": "https://public.montonio.com/images/aspsps_logos/luminor.png", "supportedCurrencies": [ "EUR" ], "uiPosition": 5, "code": "RIKOLV2X" } ] } } } }}Displaying the payment methods
You should display the fetched payments methods to the customer. They should be able to choose their preferred method.
For Bank Payments we have built a UI widget you can integrate to your checkout page. Head over to the UI widgets page to learn more. The widget only displays the banks for the paymentInitiation method. For other methods (cards, BLIK, financing, etc.) you should use your own UI elements.