Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ billing/VENTA_V10_PROFORMA.json
logs/ip_access.jsonl
logs/IP_WATCH.md
logs/LAFAYETTE_TTC_MONITOR.md
logs/SISTEMA_SUSPENDIDO.jsonlupdate_stripe.py
logs/SISTEMA_SUSPENDIDO.jsonl
logs/*.jsonl
logs/*.log
update_stripe.py
update_stripe_v10.py
activate_royalties_v10.py
monetizacion_trace_demo.log
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ Aquí la moda deja de depender de tablas de tallas que nacieron para simplificar
| Lenguaje | Trilingüe: **FR / EN / ES** |
| Horizonte | Enterprise retail, infraestructura propia y soberanía tecnológica |

## TRYONYOU x Galeries Lafayette: The Stirpe Edition

**Protocolo de Soberanía V10 Omega** *Patente Internacional: PCT/EP2025/067317*

### "Cuando el cuero supera al oro y el capricho se vuelve divisa..."

Este repositorio no contiene ropa. Contiene **Soberanía Digital**.

- **Engine:** Zero-Size Algorithm (Eliminación de la mediocridad biométrica).
- **Vibe:** Eric Lafayette Refined Style.
- **Goal:** Invertir en Birkins, encontrar el pavo blanco y dominar el 2026.

**¡A FUEGO! ¡VIVIDO! ¡BOOM!**

## Why this exists

The old fashion stack was built around approximation. Approximate size charts. Approximate fit confidence. Approximate post-purchase certainty. The consequence has been enormous: high return rates, abandoned carts, broken margins, operational waste and a customer experience that asks people to guess.
Expand Down
6 changes: 4 additions & 2 deletions api/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,11 @@ def _advbet_payload(*, session_id: str, amount_eur: float) -> dict[str, object]:
}


@app.route("/")
@app.route("/", methods=["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"])
def home():
return "API Active"
if request.method == "GET":
return "API Active"
return jsonify({"status": "error", "message": "Not Found"}), 404
Comment on lines +501 to +505


def _cors(resp):
Expand Down
65 changes: 0 additions & 65 deletions logs/sovereignty_access_audit.jsonl

This file was deleted.

21 changes: 17 additions & 4 deletions stripe_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

from stripe_fr_resolve import resolve_stripe_secret_fr

_SIREN = "943 610 196"
_PATENT = "PCT/EP2025/067317"

_list_cache_lock = threading.Lock()
_list_cache: dict[str, tuple[float, dict[str, Any]]] = {}
Expand Down Expand Up @@ -132,8 +134,10 @@ def create_product(
params: dict[str, Any] = {"name": name}
if description:
params["description"] = description
base_meta: dict[str, str] = {"siren": _SIREN, "patent": _PATENT}
if metadata:
params["metadata"] = metadata
base_meta.update(metadata)
params["metadata"] = base_meta
Comment on lines +137 to +140
product = stripe.Product.create(**params)
return {"ok": True, "product_id": product.id, "product": product}
except stripe.error.StripeError as exc:
Expand Down Expand Up @@ -183,11 +187,18 @@ def list_products(
"""
stripe.api_key = _get_stripe_client()
try:
params: dict[str, Any] = {"limit": max(1, min(limit, 100))}
clamped_limit = max(1, min(limit, 100))
cache_key = _list_cache_key("products", active=active, limit=clamped_limit, paginate=paginate)
cached = _cache_get(cache_key)
if cached is not None:
return cached
params: dict[str, Any] = {"limit": clamped_limit}
if active is not None:
params["active"] = active
result = stripe.Product.list(**params)
return {"ok": True, "products": _stripe_list_items(result, paginate=paginate)}
payload = {"ok": True, "products": _stripe_list_items(result, paginate=paginate)}
_cache_set(cache_key, payload)
return payload
except stripe.error.StripeError as exc:
return {"ok": False, "error": str(exc.user_message or exc)}
except Exception as exc:
Expand Down Expand Up @@ -250,8 +261,10 @@ def create_price(
}
if recurring:
params["recurring"] = recurring
base_meta: dict[str, str] = {"siren": _SIREN, "patent": _PATENT}
if metadata:
params["metadata"] = metadata
base_meta.update(metadata)
params["metadata"] = base_meta
Comment on lines +264 to +267
price = stripe.Price.create(**params)
return {"ok": True, "price_id": price.id, "price": price}
except stripe.error.StripeError as exc:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_balance_soberana.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_prints_header_line(self) -> None:
finally:
sys.stdout = sys.__stdout__
output = captured.getvalue()
self.assertIn("ESTADO FINANCIERO TOTAL: TRYONYOU V10", output)
self.assertIn("ESTADO FINANCIERO TOTAL: TRYONYOU V12", output)


class TestBalanceSoberanaConstants(unittest.TestCase):
Expand Down
4 changes: 3 additions & 1 deletion tests/test_root_route_protection.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def test_post_root_is_blocked(self) -> None:
},
)
self.assertEqual(response.status_code, 404)
self.assertEqual(response.json, {"status": "error", "message": "Not Found"})
data = response.json
self.assertEqual(data.get("status"), "error")
self.assertEqual(data.get("message"), "Not Found")
self.assertEqual(response.headers.get("Access-Control-Allow-Origin"), "*")

def test_vercel_routes_forward_mutating_root_to_api(self) -> None:
Expand Down
1 change: 1 addition & 0 deletions tests/test_stripe_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def test_retrieve_product_invalid_id(self) -> None:
class TestListProducts(unittest.TestCase):
def setUp(self) -> None:
os.environ["STRIPE_SECRET_KEY_FR"] = "sk_test_dummy"
stripe_agent.clear_stripe_list_cache()

def test_list_products_success(self) -> None:
mock_iter = [MagicMock(id="prod_1"), MagicMock(id="prod_2")]
Expand Down