Gateways
List the gateways and currencies the merchant has enabled.
Guide: Payments and refunds.
Get gateways
paylexer_get_gateways( array $args = [] )
Returns the gateways the merchant enabled for this site that are open for checkout.
Parameters
| Name | Description |
|---|---|
currency | Only gateways that accept it. |
subscriptions | true for gateways that support subscriptions. |
test_mode | Include gateways whose live verification failed. |
include_blocked | Also list gateways blocked for checkout, such as during a maintenance window. |
Use include_blocked for settings screens, never checkout.
Responses
| Result | Description |
|---|---|
array | A list of gateways. |
Each gateway:
| Key | Description |
|---|---|
code | e.g. stripe. Pass it to paylexer_create_checkout. See Supported gateways. |
name, label, description, icon | Display fields. |
icon_ids | Card icon IDs the merchant picked. Pass them to paylexer_payment_icons(). |
currencies | ["USD","EUR"]. Empty means any. |
supports | subscriptions, trial, sign_up_fee, refunds, partial_refunds. |
Example
$gateways = paylexer_get_gateways( array( 'currency' => 'USD' ) );
Returns
array(
array(
'code' => 'stripe',
'name' => 'Stripe',
'currencies' => array( 'USD', 'EUR' ),
'supports' => array( 'refunds', 'partial_refunds' ),
),
)
Get currencies
paylexer_get_currencies()
Every currency the merchant's gateways accept (blocked ones included), keyed by code.
Add the ones your platform doesn't list.
Responses
| Result | Description |
|---|---|
array | Keyed by code, each with code, name, symbol, decimals. |
Example
$currencies = paylexer_get_currencies();
Returns
array(
'USD' => array( 'code' => 'USD', 'name' => 'US Dollar', 'symbol' => '$', 'decimals' => 2 ),
)
Payment icons
paylexer_payment_icons( array $icon_ids )
The card icons the merchant picked for a gateway, as HTML to show beside its name at checkout (what PayLexer's own platforms show instead of the gateway logo).
Responses
| Result | Description |
|---|---|
string | HTML, or '' when none are configured: show the name alone. |
Example
echo paylexer_payment_icons( $gateway['icon_ids'] );
Was this page helpful?