File size: 1,897 Bytes
3ec0f02 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | ---
title: Protocol Card Binding
emoji: 🔗
colorFrom: blue
colorTo: indigo
sdk: docker
app_port: 7860
pinned: false
---
# Protocol Card Binding
# Protocol Card Binding - Sanitized Source
Current card-binding, default-payment-method, temporary Checkout initialization, concurrent batch extraction and protocol-payment source.
## Modules
- `app.py`: API, jobs, concurrency, cancellation and retry.
- `card_bind_session.py`: SetupIntent and Stripe publishable-key resolution.
- `card_set_default.py`: Attach and set the default PaymentMethod.
- `card_checkout_context.py`: Checkout and CustomerSession context.
- `server_confirmation_token.py`: ConfirmationToken helper.
- `ph_checkout_protocol.py`: Short-checkout protocol flow.
- `static/`, `templates/`: Binding and protocol-payment frontend.
## Flow
1. Create SetupIntent with an account access token.
2. If Stripe context/key is missing, create one temporary Checkout.
3. Fetch a fresh SetupIntent and key.
4. Confirm binding through Stripe.js.
5. Set the PaymentMethod as default.
6. Run binding and extraction with concurrency up to 200.
7. Release final payments in simultaneous waves of up to 200 accounts.
8. Verify every paid account against the Plus subscription endpoint.
9. Failed rows cancel their old child task and retry independently.
## Deployment
Install `requirements.txt`, copy `.env.example` to `.env`, configure the local account archive and internal service endpoints, then run behind Flask/Gunicorn.
## Sanitization
Excluded `.env`, accounts, tasks, logs, screenshots, runtime data, backups, caches and virtual environments. Deployment hostnames, server IPs, tokens and keys were removed or replaced.
## Spaces runtime
This Space listens on port `7860` and starts with Gunicorn. Configure runtime values as Space Variables/Secrets; do not commit a live `.env` file.
|