@openrails/billing-ui 0.254.0 → 0.256.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/dist/account/cancel-dialog.d.ts +2 -2
- package/dist/account/subscriptions-panel.d.ts +1 -2
- package/dist/admin/lib/api/types.d.ts +1 -1
- package/dist/admin/messages.d.ts +8 -5
- package/dist/admin/pages/catalog/price-format.d.ts +3 -1
- package/dist/admin/pages/catalog/psp-links.d.ts +1 -1
- package/dist/{admin-catalog-rrFZd5N8.js → admin-catalog-C0QRANp7.js} +8 -11
- package/dist/{admin-catalog-rrFZd5N8.js.map → admin-catalog-C0QRANp7.js.map} +1 -1
- package/dist/{admin-detail-Cq59e14B.js → admin-detail-qetSqVDt.js} +2 -2
- package/dist/{admin-detail-Cq59e14B.js.map → admin-detail-qetSqVDt.js.map} +1 -1
- package/dist/{admin-price-detail-Bwk9PXHP.js → admin-price-detail-C9CJwLeM.js} +101 -128
- package/dist/admin-price-detail-C9CJwLeM.js.map +1 -0
- package/dist/{admin-price-format-DM1qORWI.js → admin-price-format-BVUpDoSC.js} +5 -1
- package/dist/admin-price-format-BVUpDoSC.js.map +1 -0
- package/dist/{admin-price-wizard-ByD7j8mB.js → admin-price-wizard-DAkDGWkH.js} +123 -124
- package/dist/admin-price-wizard-DAkDGWkH.js.map +1 -0
- package/dist/admin.css +1 -1
- package/dist/admin.js +13 -10
- package/dist/admin.js.map +1 -1
- package/dist/client/client.d.ts +4 -4
- package/dist/client/generated/error-codes.d.ts +1 -1
- package/dist/client/generated/routes.d.ts +29 -12
- package/dist/client/generated/wire.d.ts +62 -21
- package/dist/client/types.d.ts +119 -20
- package/dist/{client-B301IAQD.js → client-Bs2YY-PV.js} +19 -3
- package/dist/client-Bs2YY-PV.js.map +1 -0
- package/dist/client.js +1 -1
- package/dist/{hooks-DARbMTwv.js → hooks-CCA-6uEa.js} +134 -123
- package/dist/{hooks-DARbMTwv.js.map → hooks-CCA-6uEa.js.map} +1 -1
- package/dist/index.js +729 -716
- package/dist/index.js.map +1 -1
- package/dist/locales/de.js +1 -0
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/en.d.ts +1 -0
- package/dist/locales/en.js +1 -0
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es.js +1 -0
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/ja.js +1 -0
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/ko.js +1 -0
- package/dist/locales/ko.js.map +1 -1
- package/dist/locales/zh.js +1 -0
- package/dist/locales/zh.js.map +1 -1
- package/dist/react/hooks.d.ts +3 -4
- package/dist/react.js +1 -1
- package/package.json +1 -1
- package/dist/admin-price-detail-Bwk9PXHP.js.map +0 -1
- package/dist/admin-price-format-DM1qORWI.js.map +0 -1
- package/dist/admin-price-wizard-ByD7j8mB.js.map +0 -1
- package/dist/client-B301IAQD.js.map +0 -1
package/README.md
CHANGED
|
@@ -183,7 +183,7 @@ const billing = createBillingClient({ baseUrl: "/billing/v1", fetch: auth.authFe
|
|
|
183
183
|
<AccountBilling
|
|
184
184
|
plansHref="/plans"
|
|
185
185
|
defaultCurrency="USD" // offers "Make default"
|
|
186
|
-
sendSolanaTransaction={(tx) => wallet.signAndSend(tx)} //
|
|
186
|
+
sendSolanaTransaction={(tx) => wallet.signAndSend(tx)} // optional on-chain cancellation
|
|
187
187
|
/>
|
|
188
188
|
</BillingProvider>
|
|
189
189
|
```
|
|
@@ -276,10 +276,11 @@ const change = await billing.changeSubscription(sub.id, {
|
|
|
276
276
|
`next_action`. Solana's is `solana_sign_transactions`:
|
|
277
277
|
`signWalletAction(change.next_action, send)` signs and sends its
|
|
278
278
|
transactions and returns the signature; repeat `changeSubscription` with the same
|
|
279
|
-
key and `signature`. `cancelSubscription(id, { reason
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
`sendTransaction
|
|
279
|
+
key and `signature`. `cancelSubscription(id, { reason })` cancels at
|
|
280
|
+
period end without a wallet. Set `revokeOnChain: true` to also request an
|
|
281
|
+
optional wallet step; local cancellation has already taken effect. The
|
|
282
|
+
cancel hook signs this additional step when passed `sendTransaction` and
|
|
283
|
+
`revokeOnChain: true`.
|
|
283
284
|
|
|
284
285
|
## Provider-neutral flows
|
|
285
286
|
|
|
@@ -7,12 +7,12 @@ export interface CancelSubscriptionDialogProps {
|
|
|
7
7
|
onOpenChange: (open: boolean) => void;
|
|
8
8
|
/** Subscription display name. */
|
|
9
9
|
name: string;
|
|
10
|
-
/**
|
|
10
|
+
/** Offers an optional on-chain cancellation when a wallet is available. */
|
|
11
11
|
onChain?: boolean;
|
|
12
12
|
/** In-flight stage, when cancelling. */
|
|
13
13
|
pending?: SubscriptionAction;
|
|
14
14
|
/** Resolves null on success; the dialog then closes. */
|
|
15
|
-
onConfirm: (reason: string) => Promise<BillingError | null>;
|
|
15
|
+
onConfirm: (reason: string, revokeOnChain: boolean) => Promise<BillingError | null>;
|
|
16
16
|
appearance?: BillingAppearance;
|
|
17
17
|
}
|
|
18
18
|
export declare function CancelSubscriptionDialog({ open, onOpenChange, name, onChain, pending, onConfirm, appearance, }: CancelSubscriptionDialogProps): React.JSX.Element;
|
|
@@ -5,8 +5,7 @@ import { SubscriptionsOptions } from '../react/hooks';
|
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
export interface SubscriptionsPanelProps extends SubscriptionsOptions {
|
|
7
7
|
/**
|
|
8
|
-
* Wallet for
|
|
9
|
-
* hidden.
|
|
8
|
+
* Wallet for an optional on-chain cancellation of Solana subscriptions.
|
|
10
9
|
*/
|
|
11
10
|
sendSolanaTransaction?: SendSolanaTransaction;
|
|
12
11
|
/** Empty-state link to the host's plans page (uses `navigate` if set). */
|
|
@@ -68,7 +68,7 @@ export type AdminSubscription = RawSubscription;
|
|
|
68
68
|
export type { ChangeSubscriptionParams, SubscriptionChange, SubscriptionChangePreview, } from '../../../client/generated/wire';
|
|
69
69
|
export type UsageAggregation = "sum" | "count" | "max" | "min" | "unique_count" | "latest";
|
|
70
70
|
export type UsagePriceModel = "per_unit" | "tiered" | "package";
|
|
71
|
-
export type PSPRoutingSkip = "unknown_selector" | "ambiguous_selector" | "not_armed" | "credentials_missing" | "link_missing" | "mode_unsupported" | "posture_disarmed" | "service_unavailable" | "resolve_failed";
|
|
71
|
+
export type PSPRoutingSkip = "unknown_selector" | "ambiguous_selector" | "not_armed" | "credentials_missing" | "link_missing" | "not_sold_via" | "not_a_charge_psp" | "provider_price" | "mode_unsupported" | "posture_disarmed" | "service_unavailable" | "resolve_failed";
|
|
72
72
|
export interface PSPRoutingCandidate {
|
|
73
73
|
psp: string;
|
|
74
74
|
rail: Rail;
|
package/dist/admin/messages.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
/** English message keys. Override individual entries with BillingAdmin.messages. */
|
|
2
2
|
export declare const billingAdminMessages: {
|
|
3
|
+
readonly "Sold by OpenRails": "Sold by OpenRails";
|
|
4
|
+
readonly "OpenRails bills this price through your card vault and charge PSPs, and on Solana. Provider catalogs are not synchronized. Hosted one-time Stripe payments use inline checkout objects.": "OpenRails bills this price through your card vault and charge PSPs, and on Solana. Provider catalogs are not synchronized. Hosted one-time Stripe payments use inline checkout objects.";
|
|
5
|
+
readonly "Sold via: ": "Sold via: ";
|
|
6
|
+
readonly "every method you have": "every method you have";
|
|
7
|
+
readonly "Solana plan ": "Solana plan ";
|
|
8
|
+
readonly "Owned by its provider": "Owned by its provider";
|
|
9
|
+
readonly "The provider owns and runs this price; OpenRails read its terms and never writes it. Verify asks the provider what it holds now, and changes nothing.": "The provider owns and runs this price; OpenRails read its terms and never writes it. Verify asks the provider what it holds now, and changes nothing.";
|
|
10
|
+
readonly "'s price": "'s price";
|
|
3
11
|
readonly " Edit widget": " Edit widget";
|
|
4
12
|
readonly " Price": " Price";
|
|
5
13
|
readonly " Product": " Product";
|
|
@@ -375,7 +383,6 @@ export declare const billingAdminMessages: {
|
|
|
375
383
|
readonly "Notes ": "Notes ";
|
|
376
384
|
readonly "Nothing here can be fixed automatically. You can only note why you are leaving it.": "Nothing here can be fixed automatically. You can only note why you are leaving it.";
|
|
377
385
|
readonly "Nothing in this range. Pick a wider range.": "Nothing in this range. Pick a wider range.";
|
|
378
|
-
readonly "Nothing is claimed about the providers' copies until you press Verify.": "Nothing is claimed about the providers' copies until you press Verify.";
|
|
379
386
|
readonly "Nothing needs attention right now.": "Nothing needs attention right now.";
|
|
380
387
|
readonly "Notice period": "Notice period";
|
|
381
388
|
readonly "Notice period (days)": "Notice period (days)";
|
|
@@ -419,7 +426,6 @@ export declare const billingAdminMessages: {
|
|
|
419
426
|
readonly "Payment method": "Payment method";
|
|
420
427
|
readonly "Payment methods": "Payment methods";
|
|
421
428
|
readonly "Payment not found.": "Payment not found.";
|
|
422
|
-
readonly "Payment providers": "Payment providers";
|
|
423
429
|
readonly "Payment rail": "Payment rail";
|
|
424
430
|
readonly "Payment reference": "Payment reference";
|
|
425
431
|
readonly "Payment terms (days)": "Payment terms (days)";
|
|
@@ -543,7 +549,6 @@ export declare const billingAdminMessages: {
|
|
|
543
549
|
readonly "Select product": "Select product";
|
|
544
550
|
readonly "Send alerts to Discord, Slack, or your own endpoint.": "Send alerts to Discord, Slack, or your own endpoint.";
|
|
545
551
|
readonly "Send email alerts to this address.": "Send email alerts to this address.";
|
|
546
|
-
readonly Sent: "Sent";
|
|
547
552
|
readonly "Set how much notice customers receive before a price increase.": "Set how much notice customers receive before a price increase.";
|
|
548
553
|
readonly "Set the price that charges every customer's usage as it is recorded. Money is entered in major currency units.": "Set the price that charges every customer's usage as it is recorded. Money is entered in major currency units.";
|
|
549
554
|
readonly Settings: "Settings";
|
|
@@ -591,7 +596,6 @@ export declare const billingAdminMessages: {
|
|
|
591
596
|
readonly "This billing page does not exist.": "This billing page does not exist.";
|
|
592
597
|
readonly "This is a price": "This is a price";
|
|
593
598
|
readonly "This meter uses an aggregation that the billing engine cannot rate.": "This meter uses an aggregation that the billing engine cannot rate.";
|
|
594
|
-
readonly "This price has not been sent to any provider, so nobody can be charged for it yet.": "This price has not been sent to any provider, so nobody can be charged for it yet.";
|
|
595
599
|
readonly Tier: "Tier";
|
|
596
600
|
readonly "Tier group": "Tier group";
|
|
597
601
|
readonly "Tier mode": "Tier mode";
|
|
@@ -636,7 +640,6 @@ export declare const billingAdminMessages: {
|
|
|
636
640
|
readonly Webhooks: "Webhooks";
|
|
637
641
|
readonly "What the customer asked for": "What the customer asked for";
|
|
638
642
|
readonly "Which provider would take the money if someone bought this right now, and why the others were passed over. This asks the same question a real purchase asks, without starting one.": "Which provider would take the money if someone bought this right now, and why the others were passed over. This asks the same question a real purchase asks, without starting one.";
|
|
639
|
-
readonly "Which providers this price has been sent to, and whether their copy still matches yours. Publishing the catalog is what sends it; this page only reports. Verify asks each provider what it currently holds, and changes nothing.": "Which providers this price has been sent to, and whether their copy still matches yours. Publishing the catalog is what sends it; this page only reports. Verify asks each provider what it currently holds, and changes nothing.";
|
|
640
643
|
readonly Why: "Why";
|
|
641
644
|
readonly "Why it was granted": "Why it was granted";
|
|
642
645
|
readonly "Widget menu": "Widget menu";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { Price } from '../../../client/generated/wire';
|
|
2
|
-
export declare function priceIntervalLabel(price: Pick<Price, "billing_interval_hours" | "access_duration_hours">
|
|
2
|
+
export declare function priceIntervalLabel(price: Pick<Price, "billing_interval_hours" | "access_duration_hours"> & {
|
|
3
|
+
billing_interval_months?: number | null;
|
|
4
|
+
}): string;
|
|
3
5
|
export declare function priceAmountLabel(price: Pick<Price, "unit_amount" | "currency" | "customer_amount">): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Price } from '../../../client/generated/wire';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function PriceOwnerCard({ price, verifying, verified, onVerify, }: {
|
|
3
3
|
price: Price;
|
|
4
4
|
verifying: boolean;
|
|
5
5
|
verified: boolean;
|
|
@@ -15,10 +15,10 @@ import { a as N, i as P, n as F, o as I, r as L, s as R, t as z } from "./admin-
|
|
|
15
15
|
import { t as B } from "./admin-label-BzJpr3lg.js";
|
|
16
16
|
import { t as ne } from "./admin-switch-S4g_ppaU.js";
|
|
17
17
|
import { n as re, r as ie } from "./admin-dialog-width-BPrgdYlj.js";
|
|
18
|
-
import { i as V, n as ae, r as oe, t as se } from "./admin-price-format-
|
|
18
|
+
import { i as V, n as ae, r as oe, t as se } from "./admin-price-format-BVUpDoSC.js";
|
|
19
19
|
import { t as ce } from "./admin-textarea-DK1Fq31x.js";
|
|
20
20
|
import { r as le, t as ue } from "./admin-card-DGbi6ZHZ.js";
|
|
21
|
-
import { t as de } from "./admin-price-wizard-
|
|
21
|
+
import { t as de } from "./admin-price-wizard-DAkDGWkH.js";
|
|
22
22
|
import * as H from "react";
|
|
23
23
|
import { useMutation as U, useQuery as W, useQueryClient as G } from "@tanstack/react-query";
|
|
24
24
|
import { Fragment as fe, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
@@ -850,15 +850,12 @@ function Fe({ price: e, product: t }) {
|
|
|
850
850
|
/* @__PURE__ */ K(k, { children: ae(e) }),
|
|
851
851
|
/* @__PURE__ */ K(k, { children: /* @__PURE__ */ K("span", {
|
|
852
852
|
className: "flex flex-wrap gap-1",
|
|
853
|
-
children:
|
|
853
|
+
children: e.provider ? /* @__PURE__ */ q(M, {
|
|
854
854
|
variant: "secondary",
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
": ",
|
|
860
|
-
t.status
|
|
861
|
-
]
|
|
855
|
+
children: [e.provider.psp, /* @__PURE__ */ K(i, { id: "'s price" })]
|
|
856
|
+
}) : (e.sell_via ?? []).map((e) => /* @__PURE__ */ K(M, {
|
|
857
|
+
variant: "secondary",
|
|
858
|
+
children: e
|
|
862
859
|
}, e))
|
|
863
860
|
}) }),
|
|
864
861
|
/* @__PURE__ */ K(k, { children: e.archived ? /* @__PURE__ */ K(M, {
|
|
@@ -1196,4 +1193,4 @@ function $({ label: t, id: n, hint: r, children: i }) {
|
|
|
1196
1193
|
//#endregion
|
|
1197
1194
|
export { ke as CatalogDriftPage, Oe as CatalogPricesPage, De as CatalogProductsPage };
|
|
1198
1195
|
|
|
1199
|
-
//# sourceMappingURL=admin-catalog-
|
|
1196
|
+
//# sourceMappingURL=admin-catalog-C0QRANp7.js.map
|