---
title: "Payment Gateway Currency: Developer Hooks and Filters Reference"
description: "Developer reference for Payment Gateway Currency for WooCommerce: filters, actions, constants and examples."
url: "https://wpfactory.com/docs/payment-gateways-by-currency-developer-hooks-filters/"
updated: "2026-09-26"
category: Developers
---

# Payment Gateway Currency: Developer Hooks and Filters Reference

## Hooks, filters, and constants in Payment Gateway Currency

[Payment Gateway Currency for WooCommerce](https://wpfactory.com/item/payment-gateways-by-currency-for-woocommerce/) exposes filters and actions so developers can adjust conversion behavior, rates, restriction logic, and frontend output in code. All names below are verified against the plugin source (Pro v4.1.5). Option keys use the `alg_wc_pgbc_` prefix, except the Restrict section, which keeps legacy `alg_wc_payment_gateways_by_currency_` keys.

### Filters

| Filter | Arguments | Purpose |
| --- | --- | --- |
| `alg_wc_pgbc_pre_check` | `$do_check` (bool) | Whether a gateway is eligible for Restrict Currency. Free returns true only for the standard gateways; Pro sets it to `__return_true` for all. |
| `alg_wc_pgbc_settings` | `$value, $type, $args` | Pro gating filter for settings field attributes. In Free it injects the `disabled` attribute on non-standard gateways. |
| `alg_wc_pgbc_convert_currency_do_convert` | `$do_convert` (bool) | Final say on whether conversion runs for the current request (cart, checkout, AJAX). |
| `alg_wc_pgbc_convert_currency_get_gateway_rate` | `$rate, $gateway, $obj` | The conversion rate resolved for a gateway (`false` if none). Override to compute rates dynamically. |
| `alg_wc_pgbc_convert_currency_rate` | `$rate, $from, $currency` | Each rate fetched from a server, after the Multiplier is applied, before it is stored. |
| `alg_wc_pgbc_server_rates_function` | `$callable` | The callback used to fetch rates from the selected server. Return your own callable to add a rate source. |
| `alg_wc_pgbc_convert_currency_get_shop_currency` | `$currency` | The shop currency recorded in the conversion data for an order or session. |
| `alg_wc_pgbc_do_convert_shipping_package_rate` | `$do_convert, $method_id` | Whether to convert a specific shipping package rate. Return false to skip a method. |
| `alg_wc_pgbc_convert_currency_info_get_output_placeholders` | `$placeholders, $position, $obj` | The placeholder map used to render a frontend info position. Add or change placeholders here. |
| `alg_wc_pgbc_convert_filterable_scripts_l10n` | `$l10n, $handle, $object_name` | Localization data passed to the plugin's filterable frontend script. |

### Actions

| Action | Fires when |
| --- | --- |
| `alg_wc_pgbc_settings_saved` | A settings section is saved. Used internally to trigger a manual rate update. |
| `alg_wc_pgbc_version_updated` | The stored plugin version differs from the running version (on upgrade). |

### Constants

Set a rate-server API key in `wp-config.php` instead of the settings screen using `ALG_WC_PGBC_API_KEY_{SERVER}`, uppercased. For Fixer.io:

```
define( 'ALG_WC_PGBC_API_KEY_FIXER', 'your-fixer-api-key' );
```

When the constant is defined, the corresponding server key field is hidden and the constant value is used.

### Examples

Apply Restrict Currency logic to all gateways without Pro's blanket override, for a single gateway:

```
add_filter( 'alg_wc_pgbc_pre_check', function( $do_check ) {
    // Return true to run allowed/denied checks for the current gateway.
    return $do_check;
} );
```

Nudge every auto-fetched rate up by a fixed amount in code:

```
add_filter( 'alg_wc_pgbc_convert_currency_rate', function( $rate, $from, $currency ) {
    return (float) $rate * 1.02;
}, 10, 3 );
```

Skip conversion of a specific shipping method:

```
add_filter( 'alg_wc_pgbc_do_convert_shipping_package_rate', function( $do_convert, $method_id ) {
    return ( 'local_pickup' === $method_id ) ? false : $do_convert;
}, 10, 2 );
```

### Need a hand?

Our team answers every ticket on the [Payment Gateway Currency support forum](https://wpfactory.com/support/).

Related articles

- [Set a Different Currency per Payment Gateway](https://wpfactory.com/docs/set-a-different-currency-per-payment-gateway/)
- [How to Use WooCommerce Payment Gateway Currency](https://wpfactory.com/docs/intro-article/)
- [Info and Admin Sections of Payment Gateway Currency](https://wpfactory.com/docs/info-admin-sections-of-payment-gateway-currency/)
- [Restrict Currency Options for Payment Gateways](https://wpfactory.com/docs/restrict-payment-currencies/)
- [Set Up Automatic Currency Exchange Rates](https://wpfactory.com/docs/set-up-automatic-exchange-rates/)
