feat(postit): add native PayPal subscription page

Add bearer-authenticated subscription checkout, reconciliation and cancellation on the authority host, reuse web subscription services, and document the flow with regression tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Paul Schneider 2026-11-10 23:57:26 +00:00
commit 7cda466fa8
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
21 changed files with 774 additions and 28 deletions

View file

@ -0,0 +1,32 @@
@baseUrl = https://localhost:5001
@token = replace-with-access-token
@subscriptionId = 00000000-0000-0000-0000-000000000000
### Offers, own subscriptions and balance (authority host, not business API host)
GET {{baseUrl}}/api/v1/resource-subscriptions
Authorization: Bearer {{token}}
### Prepare or resume approval; server owns all prices and PayPal plan identifiers
POST {{baseUrl}}/api/v1/resource-subscriptions
Authorization: Bearer {{token}}
Content-Type: application/json
{"pack":"Discovery"}
### Reconcile verified payments after returning from PayPal
POST {{baseUrl}}/api/v1/resource-subscriptions/refresh
Authorization: Bearer {{token}}
### Cancel own subscription; unknown or foreign identifiers return 404
POST {{baseUrl}}/api/v1/resource-subscriptions/{{subscriptionId}}/cancel
Authorization: Bearer {{token}}
### Browser landing page (anonymous, never grants credit)
GET {{baseUrl}}/api/v1/resource-subscriptions/return
### Invalid pack: 400
POST {{baseUrl}}/api/v1/resource-subscriptions
Authorization: Bearer {{token}}
Content-Type: application/json
{"pack":"Unknown"}