From b5ff72baebe0ca268adeaeb1ff111805495e2f0e Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Fri, 28 Oct 2022 13:29:48 -0400
Subject: [PATCH] start a doc about payment workflow

---
 docs/ops/stripe.rst | 72 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 docs/ops/stripe.rst

diff --git a/docs/ops/stripe.rst b/docs/ops/stripe.rst
new file mode 100644
index 00000000..03f259f9
--- /dev/null
+++ b/docs/ops/stripe.rst
@@ -0,0 +1,72 @@
+We use Stripe for payment processing.
+We have test-mode keys for use in staging and live-mode keys for use in production.
+
+There is "product" state in Stripe to facilitate the payment workflow.
+This was created with ``admin/create-product.sh``
+(once for test-mode and once for live-mode).
+
+The test-mode product is:
+
+```js
+{
+  "id": "prod_MhKpVSNW6zAsOG",
+  "object": "product",
+  "active": true,
+  "attributes": [],
+  "created": 1666977337,
+  "default_price": "price_1Lxw9dBHXBAMm9bPgDW93Bwz",
+  "description": "30 GiB-months of Private.Storage storage × time",
+  "images": [],
+  "livemode": false,
+  "metadata": {},
+  "name": "30 GiB-months",
+  "package_dimensions": null,
+  "shippable": null,
+  "statement_descriptor": "PRIVATE STORAGE",
+  "tax_code": null,
+  "type": "service",
+  "unit_label": null,
+  "updated": 1666977337,
+  "url": "https://private.storage/"
+}
+```
+
+The live-mode product is:
+
+```js
+XXX
+```
+
+There is also "webhook" state in Stripe so that PaymentServer receives notification of payment.
+This was created with ``admin/create-webhook.sh``
+(once for test-mode and once for live-mode).
+
+The test-mode webhook is:
+
+```js
+{
+  "id": "we_1LxwKnBHXBAMm9bPDJXJNcDN",
+  "object": "webhook_endpoint",
+  "api_version": null,
+  "application": null,
+  "created": 1666978029,
+  "description": null,
+  "enabled_events": [
+    "checkout.session.completed"
+  ],
+  "livemode": false,
+  "metadata": {},
+  "secret": "<REDACTED>"",
+  "status": "enabled",
+  "url": "https://payments.privatestorage-staging.com/v1/stripe/webhook"
+}
+```
+
+The live-mode webhook is:
+
+```js
+XXX
+```
+
+The webhook secrets are redacted here.
+They can be found with the rest of the each grid's private keys.
-- 
GitLab