Merge branch 'master' into badges

This commit is contained in:
spaced4ndy
2026-09-02 13:53:35 +04:00
114 changed files with 13939 additions and 1052 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ A timeout hides the outcome, so the client repeats the identical signed request
## Commands
`purchaseBadge`, `upgradeBadgeSubscription`, and `issueBadge` carry `badgeRequest`, the signer's input (`BadgeRequest`, `Simplex.Chat.Badges`): the service signs exactly this content or rejects the command. The proposed `badgeExpiry` is capped by the funded coverage (`sundayAfter`, model §3); its absence requests a lifetime credential; `badgeExtra` is reserved and must be empty.
`purchaseBadge`, `upgradeBadgeSubscription`, and `issueBadge` carry `badgeRequest`, the signer's input (`BadgeRequest`, `Simplex.Chat.Badges`): the service signs exactly this content or rejects the command. The proposed `badgeExpiry` is capped by the funded coverage (`sundayAfter`, model §3) and is required — a credential always expires, and a badge that does not is expressed as a long finite term; `badgeExtra` is reserved and must be empty.
- `getBadgeCatalog``badgeCatalog` — the prices and offers; signed, also the purchase's `badgeStatement`. Store builds never send it: prices come from the store and SKUs from app config.
- `getBadgeInvoice``badgeInvoice` — prices the purchase for `badgeInfo` and `paymentVia` (`card` — Stripe; `crypto` — btc, xmr). The response holds the generic `invoice``invoiceId`, `price`, `discount`, the upgrade `credit`, `amount` = price discount credit, `currency`, `expiresAt`, and `paymentTo` (`url` for card; `address` and `cryptoAmount` for crypto) — beside the badge part, `badgeType` and `months`. `priceId` pins the price the client displayed; `offerId` selects a discounted duration, and its absence buys one month at that price. Price and offer status is checked here only: `deprecated` is still accepted, `disabled` is rejected; a badge type with no active price yields `product_unavailable`.
+1 -3
View File
@@ -18,9 +18,7 @@
"badgeInfo": {
"properties": {
"badgeType": {"type": "string"},
"badgeExtra": {"type": "string"}
},
"optionalProperties": {
"badgeExtra": {"type": "string"},
"badgeExpiry": {"type": "timestamp"}
}
},