payment-skill 1.1.4 → 1.1.6

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.6",
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,42 @@ 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
+ console.log('Domain mode:', domainMode, 'Domains:', domains);
188
+
189
+ if (domains.length === 0) {
190
+ container.innerHTML = '<span style="color: var(--text-secondary); font-size: 10px;">No domains configured</span>';
191
+ return;
192
+ }
193
+
194
+ container.innerHTML = domains.map(d => {
195
+ // Color based on mode
196
+ let bgColor, textColor, borderColor;
197
+ if (domainMode === 'whitelist') {
198
+ // Whitelist mode: domains in list are ALLOWED (green)
199
+ bgColor = 'rgba(34, 197, 94, 0.2)';
200
+ textColor = '#22c55e';
201
+ borderColor = '#22c55e';
202
+ } else {
203
+ // Blacklist mode: domains in list are BLOCKED (red)
204
+ bgColor = 'rgba(220, 38, 38, 0.2)';
205
+ textColor = '#ef4444';
206
+ borderColor = '#dc2626';
207
+ }
208
+
209
+ return `
210
+ <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
211
  ${d}
188
- <button onclick="removeDomain('${d}')" style="background: none; border: none; color: #ef4444; cursor: pointer; font-size: 12px; padding: 0;">×</button>
212
+ <button onclick="removeDomain('${d}')" style="background: none; border: none; color: ${textColor}; cursor: pointer; font-size: 12px; padding: 0;">×</button>
189
213
  </span>
190
- `).join('');
214
+ `}).join('');
191
215
  }
192
216
 
193
217
  async function addDomain() {
@@ -212,7 +236,9 @@ async function removeDomain(domain) {
212
236
 
213
237
  async function saveDomainMode() {
214
238
  const mode = document.getElementById('domain-mode').value;
239
+ console.log('Saving domain mode:', mode);
215
240
  await apiPost('/api/limits/domains', { mode });
241
+ await loadLimits(); // Reload to update colors
216
242
  }
217
243
 
218
244
  // Geography Management