Diff -- /var/www/vhosts/3dshawn.com/shop.3dshawn.com/MODS/ShopCart/Marketplaces.pm
Diff

/var/www/vhosts/3dshawn.com/shop.3dshawn.com/MODS/ShopCart/Marketplaces.pm

added on local at 2026-07-02 20:44:44

Added
+41
lines
Removed
-0
lines
Context
0
unchanged
Blobs
from
to 864899908bc8
Restore this content →
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.
1package MODS::ShopCart::Marketplaces;
2#======================================================================
3# ShopCart -- Marketplaces registry (stub).
4#
5# Placeholder for a future registry of external marketplaces (Amazon,
6# Etsy, eBay, Walmart, TikTok Shop, etc.) with per-platform metadata
7# used by sales_reports.cgi to render "awaiting adapter" cards for any
8# marketplace_accounts row the user has connected.
9#
10# Every caller already has ($p && $p->{key}) fallbacks so returning
11# undef from by_slug() is safe -- the CGI just falls back to ucfirst()
12# on the raw platform slug.
13#
14# Populate the %CATALOG below (or wire it to a DB table) when the
15# actual adapters ship.
16#======================================================================
17use strict;
18use warnings;
19
20my %CATALOG = (
21 # slug => { name => '...', fees => '...', sells => '...', icon => '...' }
22);
23
24sub new {
25 my ($class) = @_;
26 return bless { }, $class;
27}
28
29sub by_slug {
30 my ($self, $slug) = @_;
31 return undef unless defined $slug && length $slug;
32 $slug = lc $slug;
33 return $CATALOG{$slug};
34}
35
36sub all {
37 my ($self) = @_;
38 return \%CATALOG;
39}
40
411;
Keyboard: j next diff k previous diff g top G bottom r restore c compile-check ? help