Multi-Currency Display
Show localized prices in visitors' local currencies instead of just percentages.
Multi-currency display converts your prices to the visitor’s local currency, showing “₹4,999” instead of “30% off $99”. This is more intuitive and converts better.
Why Multi-Currency?
Section titled “Why Multi-Currency?”Consider two ways to present a discount to an Indian visitor:
Option A: “30% off — Use code PPP-IN for $69.30”
Option B: “₹4,999 — Use code PPP-IN at checkout”
Option B is more compelling because:
- The visitor immediately understands the price in their currency
- No mental math needed
- It looks like a real local price (especially with charm pricing)
How It Works
Section titled “How It Works”GoPayLocal fetches the current FX rate and converts prices automatically:
Base Price: $99 USDDiscount: 30%FX Rate: 83 INR/USD
Discounted: $99 × 0.70 = $69.30Converted: $69.30 × 83 = ₹5,751.90Charm Priced: ₹5,499Using Multi-Currency
Section titled “Using Multi-Currency”With the Banner Script
Section titled “With the Banner Script”The banner script supports multi-currency via the message template:
{{currencySymbol}}{{localPrice}} — Use code {{code}}Configure this in your campaign’s banner settings.
With the React SDK
Section titled “With the React SDK”The React SDK automatically handles multi-currency through its components:
import { PPPPrice, PPPCurrencySymbol, PPPCurrencyCode } from '@gopaylocal/react';
// Shows "₹4,999" for Indian visitors, "$99" for US visitors<PPPPrice price={99} />
// Currency symbol: "₹"<PPPCurrencySymbol />
// Currency code: "INR"<PPPCurrencyCode />With the JavaScript SDK
Section titled “With the JavaScript SDK”const gpl = new GoPayLocal({ apiKey: 'gpl_pk_live_abc123' });await gpl.init();
const pricing = gpl.getPrice(99);console.log(pricing.formatted); // "₹4,999"console.log(pricing.currencySymbol); // "₹"console.log(pricing.currencyCode); // "INR"Without Currency Conversion
Section titled “Without Currency Conversion”If you only want the discount (not currency conversion), set localize: false:
// React<PPPPrice price={99} localize={false} />// Shows "$69.30" (discounted but still in USD)// JavaScript SDKconst pricing = gpl.getPrice(99, { localize: false });// pricing.formatted = "$69.30"FX Rates
Section titled “FX Rates”GoPayLocal maintains FX rates from major data providers, updated periodically and cached at the edge for fast access.
| Detail | Value |
|---|---|
| Update frequency | Multiple times per day |
| Source | Major FX data providers |
| Cache TTL | 5 minutes at the edge |
| Fallback | If FX rate is unavailable, fxRate defaults to 1 |
Interaction with Charm Pricing
Section titled “Interaction with Charm Pricing”Multi-currency and charm pricing work together seamlessly:
- Calculate discount: $99 × 30% off = $69.30
- Convert currency: $69.30 × 83 = ₹5,751.90
- Apply charm pricing: ₹5,751.90 → ₹5,499
The result is a price that looks like it was specifically set for the Indian market.
Supported Currencies
Section titled “Supported Currencies”GoPayLocal supports 150+ currencies via Intl.NumberFormat. The SDK uses the browser’s built-in locale data for formatting, ensuring correct separators, decimal points, and currency symbol placement for every currency.
Examples:
| Currency | Format |
|---|---|
| USD | $1,234.56 |
| EUR | 1.234,56 € |
| INR | ₹1,234.56 |
| JPY | ¥1,235 (no decimals) |
| BRL | R$ 1.234,56 |
| KRW | ₩1,235 (no decimals) |