payment-skill 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payment-skill",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Self-hosted payment orchestration app for OpenClaw - pay from your bank account to merchants via API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -86,7 +86,7 @@ async function loadLimits() {
86
86
  // Update Domain Controls
87
87
  if (data.domainControls) {
88
88
  document.getElementById('domain-mode').value = data.domainControls.mode || 'blacklist';
89
- updateDomainsList(data.domainControls.domains || []);
89
+ updateDomainsList(data.domainControls.domains || [], data.domainControls.mode || 'blacklist');
90
90
  }
91
91
 
92
92
  // Update Geography Controls
@@ -176,18 +176,35 @@ async function removeBudget(index) {
176
176
 
177
177
  // Domain Management
178
178
  let domains = [];
179
+ let domainMode = 'blacklist';
179
180
 
180
- function updateDomainsList(domainList) {
181
+ function updateDomainsList(domainList, mode = 'blacklist') {
181
182
  domains = domainList;
183
+ domainMode = mode;
182
184
  const container = document.getElementById('domains-list');
183
185
  if (!container) return;
184
186
 
185
- container.innerHTML = domains.map(d => `
186
- <span style="background: rgba(59, 130, 246, 0.2); color: #3b82f6; padding: 3px 8px; border-radius: 3px; font-size: 10px; display: inline-flex; align-items: center; gap: 5px; margin: 2px;">
187
+ container.innerHTML = domains.map(d => {
188
+ // Color based on mode
189
+ let bgColor, textColor, borderColor;
190
+ if (domainMode === 'whitelist') {
191
+ // Whitelist mode: domains in list are ALLOWED (green)
192
+ bgColor = 'rgba(34, 197, 94, 0.2)';
193
+ textColor = '#22c55e';
194
+ borderColor = '#22c55e';
195
+ } else {
196
+ // Blacklist mode: domains in list are BLOCKED (red)
197
+ bgColor = 'rgba(220, 38, 38, 0.2)';
198
+ textColor = '#ef4444';
199
+ borderColor = '#dc2626';
200
+ }
201
+
202
+ return `
203
+ <span style="background: ${bgColor}; color: ${textColor}; border: 1px solid ${borderColor}; padding: 3px 8px; border-radius: 3px; font-size: 10px; display: inline-flex; align-items: center; gap: 5px; margin: 2px;">
187
204
  ${d}
188
- <button onclick="removeDomain('${d}')" style="background: none; border: none; color: #ef4444; cursor: pointer; font-size: 12px; padding: 0;">×</button>
205
+ <button onclick="removeDomain('${d}')" style="background: none; border: none; color: ${textColor}; cursor: pointer; font-size: 12px; padding: 0;">×</button>
189
206
  </span>
190
- `).join('');
207
+ `}).join('');
191
208
  }
192
209
 
193
210
  async function addDomain() {