mirror of
https://github.com/anikeen-com/id.git
synced 2026-11-06 23:58:35 +00:00
Document per-app collective orders and the order's oauth_client_id
Collective orders are kept per app on Anikeen ID now: an app's subscriptions are never billed on another app's order, even with the same group. Document oauth_client_id on orders (Order property, app orders) and how legacy orders that billed several apps appear (own lines only, invoice PDF refused with 403 invoice_includes_other_apps).
This commit is contained in:
4 files changed
+26
-9
No files matched your search
@@ -13,12 +13,14 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* scope orders:client) - of one user ($user->appOrders()) or of all users
|
||||
* (app(AnikeenId::class)->appOrders()). Nothing is requested until a method is called.
|
||||
*
|
||||
* Each order is an object with id, user_id, group, metadata, status
|
||||
* (processing|pending|completed|cancelled), is_collective, net_total, vat_total, gross_total,
|
||||
* currency_iso, created_at, paid_at, payment_attempts, next_payment_attempt_at,
|
||||
* last_payment_error ({code, message} or null), and
|
||||
* Each order is an object with id, user_id, oauth_client_id (the app that bills it: collective
|
||||
* orders are kept per app, even for the same group; null on legacy orders that billed several
|
||||
* apps), group, metadata, status (processing|pending|completed|cancelled), is_collective,
|
||||
* net_total, vat_total, gross_total, currency_iso, created_at, paid_at, payment_attempts,
|
||||
* next_payment_attempt_at, last_payment_error ({code, message} or null), and
|
||||
*
|
||||
* - items: all lines of the order, each {id, name, description, type, image_url, units, unit,
|
||||
* - items: the order's lines of the app's subscriptions (all lines, except on legacy orders that
|
||||
* also billed other apps), each {id, name, description, type, image_url, units, unit,
|
||||
* price, vat_rate, subscription_id, meter, monthly_cap, discount, period_start, period_end,
|
||||
* net_amount, vat_amount, gross_amount}. period_end is exclusive (the start of the next
|
||||
* period); both are null for lines without a period. discount ({label, percent_off,
|
||||
|
||||
@@ -9,6 +9,9 @@ use Throwable;
|
||||
/**
|
||||
* @property string $id
|
||||
* @property null|string $confirmation_url where the user confirms it (third-party apps, or `confirm`)
|
||||
* @property null|string $oauth_client_id the app that bills the order: the app that created it, or for a monthly
|
||||
* (collective) order the app whose subscriptions it bills; collective orders
|
||||
* are kept per app. null for Anikeen's own (and legacy orders of several apps)
|
||||
* @property null|string $group
|
||||
* @property null|object $metadata the app's own data, returned as is
|
||||
* @property null|string $return_url where the user returns after confirming
|
||||
|
||||
Reference in new issue
Block a user