Localisation
Pomelo Connect's payment gateway portal is available in multiple languages, providing an accessible experience for users across regions. By default the portal falls back to the user's system locale.
Specifying the locale
Pass the locale parameter when creating a transaction to set the gateway page language. Examples: en_GB, en_US, vn, th_TH.
NodeJS:
const axios = require('axios');
async function createPayment() {
const request = {
amount: 1000,
currency: 'GBP',
locale: 'vn',
// ... additional parameters
};
const response = await axios.post(
'https://api.pomelopay.com/public/v2/transactions',
request,
);
return response.data.url;
}
PHP:
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client();
$request = [
'amount' => 1000,
'currency' => 'GBP',
'locale' => 'vn',
];
$response = $client->post(
'https://api.pomelopay.com/public/v2/transactions',
['json' => $request],
);
$gatewayUrl = json_decode($response->getBody(), true)['url'];
Python:
import requests
def create_payment():
request = {
'amount': 1000,
'currency': 'GBP',
'locale': 'vn',
}
response = requests.post(
'https://api.pomelopay.com/public/v2/transactions',
json=request,
)
return response.json()['url']
When the user lands on the hosted gateway page, the entire portal will render in Vietnamese (in this example).
Underlying payment-method localisation
The locale isn't just for the gateway portal — it's also passed through to the underlying payment provider. This matters when the payment action happens outside the portal (e.g. provider-hosted card capture, a redirect to a bank portal). Specifying the locale gives a unified experience throughout the entire payment flow.