mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-09-21 09:36:18 +00:00
Merge branch 'master' into badges
This commit is contained in:
@@ -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`.
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
"badgeInfo": {
|
||||
"properties": {
|
||||
"badgeType": {"type": "string"},
|
||||
"badgeExtra": {"type": "string"}
|
||||
},
|
||||
"optionalProperties": {
|
||||
"badgeExtra": {"type": "string"},
|
||||
"badgeExpiry": {"type": "timestamp"}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user