payment-skill 1.1.3 → 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/dashboard.html CHANGED
@@ -382,13 +382,18 @@
382
382
  </button>
383
383
  </div>
384
384
  <div class="section-body">
385
- <div class="form-row">
386
- <div class="form-group"><label>Budget Name</label><input type="text" value="Monthly Budget"></div>
387
- <div class="form-group"><label>Amount</label><input type="text" value="1000"></div>
388
- <div class="form-group"><label>Period</label><select><option>Monthly</option><option>Weekly</option><option>Daily</option></select></div>
389
- <div class="form-group"><label>Currency</label><select><option>USD</option><option>EUR</option></select></div>
385
+ <div style="margin-bottom: 15px;">
386
+ <div style="font-size: 10px; color: var(--text-secondary); margin-bottom: 6px;">Add New Budget</div>
387
+ <div class="form-row">
388
+ <div class="form-group"><label>Amount</label><input type="number" id="budget-amount" placeholder="1000"></div>
389
+ <div class="form-group"><label>Currency</label><select id="budget-currency"><option>EUR</option><option>USD</option></select></div>
390
+ <div class="form-group"><label>Period</label><select id="budget-period"><option value="daily">Daily</option><option value="weekly">Weekly</option><option value="monthly">Monthly</option></select></div>
391
+ <div class="form-group"><label>&nbsp;</label><button class="btn" onclick="addBudget()" style="padding: 5px 15px; font-size: 11px;">+ Add Budget</button></div>
392
+ </div>
393
+ </div>
394
+ <div id="budgets-list" style="margin-bottom: 15px;">
395
+ <!-- Budgets will be loaded here -->
390
396
  </div>
391
- <button class="save-section-btn">Save Budgets</button>
392
397
  <div class="clearfix"></div>
393
398
  </div>
394
399
  </div>
@@ -408,27 +413,22 @@
408
413
  </div>
409
414
  <div class="section-body">
410
415
  <div style="margin-bottom: 15px;">
411
- <div style="font-size: 10px; color: var(--text-secondary); margin-bottom: 6px;">Allowed Domains</div>
412
- <div style="display: flex; gap: 6px; margin-bottom: 8px;">
413
- <input type="text" style="flex: 1; background: var(--bg-primary); border: 1px solid var(--border-color); color: var(--text-primary); padding: 5px 8px; border-radius: 4px; font-size: 10px;" placeholder="e.g., amazon.com">
414
- <button class="btn" style="padding: 5px 10px; font-size: 10px;">+ Add</button>
415
- </div>
416
- <div style="display: flex; flex-wrap: wrap; gap: 5px;">
417
- <span style="background: rgba(34, 197, 94, 0.2); color: #22c55e; padding: 3px 6px; border-radius: 3px; font-size: 9px;">amazon.com ✕</span>
418
- <span style="background: rgba(34, 197, 94, 0.2); color: #22c55e; padding: 3px 6px; border-radius: 3px; font-size: 9px;">google.com ✕</span>
419
- </div>
416
+ <div style="font-size: 10px; color: var(--text-secondary); margin-bottom: 6px;">Control Mode</div>
417
+ <select id="domain-mode" style="width: 100%; padding: 6px; background: var(--bg-primary); border: 1px solid var(--border-color); color: var(--text-primary); border-radius: 4px; font-size: 11px; margin-bottom: 10px;" onchange="saveDomainMode()">
418
+ <option value="blacklist">Blacklist (block specific domains)</option>
419
+ <option value="whitelist">Whitelist (only allow specific domains)</option>
420
+ </select>
420
421
  </div>
421
- <div>
422
- <div style="font-size: 10px; color: var(--text-secondary); margin-bottom: 6px;">Blocked Domains</div>
422
+ <div style="margin-bottom: 15px;">
423
+ <div style="font-size: 10px; color: var(--text-secondary); margin-bottom: 6px;">Add Domain</div>
423
424
  <div style="display: flex; gap: 6px; margin-bottom: 8px;">
424
- <input type="text" style="flex: 1; background: var(--bg-primary); border: 1px solid var(--border-color); color: var(--text-primary); padding: 5px 8px; border-radius: 4px; font-size: 10px;" placeholder="e.g., gambling.com">
425
- <button class="btn" style="padding: 5px 10px; font-size: 10px; background: #dc2626;">+ Add</button>
426
- </div>
427
- <div style="display: flex; flex-wrap: wrap; gap: 5px;">
428
- <span style="background: rgba(220, 38, 38, 0.2); color: #ef4444; padding: 3px 6px; border-radius: 3px; font-size: 9px;">gambling.com ✕</span>
425
+ <input type="text" id="new-domain" style="flex: 1; background: var(--bg-primary); border: 1px solid var(--border-color); color: var(--text-primary); padding: 5px 8px; border-radius: 4px; font-size: 10px;" placeholder="e.g., example.com">
426
+ <button class="btn" onclick="addDomain()" style="padding: 5px 10px; font-size: 10px;">+ Add</button>
429
427
  </div>
430
428
  </div>
431
- <button class="save-section-btn">Save Domain Controls</button>
429
+ <div id="domains-list" style="display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px;">
430
+ <!-- Domains will be loaded here -->
431
+ </div>
432
432
  <div class="clearfix"></div>
433
433
  </div>
434
434
  </div>
@@ -476,25 +476,26 @@
476
476
  </div>
477
477
  <div class="section-body">
478
478
  <div style="margin-bottom: 15px;">
479
- <div style="font-size: 10px; color: var(--text-secondary); margin-bottom: 6px;">Allowed Countries</div>
480
- <div style="display: flex; gap: 6px; margin-bottom: 8px;">
481
- <input type="text" style="flex: 1; background: var(--bg-primary); border: 1px solid var(--border-color); color: var(--text-primary); padding: 5px 8px; border-radius: 4px; font-size: 10px;" placeholder="e.g., Romania">
482
- <button class="btn" style="padding: 5px 10px; font-size: 10px;">+ Add</button>
483
- </div>
484
- <div style="display: flex; flex-wrap: wrap; gap: 5px;">
485
- <span style="background: rgba(34, 197, 94, 0.2); color: #22c55e; padding: 3px 6px; border-radius: 3px; font-size: 9px;">Romania ✕</span>
486
- <span style="background: rgba(34, 197, 94, 0.2); color: #22c55e; padding: 3px 6px; border-radius: 3px; font-size: 9px;">Germany ✕</span>
487
- <span style="background: rgba(34, 197, 94, 0.2); color: #22c55e; padding: 3px 6px; border-radius: 3px; font-size: 9px;">UK ✕</span>
479
+ <div style="display: flex; align-items: center; gap: 8px; margin-bottom: 12px;">
480
+ <input type="checkbox" id="geo-enabled" style="width: 18px; height: 18px; cursor: pointer;" onchange="saveGeoSettings()">
481
+ <span style="font-size: 11px;">Enable geography controls</span>
488
482
  </div>
483
+ <div style="font-size: 10px; color: var(--text-secondary); margin-bottom: 6px;">Mode</div>
484
+ <select id="geo-mode" style="width: 100%; padding: 6px; background: var(--bg-primary); border: 1px solid var(--border-color); color: var(--text-primary); border-radius: 4px; font-size: 11px; margin-bottom: 10px;" onchange="saveGeoSettings()">
485
+ <option value="allow">Allow only these countries</option>
486
+ <option value="block">Block these countries</option>
487
+ </select>
489
488
  </div>
490
- <div>
491
- <div style="font-size: 10px; color: var(--text-secondary); margin-bottom: 6px;">Blocked Countries</div>
489
+ <div style="margin-bottom: 15px;">
490
+ <div style="font-size: 10px; color: var(--text-secondary); margin-bottom: 6px;">Add Country (ISO code)</div>
492
491
  <div style="display: flex; gap: 6px; margin-bottom: 8px;">
493
- <input type="text" style="flex: 1; background: var(--bg-primary); border: 1px solid var(--border-color); color: var(--text-primary); padding: 5px 8px; border-radius: 4px; font-size: 10px;" placeholder="e.g., North Korea">
494
- <button class="btn" style="padding: 5px 10px; font-size: 10px; background: #dc2626;">+ Add</button>
492
+ <input type="text" id="new-country" style="flex: 1; background: var(--bg-primary); border: 1px solid var(--border-color); color: var(--text-primary); padding: 5px 8px; border-radius: 4px; font-size: 10px;" placeholder="e.g., RO, DE, US">
493
+ <button class="btn" onclick="addCountry()" style="padding: 5px 10px; font-size: 10px;">+ Add</button>
495
494
  </div>
496
495
  </div>
497
- <button class="save-section-btn">Save Geography</button>
496
+ <div id="countries-list" style="display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px;">
497
+ <!-- Countries will be loaded here -->
498
+ </div>
498
499
  <div class="clearfix"></div>
499
500
  </div>
500
501
  </div>
@@ -514,28 +515,25 @@
514
515
  </div>
515
516
  <div class="section-body">
516
517
  <div style="margin-bottom: 15px;">
517
- <div style="font-size: 10px; color: var(--text-secondary); margin-bottom: 8px;">Allowed Categories</div>
518
- <div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;">
519
- <div style="background: rgba(34, 197, 94, 0.2); border: 1px solid #22c55e; color: #22c55e; padding: 7px; border-radius: 4px; font-size: 10px; text-align: center;">Groceries</div>
520
- <div style="background: rgba(34, 197, 94, 0.2); border: 1px solid #22c55e; color: #22c55e; padding: 7px; border-radius: 4px; font-size: 10px; text-align: center;">Transport</div>
521
- <div style="background: rgba(34, 197, 94, 0.2); border: 1px solid #22c55e; color: #22c55e; padding: 7px; border-radius: 4px; font-size: 10px; text-align: center;">Utilities</div>
522
- <div style="background: var(--bg-tertiary); border: 1px solid var(--border-color); color: var(--text-secondary); padding: 7px; border-radius: 4px; font-size: 10px; text-align: center;">Shopping</div>
523
- <div style="background: rgba(34, 197, 94, 0.2); border: 1px solid #22c55e; color: #22c55e; padding: 7px; border-radius: 4px; font-size: 10px; text-align: center;">Dining</div>
524
- <div style="background: var(--bg-tertiary); border: 1px solid var(--border-color); color: var(--text-secondary); padding: 7px; border-radius: 4px; font-size: 10px; text-align: center;">Healthcare</div>
525
- <div style="background: rgba(34, 197, 94, 0.2); border: 1px solid #22c55e; color: #22c55e; padding: 7px; border-radius: 4px; font-size: 10px; text-align: center;">Education</div>
526
- <div style="background: var(--bg-tertiary); border: 1px solid var(--border-color); color: var(--text-secondary); padding: 7px; border-radius: 4px; font-size: 10px; text-align: center;">Entertainment</div>
518
+ <div style="font-size: 10px; color: var(--text-secondary); margin-bottom: 6px;">Add Allowed Category</div>
519
+ <div style="display: flex; gap: 6px; margin-bottom: 8px;">
520
+ <input type="text" id="new-allowed-category" style="flex: 1; background: var(--bg-primary); border: 1px solid var(--border-color); color: var(--text-primary); padding: 5px 8px; border-radius: 4px; font-size: 10px;" placeholder="e.g., shopping">
521
+ <button class="btn" onclick="allowCategory()" style="padding: 5px 10px; font-size: 10px;">+ Allow</button>
522
+ </div>
523
+ <div id="allowed-categories-list" style="display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px;">
524
+ <!-- Allowed categories will be loaded here -->
527
525
  </div>
528
526
  </div>
529
- <div>
530
- <div style="font-size: 10px; color: var(--text-secondary); margin-bottom: 8px;">Blocked Categories</div>
531
- <div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;">
532
- <div style="background: rgba(220, 38, 38, 0.2); border: 1px solid #dc2626; color: #ef4444; padding: 7px; border-radius: 4px; font-size: 10px; text-align: center;">Gambling</div>
533
- <div style="background: rgba(220, 38, 38, 0.2); border: 1px solid #dc2626; color: #ef4444; padding: 7px; border-radius: 4px; font-size: 10px; text-align: center;">Crypto</div>
534
- <div style="background: rgba(220, 38, 38, 0.2); border: 1px solid #dc2626; color: #ef4444; padding: 7px; border-radius: 4px; font-size: 10px; text-align: center;">Adult</div>
535
- <div style="background: rgba(220, 38, 38, 0.2); border: 1px solid #dc2626; color: #ef4444; padding: 7px; border-radius: 4px; font-size: 10px; text-align: center;">Drugs</div>
527
+ <div style="margin-bottom: 15px;">
528
+ <div style="font-size: 10px; color: var(--text-secondary); margin-bottom: 6px;">Add Blocked Category</div>
529
+ <div style="display: flex; gap: 6px; margin-bottom: 8px;">
530
+ <input type="text" id="new-blocked-category" style="flex: 1; background: var(--bg-primary); border: 1px solid var(--border-color); color: var(--text-primary); padding: 5px 8px; border-radius: 4px; font-size: 10px;" placeholder="e.g., gambling">
531
+ <button class="btn" onclick="blockCategory()" style="padding: 5px 10px; font-size: 10px; background: #dc2626;">+ Block</button>
532
+ </div>
533
+ <div id="blocked-categories-list" style="display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px;">
534
+ <!-- Blocked categories will be loaded here -->
536
535
  </div>
537
536
  </div>
538
- <button class="save-section-btn">Save Categories</button>
539
537
  <div class="clearfix"></div>
540
538
  </div>
541
539
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payment-skill",
3
- "version": "1.1.3",
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() {