Migration Notice: We are transitioning from <bw-widget> to <nw-blocks> tags. While both are currently supported for backward compatibility, <nw-blocks> is now the recommended tag for all new implementations. Existing <bw-widget> implementations will continue to function.
PaymentMethods2 is a hybrid widget that combines the visual logo grid display of PaymentDeposits2 with the comprehensive data structure of PaymentMethods. It displays both deposit and withdrawal methods in a responsive logo grid with intelligent collapse/expand functionality, making it ideal for showcasing all available payment options in a compact, visually appealing format.
Key Features:
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
id |
string | Yes | - | Must be “paymentmethods2” |
cloaked-link |
string | Yes | - | Brand identifier/cloaked link |
product |
string | No | "" | Product filter (CA=Casino, SP=Sports, etc.) |
language |
string | No | “en” | ISO 639-1 language code |
country |
string | No | "" | ISO 3166-1 country code (supports state: US-NJ, CA-ON) |
countrystate |
string | No | - | State/province code (auto-parsed from country) |
items |
number | No | - | Maximum number of payment methods to display |
itemsdisplayed |
number | No | - | Alternative attribute name for items limit |
order |
string | No | "" | Custom ordering for payment methods |
headers |
array | No | […] | Header translation keys (inherited from config) |
Data Sources:
depositMethodsOrder arraywithdrawalMethods array[...depositMethods, ...withdrawalMethods]Items Limit:
Example:
const combined = [...depositMethods, ...withdrawalMethods];
const allMethods = itemsLimit ? combined.slice(0, itemsLimit) : combined;
Layout:
Responsive Breakpoints:
| Width Range | Columns | Use Case |
|---|---|---|
| ≤290px | 4 | Narrow mobile |
| 291-308px | 6 | Standard mobile |
| 309-350px | 3 | Wide mobile |
| >350px | Dynamic | Desktop (calculated) |
Column Calculation Formula:
const logoWidth = 87;
const gap = 20;
const columns = Math.floor((availableWidth + gap) / (logoWidth + gap));
Functionality:
Dynamic Count Display:
Toggle States:
widget__cols collapsed classwidget__cols expanded classReal-time Updates:
Event Handling:
const resizeObserver = new ResizeObserver(updateToggle);
resizeObserver.observe(widget);
The widget injects a self-executing script with comprehensive functionality:
Key Functions:
Event Listeners:
State Management:
Proper Cleanup:
return () => {
if (toggle) {
toggle.removeEventListener('click', toggleExpanded);
}
if (resizeObserver) {
resizeObserver.disconnect();
} else {
window.removeEventListener('resize', updateToggle);
}
};
Prevents memory leaks and ensures smooth unmounting.
<nw-blocks
id="paymentmethods2"
cloaked-link="greatwin-casino"
product="CA"
language="en"
country="UK"
items="15" \>
</nw-blocks>
<nw-blocks
id="paymentmethods2"
cloaked-link="leovegas-casino"
product="CA"
language="en"
country="UK"
items="12" \>
</nw-blocks>
<!-- Top 6 methods -->
<nw-blocks
id="paymentmethods2"
cloaked-link="leovegas-casino"
product="CA"
language="en"
country="SE"
items="6" \>
</nw-blocks>
<!-- Top 8 methods -->
<nw-blocks
id="paymentmethods2"
cloaked-link="betsson-casino"
product="CA"
language="en"
country="SE"
items="8" \>
</nw-blocks>
<!-- No items limit - show all deposit + withdrawal methods -->
<nw-blocks
id="paymentmethods2"
cloaked-link="legendplay-casino"
product="CA"
language="en"
country="ZZ" \>
</nw-blocks>
<nw-blocks
id="paymentmethods2"
cloaked-link="mobile-casino"
product="CA"
language="en"
country="UK"
items="9" \>
</nw-blocks>
items to 8-12 for balanced displayControl method display order via CMS configuration:
// Deposit methods ordered
depositMethodsOrder: [
{ paymentMethod: "visa", image: "/visa.png" },
{ paymentMethod: "mastercard", image: "/mc.png" },
{ paymentMethod: "skrill", image: "/skrill.png" },
// ... more deposit methods
]
// Withdrawal methods
withdrawalMethods: [
{ paymentMethod: "bank-transfer", image: "/bank.png" },
{ paymentMethod: "skrill", image: "/skrill.png" },
// ... more withdrawal methods
]
// Combined display: [...depositMethods, ...withdrawalMethods]
Widget adapts to parent container:
<!-- Full width section -->
<div style="width: 100%; max-width: 1200px;">
<nw-blocks id="paymentmethods2" ...></nw-blocks>
</div>
<!-- Sidebar (narrow) -->
<div style="width: 300px;">
<nw-blocks id="paymentmethods2" ...></nw-blocks>
</div>
<!-- Two-column layout -->
<div style="width: 50%; min-width: 400px;">
<nw-blocks id="paymentmethods2" ...></nw-blocks>
</div>
<!-- Highlights only (top 6) -->
<nw-blocks items="6" ...></nw-blocks>
<!-- Standard display (8-10) -->
<nw-blocks items="10" ...></nw-blocks>
<!-- Comprehensive (15-20) -->
<nw-blocks items="20" ...></nw-blocks>
<!-- All available (no limit) -->
<nw-blocks ...></nw-blocks>
<!-- Casino only -->
<nw-blocks product="CA" ...></nw-blocks>
<!-- Sports betting only -->
<nw-blocks product="SB" ...></nw-blocks>
<!-- Poker -->
<nw-blocks product="PK" ...></nw-blocks>
<!-- All products (no filter) -->
<nw-blocks product="" ...></nw-blocks>
Widget fetches combined deposit and withdrawal methods:
{
brand: {
cloakedLink: "legendplay-casino",
brandName: "Magical Spin Casino",
isActive: true,
isBrandActive: true,
product: "CA",
depositMethodsOrder: [
{
paymentMethod: "visa",
image: "https://cdn.example.com/payment-methods/visa.png",
displayOrder: 1
},
{
paymentMethod: "mastercard",
image: "https://cdn.example.com/payment-methods/mastercard.png",
displayOrder: 2
},
{
paymentMethod: "skrill",
image: "https://cdn.example.com/payment-methods/skrill.png",
displayOrder: 3
},
{
paymentMethod: "neteller",
image: "https://cdn.example.com/payment-methods/neteller.png",
displayOrder: 4
},
// ... more deposit methods
],
withdrawalMethods: [
{
paymentMethod: "bank-transfer",
image: "https://cdn.example.com/payment-methods/bank.png",
displayOrder: 1
},
{
paymentMethod: "skrill",
image: "https://cdn.example.com/payment-methods/skrill.png",
displayOrder: 2
},
{
paymentMethod: "neteller",
image: "https://cdn.example.com/payment-methods/neteller.png",
displayOrder: 3
},
// ... more withdrawal methods
],
showLessLabel: "Show Less",
viewMoreLabel: "View more"
}
}
Required Fields:
cloakedLink: Brand identifierisActive: Brand statusisBrandActive: Brand active flagdepositMethodsOrder: Array of deposit methodswithdrawalMethods: Array of withdrawal methodsPayment Method Fields:
paymentMethod: Method identifier (required)image: Logo URL (required)displayOrder: Sorting order (optional)Optional Fields:
showLessLabel: Collapse button labelviewMoreLabel: Expand button labelRequired i18n keys:
{
"wgt-payment-show-less": "Show Less",
"wgt-payment-view-more": "View more",
"wgt-paymentMethods-method": "Method",
"wgt-paymentMethods-delay": "Processing Time",
"wgt-paymentMethods-deposit": "Deposit",
"wgt-paymentMethods-withdrawal": "Withdrawal"
}
Language-Specific Examples:
{
"en": {
"wgt-payment-show-less": "Show Less",
"wgt-payment-view-more": "View more"
},
"fr": {
"wgt-payment-show-less": "Afficher moins",
"wgt-payment-view-more": "Voir plus"
},
"es": {
"wgt-payment-show-less": "Mostrar menos",
"wgt-payment-view-more": "Ver más"
},
"de": {
"wgt-payment-show-less": "Weniger anzeigen",
"wgt-payment-view-more": "Mehr anzeigen"
}
}
Payment method data is cached:
PAYMENT_METHODS2:{cloakedLink}:{country}:{language}:{product}If brand is inactive or not allowed:
<p id="inactive-brand" style="display: none;">
The brand {brandName} is inactive or not allowed.
</p>
Handling:
isActive and isBrandActive flagsIf no methods available:
Missing Image:
Empty Arrays:
depositMethodsOrder empty: No deposit methods shownwithdrawalMethods empty: No withdrawal methods shownIf JavaScript disabled:
Fallback:
if (typeof ResizeObserver !== 'undefined') {
resizeObserver = new ResizeObserver(updateToggle);
resizeObserver.observe(widget);
} else {
window.addEventListener('resize', updateToggle);
}
Falls back to window resize event in older browsers.
| Feature | PaymentMethods | PaymentDeposits2 | PaymentMethods2 |
|---|---|---|---|
| Display | Table with details | Logos only (deposit) | Logos only (both) |
| Data Shown | Method, time, flags | Logos | Logos |
| Methods | Deposit/withdrawal | Deposit only | Deposit + withdrawal |
| Toggle | Fixed height (168px) | Per-row smart | Per-row smart |
| Product Filter | ✅ Yes | ❌ No | ✅ Yes |
| Processing Time | ✅ Yes | ❌ No | ❌ No |
| Responsive | ⚠️ Scrollable | ✅ Dynamic grid | ✅ Dynamic grid |
| Use Case | Detailed comparison | Quick deposit view | All methods visual |
When to use PaymentMethods2:
When to use PaymentMethods:
When to use PaymentDeposits2:
All examples above use the new <nw-blocks> tag. For backward compatibility, you can still use <bw-widget>:
<!-- Old syntax (still supported) -->
<bw-widget
id="paymentmethods2"
cloaked-link="legendplay-casino"
product="CA"
language="en"
country="ZZ"
items="8" \>
</bw-widget>
<!-- New syntax (recommended) -->
<nw-blocks
id="paymentmethods2"
cloaked-link="legendplay-casino"
product="CA"
language="en"
country="ZZ"
items="8" \>
</nw-blocks>
Both tags work identically, but <nw-blocks> is recommended for all new implementations.