palbase 0.77.0 → 0.78.1
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/dist/ai/index.js +2 -2
- package/dist/ai-sdk/index.js +2 -2
- package/dist/backend/engine.js +2 -2
- package/dist/backend/env.js +1 -1
- package/dist/backend/index.js +3 -3
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/{34HGL5FX.js → 25KG2TVU.js} +1 -1
- package/dist/chunks/{GFBWGJW3.js → 2T3EX52E.js} +1 -1
- package/dist/chunks/{VOLGPAPR.js → 35KQJQ77.js} +2 -2
- package/dist/chunks/{ES24JS2D.js → 3TJFV35H.js} +2 -2
- package/dist/chunks/{FN5763FR.js → 3XF644A5.js} +2 -2
- package/dist/chunks/426QPZNS.js +13 -0
- package/dist/chunks/{U4VX7NKX.js → 4XE4HLPK.js} +2 -2
- package/dist/chunks/{WXT24CE5.js → 5KGMQFET.js} +1 -1
- package/dist/chunks/6Y4ICGZ7.js +2 -0
- package/dist/chunks/{G3PH5T6N.js → EUMY6SCM.js} +1 -1
- package/dist/chunks/{IZVBCAKH.js → FCCX2OTM.js} +2 -2
- package/dist/chunks/{RQJ4MX2H.js → IO5HB5B6.js} +2 -2
- package/dist/chunks/{AUOFL6RB.js → JY7YG3BO.js} +2 -2
- package/dist/chunks/{RRS7TQKX.js → L63FWRZX.js} +2 -2
- package/dist/chunks/{ONLXIZ6E.js → LONPNPNX.js} +2 -2
- package/dist/chunks/{DENZSXKJ.js → LXS7JHPJ.js} +2 -2
- package/dist/chunks/{QWXF6KWI.js → QWKOKJKM.js} +1 -1
- package/dist/chunks/{7RTPVUIH.js → RB4JQXKZ.js} +2 -2
- package/dist/chunks/{BDHVYVWT.js → ROV6TJZK.js} +1 -1
- package/dist/chunks/{KLK7HZZ7.js → TFPVJ3C3.js} +3 -3
- package/dist/chunks/{JOVXELK5.js → UUDOMSKW.js} +2 -2
- package/dist/chunks/{FE7ZBADH.js → VNUCKM7H.js} +1 -1
- package/dist/chunks/{ZZNNCI6A.js → WTFMJKDB.js} +2 -2
- package/dist/chunks/{F6OGRDZB.js → ZBTOHVML.js} +2 -2
- package/dist/chunks/{CYNLRAAW.js → ZIHVYOXE.js} +2 -2
- package/dist/cli.js +7 -3
- package/dist/cloud/index.js +2 -2
- package/dist/refuse/ai-sdk.js +1 -1
- package/dist/refuse/ai.js +1 -1
- package/dist/refuse/backend.js +1 -1
- package/dist/refuse/cloud.js +1 -1
- package/dist/refuse/server.js +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/testing.js +2 -2
- package/dist/web/index.js +2 -2
- package/dist/web/message.js +2 -2
- package/dist/web/palbe.js +2 -2
- package/dist/web/payments-ui.js +2 -2
- package/dist/web/paywall.js +2 -2
- package/dist/web/push-sw.js +1 -1
- package/dist/web/ssr.js +2 -2
- package/dist/web/vite.js +2 -2
- package/package.json +2 -2
- package/types/ai/src/chats.d.ts +7 -0
- package/types/backend/src/gateways.d.ts +2 -1
- package/types/cloud/src/generated/project.d.ts +1 -1
- package/types/internal/src/chat.d.ts +28 -0
- package/types/internal/src/modules/ai.d.ts +11 -7
- package/types/internal/src/modules/payments.d.ts +366 -24
- package/types/web/src/chat.d.ts +20 -0
- package/types/web/src/index.d.ts +1 -1
- package/dist/chunks/4M4GEXJS.js +0 -13
- package/dist/chunks/6WCN7VAZ.js +0 -2
|
@@ -11,6 +11,14 @@ export type AddMethodRequest = {
|
|
|
11
11
|
* Optional channel override.
|
|
12
12
|
*/
|
|
13
13
|
channel?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Ask the billing address on the page and keep it in the customer's profile.
|
|
16
|
+
*/
|
|
17
|
+
collect_billing_address?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Make the card the customer's default on its channel once it is saved. The first card saved is the default whatever is asked.
|
|
20
|
+
*/
|
|
21
|
+
make_default?: boolean;
|
|
14
22
|
/**
|
|
15
23
|
* Phone number for Masterpass card lookup.
|
|
16
24
|
*/
|
|
@@ -261,9 +269,13 @@ export type Buyer = {
|
|
|
261
269
|
*/
|
|
262
270
|
surname?: string;
|
|
263
271
|
/**
|
|
264
|
-
* National identity or tax
|
|
272
|
+
* National identity or tax number.
|
|
265
273
|
*/
|
|
266
274
|
tax_id?: string;
|
|
275
|
+
/**
|
|
276
|
+
* The kind of tax number `tax_id` is, as Stripe names them (`eu_vat`, `tr_tin`, `us_ein`…). With it the number is kept on the provider's customer and printed on its invoices; without it the number stays in the profile.
|
|
277
|
+
*/
|
|
278
|
+
tax_id_type?: string;
|
|
267
279
|
};
|
|
268
280
|
/**
|
|
269
281
|
* Cancel an unsettled PaymentIntent and release any split wallet hold.
|
|
@@ -299,6 +311,10 @@ export type CancelSubscriptionResponse = {
|
|
|
299
311
|
* Updated subscription status.
|
|
300
312
|
*/
|
|
301
313
|
status: string;
|
|
314
|
+
/**
|
|
315
|
+
* Present and true when the payment provider the channel's keys reach does not know the subscription (the channel was connected to another account, or moved from test to live): the subscription was ended here, and nothing was changed at the provider. End it there if it still renews in the other account.
|
|
316
|
+
*/
|
|
317
|
+
provider_unknown?: boolean;
|
|
302
318
|
};
|
|
303
319
|
/**
|
|
304
320
|
* Feature matrix supported by a connected payment channel.
|
|
@@ -329,7 +345,7 @@ export type Capabilities = {
|
|
|
329
345
|
*/
|
|
330
346
|
masterpass: boolean;
|
|
331
347
|
/**
|
|
332
|
-
* Whether
|
|
348
|
+
* Whether the channel's provider keeps cards for the project. False on iyzico: its payment page saves a card to the buyer's own iyzico wallet and hands the merchant no card token.
|
|
333
349
|
*/
|
|
334
350
|
saved_cards: boolean;
|
|
335
351
|
/**
|
|
@@ -608,13 +624,17 @@ export type ConfirmIntentRequest = {
|
|
|
608
624
|
* Saved payment method UUID for one-click payment.
|
|
609
625
|
*/
|
|
610
626
|
method_id?: string;
|
|
627
|
+
/**
|
|
628
|
+
* Charge the saved card named by `method_id` with its holder away (secret key only; a Stripe channel — `off_session_unsupported` elsewhere). The card is charged with no step of the holder's, whatever the project's 3-D Secure threshold; a bank that asks the holder to authenticate declines the payment (`authentication_required`) instead of leaving it waiting.
|
|
629
|
+
*/
|
|
630
|
+
off_session?: boolean;
|
|
611
631
|
/**
|
|
612
632
|
* Phone number for Masterpass OTP lookup.
|
|
613
633
|
*/
|
|
614
634
|
phone?: string;
|
|
615
635
|
provider_options?: ProviderOptions;
|
|
616
636
|
/**
|
|
617
|
-
*
|
|
637
|
+
* Keep the card for the customer once the payment succeeds. The payment's `method_save` says what became of it.
|
|
618
638
|
*/
|
|
619
639
|
save_method?: boolean;
|
|
620
640
|
/**
|
|
@@ -890,6 +910,10 @@ export type DisputeEvent = {
|
|
|
890
910
|
* Disputed amount in minor units.
|
|
891
911
|
*/
|
|
892
912
|
amount: number;
|
|
913
|
+
/**
|
|
914
|
+
* The channel the payment was taken through.
|
|
915
|
+
*/
|
|
916
|
+
channel_key?: string;
|
|
893
917
|
/**
|
|
894
918
|
* ISO 4217 currency code.
|
|
895
919
|
*/
|
|
@@ -912,6 +936,10 @@ export type DisputeEvent = {
|
|
|
912
936
|
* Disputed PaymentIntent UUID.
|
|
913
937
|
*/
|
|
914
938
|
intent_id: string;
|
|
939
|
+
/**
|
|
940
|
+
* Whether the payment's channel takes live payments.
|
|
941
|
+
*/
|
|
942
|
+
livemode?: boolean;
|
|
915
943
|
/**
|
|
916
944
|
* Provider name.
|
|
917
945
|
*/
|
|
@@ -920,6 +948,14 @@ export type DisputeEvent = {
|
|
|
920
948
|
* Provider dispute ID.
|
|
921
949
|
*/
|
|
922
950
|
provider_dispute_id?: string;
|
|
951
|
+
/**
|
|
952
|
+
* What the provider calls the payment, as the payment's own event told it.
|
|
953
|
+
*/
|
|
954
|
+
provider_payment_id?: string;
|
|
955
|
+
/**
|
|
956
|
+
* What the provider calls the subscription the payment started, when it started one.
|
|
957
|
+
*/
|
|
958
|
+
provider_subscription_id?: string;
|
|
923
959
|
/**
|
|
924
960
|
* Dispute reason.
|
|
925
961
|
*/
|
|
@@ -1388,6 +1424,10 @@ export type IntentView = {
|
|
|
1388
1424
|
metadata?: {
|
|
1389
1425
|
[key: string]: unknown;
|
|
1390
1426
|
};
|
|
1427
|
+
/**
|
|
1428
|
+
* What became of a confirm's `save_method`: `requested` until the payment is paid; then `saved` once the card is one of the customer's, or `not_saved` when none came of the payment. `unsupported` where the channel's provider keeps no card for the project (the payment goes on without).
|
|
1429
|
+
*/
|
|
1430
|
+
method_save?: "requested" | "saved" | "not_saved" | "unsupported";
|
|
1391
1431
|
next_action?: NextAction;
|
|
1392
1432
|
/**
|
|
1393
1433
|
* Resolved provider name (stripe, iyzico, wallet).
|
|
@@ -1641,6 +1681,10 @@ export type PaymentLifecycleEvent = {
|
|
|
1641
1681
|
* Winning or latest PaymentAttempt UUID.
|
|
1642
1682
|
*/
|
|
1643
1683
|
attempt_id?: string;
|
|
1684
|
+
/**
|
|
1685
|
+
* For a payment that started a subscription: true when it will not renew.
|
|
1686
|
+
*/
|
|
1687
|
+
cancel_at_period_end?: boolean;
|
|
1644
1688
|
/**
|
|
1645
1689
|
* Captured amount in minor units.
|
|
1646
1690
|
*/
|
|
@@ -1649,10 +1693,26 @@ export type PaymentLifecycleEvent = {
|
|
|
1649
1693
|
* Channel key.
|
|
1650
1694
|
*/
|
|
1651
1695
|
channel_key?: string;
|
|
1696
|
+
/**
|
|
1697
|
+
* For a payment that started a subscription: what the card was charged, in minor units — nothing for a free trial.
|
|
1698
|
+
*/
|
|
1699
|
+
charged_amount?: number;
|
|
1652
1700
|
/**
|
|
1653
1701
|
* ISO 4217 currency code.
|
|
1654
1702
|
*/
|
|
1655
1703
|
currency?: string;
|
|
1704
|
+
/**
|
|
1705
|
+
* For a payment that started a subscription: when the period it paid for ends.
|
|
1706
|
+
*/
|
|
1707
|
+
current_period_end?: string | null;
|
|
1708
|
+
/**
|
|
1709
|
+
* For a payment that started a subscription: when the period it paid for began.
|
|
1710
|
+
*/
|
|
1711
|
+
current_period_start?: string | null;
|
|
1712
|
+
/**
|
|
1713
|
+
* The email the buyer gave at checkout, when the provider tells it.
|
|
1714
|
+
*/
|
|
1715
|
+
customer_email?: string;
|
|
1656
1716
|
/**
|
|
1657
1717
|
* Customer UID.
|
|
1658
1718
|
*/
|
|
@@ -1703,10 +1763,18 @@ export type PaymentLifecycleEvent = {
|
|
|
1703
1763
|
* Merchant reference.
|
|
1704
1764
|
*/
|
|
1705
1765
|
reference?: string;
|
|
1766
|
+
/**
|
|
1767
|
+
* For a payment that started a subscription: how the subscription stands (trialing, active).
|
|
1768
|
+
*/
|
|
1769
|
+
subscription_status?: string;
|
|
1706
1770
|
/**
|
|
1707
1771
|
* Tax amount in minor units.
|
|
1708
1772
|
*/
|
|
1709
1773
|
tax_amount?: number;
|
|
1774
|
+
/**
|
|
1775
|
+
* For a payment that started a subscription: when its free trial ends.
|
|
1776
|
+
*/
|
|
1777
|
+
trial_end?: string | null;
|
|
1710
1778
|
};
|
|
1711
1779
|
/**
|
|
1712
1780
|
* List of payment splits.
|
|
@@ -1872,6 +1940,14 @@ export type RefundSucceededEvent = {
|
|
|
1872
1940
|
* Refund amount in minor units.
|
|
1873
1941
|
*/
|
|
1874
1942
|
amount: number;
|
|
1943
|
+
/**
|
|
1944
|
+
* What went back to the card, in minor units.
|
|
1945
|
+
*/
|
|
1946
|
+
card_amount?: number;
|
|
1947
|
+
/**
|
|
1948
|
+
* The channel the payment was taken through.
|
|
1949
|
+
*/
|
|
1950
|
+
channel_key?: string;
|
|
1875
1951
|
/**
|
|
1876
1952
|
* ISO 4217 currency code.
|
|
1877
1953
|
*/
|
|
@@ -1894,18 +1970,38 @@ export type RefundSucceededEvent = {
|
|
|
1894
1970
|
* PaymentIntent UUID.
|
|
1895
1971
|
*/
|
|
1896
1972
|
intent_id: string;
|
|
1973
|
+
/**
|
|
1974
|
+
* Whether the payment's channel takes live payments.
|
|
1975
|
+
*/
|
|
1976
|
+
livemode?: boolean;
|
|
1977
|
+
/**
|
|
1978
|
+
* Provider name.
|
|
1979
|
+
*/
|
|
1980
|
+
provider?: string;
|
|
1897
1981
|
/**
|
|
1898
1982
|
* Provider operation executed.
|
|
1899
1983
|
*/
|
|
1900
1984
|
provider_op?: string;
|
|
1985
|
+
/**
|
|
1986
|
+
* What the provider calls the payment, as the payment's own event told it.
|
|
1987
|
+
*/
|
|
1988
|
+
provider_payment_id?: string;
|
|
1901
1989
|
/**
|
|
1902
1990
|
* Provider refund ID.
|
|
1903
1991
|
*/
|
|
1904
1992
|
provider_refund_id?: string;
|
|
1993
|
+
/**
|
|
1994
|
+
* What the provider calls the subscription the payment started, when it started one.
|
|
1995
|
+
*/
|
|
1996
|
+
provider_subscription_id?: string;
|
|
1905
1997
|
/**
|
|
1906
1998
|
* Refund UUID.
|
|
1907
1999
|
*/
|
|
1908
2000
|
refund_id: string;
|
|
2001
|
+
/**
|
|
2002
|
+
* What went back to the wallet, in minor units.
|
|
2003
|
+
*/
|
|
2004
|
+
wallet_amount?: number;
|
|
1909
2005
|
/**
|
|
1910
2006
|
* Wallet key when refunded to wallet.
|
|
1911
2007
|
*/
|
|
@@ -2063,10 +2159,18 @@ export type SavedMethodView = {
|
|
|
2063
2159
|
* Expiration year.
|
|
2064
2160
|
*/
|
|
2065
2161
|
exp_year?: number | null;
|
|
2162
|
+
/**
|
|
2163
|
+
* The provider's mark of the card number: two saved methods of one card carry the same. Empty where the provider gives none.
|
|
2164
|
+
*/
|
|
2165
|
+
fingerprint?: string;
|
|
2066
2166
|
/**
|
|
2067
2167
|
* Saved payment method UUID.
|
|
2068
2168
|
*/
|
|
2069
2169
|
id: string;
|
|
2170
|
+
/**
|
|
2171
|
+
* Whether this is the customer's default card on its channel.
|
|
2172
|
+
*/
|
|
2173
|
+
is_default: boolean;
|
|
2070
2174
|
/**
|
|
2071
2175
|
* Method kind (card).
|
|
2072
2176
|
*/
|
|
@@ -2156,7 +2260,7 @@ export type Settings = {
|
|
|
2156
2260
|
*/
|
|
2157
2261
|
allow_marketplace_fiat_wallet?: boolean;
|
|
2158
2262
|
/**
|
|
2159
|
-
*
|
|
2263
|
+
* What becomes, at the providers, of what could still take a deleted auth user's money. On (the default): their subscriptions stop renewing at their providers (at the period's end) and their saved cards are taken off the providers' vaults. Off: both stay at the provider. Either way the profile written on the provider's customer record (name, email, address, tax number) is taken off it; the record itself stays. A provider that cannot be reached holds the user's erasure here until it can be. One that refuses the channel's keys, or a channel that cannot be asked at all, is passed over: the user is erased here all the same, and their subscription and cards stay at that provider — the project's to end there. Subscriptions the IAP module sells on the web are among them: they stop with the rest whatever IAP's own `cancel_on_delete` says.
|
|
2160
2264
|
*/
|
|
2161
2265
|
cancel_on_delete: boolean;
|
|
2162
2266
|
/**
|
|
@@ -2570,43 +2674,96 @@ export type SubmitOTPRequest = {
|
|
|
2570
2674
|
save_method?: boolean;
|
|
2571
2675
|
};
|
|
2572
2676
|
/**
|
|
2573
|
-
*
|
|
2677
|
+
* A recurring subscription as its row holds it once something of it changed: its start, a renewal's payment, a failed charge, its renewal turned off, its end. Told the same whoever changed it — the project's server, support, or the customer in the provider's portal.
|
|
2574
2678
|
*/
|
|
2575
2679
|
export type SubscriptionEvent = {
|
|
2576
2680
|
/**
|
|
2577
|
-
*
|
|
2681
|
+
* What a period costs, in minor units.
|
|
2682
|
+
*/
|
|
2683
|
+
amount?: number;
|
|
2684
|
+
/**
|
|
2685
|
+
* A failed charge's amount, in minor units (change payment_failed).
|
|
2686
|
+
*/
|
|
2687
|
+
amount_due?: number;
|
|
2688
|
+
/**
|
|
2689
|
+
* Set to platform_mit_marketplace for a subscription Palbase charges itself.
|
|
2690
|
+
*/
|
|
2691
|
+
billing_mode?: string;
|
|
2692
|
+
/**
|
|
2693
|
+
* True when it will not renew: it ends with the period it is in.
|
|
2578
2694
|
*/
|
|
2579
2695
|
cancel_at_period_end?: boolean;
|
|
2580
2696
|
/**
|
|
2581
|
-
*
|
|
2697
|
+
* What happened: started (its first payment was made), renewed (a period's payment, in transaction), payment_failed (a renewal was not charged), canceled (its renewal was turned off, or it ended), updated (anything else of it moved: its period, its status).
|
|
2698
|
+
*/
|
|
2699
|
+
change?: "started" | "renewed" | "payment_failed" | "canceled" | "updated";
|
|
2700
|
+
/**
|
|
2701
|
+
* The channel it is billed through.
|
|
2702
|
+
*/
|
|
2703
|
+
channel_key?: string;
|
|
2704
|
+
/**
|
|
2705
|
+
* ISO 4217 currency code.
|
|
2706
|
+
*/
|
|
2707
|
+
currency?: string;
|
|
2708
|
+
/**
|
|
2709
|
+
* When the period it is in ends.
|
|
2582
2710
|
*/
|
|
2583
2711
|
current_period_end?: string | null;
|
|
2584
2712
|
/**
|
|
2585
|
-
*
|
|
2713
|
+
* When the period it is in began.
|
|
2714
|
+
*/
|
|
2715
|
+
current_period_start?: string | null;
|
|
2716
|
+
/**
|
|
2717
|
+
* The customer it is of. Empty for one that is nobody's here: bought through In-App Purchases' web checkout by a buyer with no account, or kept for In-App Purchases after its customer was erased.
|
|
2586
2718
|
*/
|
|
2587
2719
|
customer_id?: string;
|
|
2588
2720
|
/**
|
|
2589
|
-
*
|
|
2721
|
+
* When it ended. Set on every event of a subscription that has ended (status canceled or expired): it gives nothing more, whatever period it had paid for. Absent while it is only set not to renew.
|
|
2722
|
+
*/
|
|
2723
|
+
ended_at?: string | null;
|
|
2724
|
+
/**
|
|
2725
|
+
* Set when it is a catalog plan bought through In-App Purchases' web checkout: the catalog's product_key and plan_key, and the session_id its checkout was answered.
|
|
2590
2726
|
*/
|
|
2591
2727
|
iap_context?: {
|
|
2592
2728
|
[key: string]: unknown;
|
|
2593
2729
|
};
|
|
2730
|
+
/**
|
|
2731
|
+
* Billing interval: day, week, month or year.
|
|
2732
|
+
*/
|
|
2733
|
+
interval?: string;
|
|
2734
|
+
/**
|
|
2735
|
+
* Intervals per period.
|
|
2736
|
+
*/
|
|
2737
|
+
interval_count?: number;
|
|
2738
|
+
/**
|
|
2739
|
+
* The provider's invoice of a renewal or a failed charge.
|
|
2740
|
+
*/
|
|
2741
|
+
invoice_id?: string;
|
|
2742
|
+
/**
|
|
2743
|
+
* Whether its channel takes live payments.
|
|
2744
|
+
*/
|
|
2745
|
+
livemode?: boolean;
|
|
2594
2746
|
/**
|
|
2595
2747
|
* Provider name.
|
|
2596
2748
|
*/
|
|
2597
2749
|
provider?: string;
|
|
2598
2750
|
/**
|
|
2599
|
-
*
|
|
2751
|
+
* What the provider calls the subscription.
|
|
2600
2752
|
*/
|
|
2601
2753
|
provider_sub_id?: string;
|
|
2602
2754
|
/**
|
|
2603
|
-
* Subscription status.
|
|
2755
|
+
* Subscription status (pending, trialing, active, past_due, paused, canceled, expired).
|
|
2604
2756
|
*/
|
|
2605
2757
|
status: string;
|
|
2606
2758
|
/**
|
|
2607
2759
|
* Subscription UUID.
|
|
2608
2760
|
*/
|
|
2609
2761
|
subscription_id: string;
|
|
2762
|
+
transaction?: SubscriptionRenewalPayment;
|
|
2763
|
+
/**
|
|
2764
|
+
* When its free trial ends.
|
|
2765
|
+
*/
|
|
2766
|
+
trial_end?: string | null;
|
|
2610
2767
|
};
|
|
2611
2768
|
/**
|
|
2612
2769
|
* Paginated list of subscriptions.
|
|
@@ -2654,9 +2811,13 @@ export type SubscriptionSummary = {
|
|
|
2654
2811
|
*/
|
|
2655
2812
|
current_period_start?: string | null;
|
|
2656
2813
|
/**
|
|
2657
|
-
*
|
|
2814
|
+
* The customer it is of; empty for one that is nobody's here (bought by a buyer with no account, or kept after its customer was erased).
|
|
2658
2815
|
*/
|
|
2659
2816
|
customer_id: string;
|
|
2817
|
+
/**
|
|
2818
|
+
* When it ended, once it has: it gives nothing more, whatever period it had paid for. Absent while it is only set not to renew.
|
|
2819
|
+
*/
|
|
2820
|
+
ended_at?: string | null;
|
|
2660
2821
|
/**
|
|
2661
2822
|
* Subscription UUID.
|
|
2662
2823
|
*/
|
|
@@ -2684,7 +2845,7 @@ export type SubscriptionSummary = {
|
|
|
2684
2845
|
*/
|
|
2685
2846
|
provider_sub_id?: string;
|
|
2686
2847
|
/**
|
|
2687
|
-
* Subscription status.
|
|
2848
|
+
* Subscription status (pending, trialing, active, past_due, paused, canceled, expired).
|
|
2688
2849
|
*/
|
|
2689
2850
|
status: string;
|
|
2690
2851
|
/**
|
|
@@ -2725,9 +2886,13 @@ export type SubscriptionView = {
|
|
|
2725
2886
|
*/
|
|
2726
2887
|
current_period_start?: string | null;
|
|
2727
2888
|
/**
|
|
2728
|
-
*
|
|
2889
|
+
* The customer it is of; empty for one that is nobody's here (bought by a buyer with no account, or kept after its customer was erased).
|
|
2729
2890
|
*/
|
|
2730
2891
|
customer_id: string;
|
|
2892
|
+
/**
|
|
2893
|
+
* When it ended, once it has: it gives nothing more, whatever period it had paid for. Absent while it is only set not to renew.
|
|
2894
|
+
*/
|
|
2895
|
+
ended_at?: string | null;
|
|
2731
2896
|
/**
|
|
2732
2897
|
* Subscription UUID.
|
|
2733
2898
|
*/
|
|
@@ -2756,7 +2921,7 @@ export type SubscriptionView = {
|
|
|
2756
2921
|
*/
|
|
2757
2922
|
provider_sub_id?: string;
|
|
2758
2923
|
/**
|
|
2759
|
-
* Subscription status (pending, trialing, active, past_due, canceled, expired).
|
|
2924
|
+
* Subscription status (pending, trialing, active, past_due, paused, canceled, expired).
|
|
2760
2925
|
*/
|
|
2761
2926
|
status: string;
|
|
2762
2927
|
/**
|
|
@@ -3255,6 +3420,90 @@ export type PendingRefundSettled = {
|
|
|
3255
3420
|
*/
|
|
3256
3421
|
made?: boolean;
|
|
3257
3422
|
};
|
|
3423
|
+
/**
|
|
3424
|
+
* Open the provider's page that saves a card for a payer.
|
|
3425
|
+
*/
|
|
3426
|
+
export type AddCustomerMethodRequest = {
|
|
3427
|
+
/**
|
|
3428
|
+
* Allowed cancel URL (default: return_url).
|
|
3429
|
+
*/
|
|
3430
|
+
cancel_url?: string;
|
|
3431
|
+
/**
|
|
3432
|
+
* Optional channel override.
|
|
3433
|
+
*/
|
|
3434
|
+
channel?: string;
|
|
3435
|
+
/**
|
|
3436
|
+
* Ask the billing address on the page and keep it in the payer's profile.
|
|
3437
|
+
*/
|
|
3438
|
+
collect_billing_address?: boolean;
|
|
3439
|
+
/**
|
|
3440
|
+
* Make the card the payer's default on its channel once it is saved. The first card saved is the default whatever is asked.
|
|
3441
|
+
*/
|
|
3442
|
+
make_default?: boolean;
|
|
3443
|
+
/**
|
|
3444
|
+
* Allowed return URL the page sends the cardholder back to.
|
|
3445
|
+
*/
|
|
3446
|
+
return_url: string;
|
|
3447
|
+
};
|
|
3448
|
+
/**
|
|
3449
|
+
* A customer's record at a provider that could not be deleted there.
|
|
3450
|
+
*/
|
|
3451
|
+
export type ProviderRecordKept = {
|
|
3452
|
+
/**
|
|
3453
|
+
* The channel whose provider keeps the record.
|
|
3454
|
+
*/
|
|
3455
|
+
channel_key: string;
|
|
3456
|
+
/**
|
|
3457
|
+
* Why it was kept: `channel_keys_refused` (the provider refuses the channel's keys), `channel_keys_unreadable`, `provider_record_not_found` (the account the channel's keys reach has no such record: they are another account's now), or `provider_refused`.
|
|
3458
|
+
*/
|
|
3459
|
+
reason: string;
|
|
3460
|
+
};
|
|
3461
|
+
/**
|
|
3462
|
+
* A payer forgotten, and what of it a provider still keeps.
|
|
3463
|
+
*/
|
|
3464
|
+
export type DeleteCustomerResponse = {
|
|
3465
|
+
/**
|
|
3466
|
+
* Always true.
|
|
3467
|
+
*/
|
|
3468
|
+
deleted: boolean;
|
|
3469
|
+
/**
|
|
3470
|
+
* The payer's id.
|
|
3471
|
+
*/
|
|
3472
|
+
id: string;
|
|
3473
|
+
/**
|
|
3474
|
+
* The payer's records at providers that could not be asked to delete them; empty when every one was deleted.
|
|
3475
|
+
*/
|
|
3476
|
+
provider_records_kept: ProviderRecordKept[];
|
|
3477
|
+
};
|
|
3478
|
+
/**
|
|
3479
|
+
* The payment of a subscription's renewal: the provider's invoice, what was paid for it, and the period it pays for.
|
|
3480
|
+
*/
|
|
3481
|
+
export type SubscriptionRenewalPayment = {
|
|
3482
|
+
/**
|
|
3483
|
+
* What was paid, in minor units.
|
|
3484
|
+
*/
|
|
3485
|
+
amount_paid: number;
|
|
3486
|
+
/**
|
|
3487
|
+
* ISO 4217 currency code.
|
|
3488
|
+
*/
|
|
3489
|
+
currency?: string;
|
|
3490
|
+
/**
|
|
3491
|
+
* The provider's invoice.
|
|
3492
|
+
*/
|
|
3493
|
+
id: string;
|
|
3494
|
+
/**
|
|
3495
|
+
* When the period it pays for ends.
|
|
3496
|
+
*/
|
|
3497
|
+
period_end?: string | null;
|
|
3498
|
+
/**
|
|
3499
|
+
* When the period it pays for began.
|
|
3500
|
+
*/
|
|
3501
|
+
period_start?: string | null;
|
|
3502
|
+
/**
|
|
3503
|
+
* The tax in what was paid, in minor units.
|
|
3504
|
+
*/
|
|
3505
|
+
tax_amount?: number;
|
|
3506
|
+
};
|
|
3258
3507
|
/** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
|
|
3259
3508
|
export interface Events {
|
|
3260
3509
|
/**
|
|
@@ -3298,11 +3547,11 @@ export interface Events {
|
|
|
3298
3547
|
*/
|
|
3299
3548
|
"payments.sub_merchant.updated": SubMerchantUpdatedEvent;
|
|
3300
3549
|
/**
|
|
3301
|
-
* payments.subscription.canceled: a recurring subscription was
|
|
3550
|
+
* payments.subscription.canceled: a recurring subscription's renewal was turned off (it keeps the period paid for: `cancel_at_period_end`), or it ended (`status` canceled, `ended_at`) — by the project's server, by support, or by the customer in the provider's portal.
|
|
3302
3551
|
*/
|
|
3303
3552
|
"payments.subscription.canceled": SubscriptionEvent;
|
|
3304
3553
|
/**
|
|
3305
|
-
* payments.subscription.changed: a recurring subscription started, renewed,
|
|
3554
|
+
* payments.subscription.changed: a recurring subscription started, renewed, was not charged, or moved on (its period, its status) — `change` says which; whoever caused it, the project's server or the provider. Two things at once are two events.
|
|
3306
3555
|
*/
|
|
3307
3556
|
"payments.subscription.changed": SubscriptionEvent;
|
|
3308
3557
|
/**
|
|
@@ -3578,7 +3827,7 @@ export declare function client(t: Transport): {
|
|
|
3578
3827
|
/**
|
|
3579
3828
|
* Cancel payment intent
|
|
3580
3829
|
*
|
|
3581
|
-
* Cancels an unsettled PaymentIntent, voids any provider authorization, and releases any split wallet hold.
|
|
3830
|
+
* Cancels an unsettled PaymentIntent, voids any provider authorization, and releases any split wallet hold. What is still open of the payment at its provider — a hosted page its buyer could pay on, a card's charge whose outcome is not known — is closed there before the payment is told canceled (Stripe). An attempt found paid is the payment: it is settled paid and the answer is `409 intent_already_succeeded`. `409 payment_busy` while a confirmation of the payment is being made; `503` when the provider cannot say how an open attempt stands — the payment is not told canceled while money may be taken on it, and asking again is safe. A channel whose keys the provider refuses, or that cannot be asked at all, withdraws nothing: the payment is canceled all the same. After a `503`, what the cancellation had begun to close is closed within minutes and the payment is told failed (`payments.payment.failed`) — payable again — unless the cancellation is asked again. `409 payment_busy` and `409 payment_in_progress` are not kept against an `Idempotency-Key`: asked again under the same key, the cancellation is made.
|
|
3582
3831
|
*/
|
|
3583
3832
|
cancelIntent(input: {
|
|
3584
3833
|
path: {
|
|
@@ -3623,7 +3872,7 @@ export declare function client(t: Transport): {
|
|
|
3623
3872
|
/**
|
|
3624
3873
|
* Confirm payment intent
|
|
3625
3874
|
*
|
|
3626
|
-
* Creates a new PaymentAttempt for the PaymentIntent (saved card, Masterpass OTP, Stripe Elements, or hosted/embedded 3DS form) and returns the canonical NextAction.
|
|
3875
|
+
* Creates a new PaymentAttempt for the PaymentIntent (saved card, Masterpass OTP, Stripe Elements, or hosted/embedded 3DS form) and returns the canonical NextAction. A card is charged once for a payment. One confirmation of a payment runs at a time (`409 payment_busy` to one that waited too long). Before a saved card is charged, every other attempt of the payment that could still take money is closed at the provider — a hosted page left open is expired, one whose buyer's card was declined on it too — and one found paid is the payment: its view is answered and no card is charged. When the provider does not say whether a card was charged, the answer is `503 payment_outcome_unknown` and the payment reads `processing`: confirming again asks the provider first and charges nothing twice; left alone, the payment is settled paid or failed within minutes. A saved card that was removed on the provider's own pages is declined `method_gone` and listed no more. When the customer's record itself was deleted on the provider's pages, it is let go of here with the cards that went with it, and the answer is `409 provider_customer_gone` (`method_gone` when a saved card was named): confirming again makes a new record. An answer is kept with its Idempotency-Key, a decline too: confirm under a new key to try again. Opening a second hosted page for a payment does not close the first, and each is payable: send a buyer to one page per payment.
|
|
3627
3876
|
*/
|
|
3628
3877
|
confirmIntent(input: {
|
|
3629
3878
|
path: {
|
|
@@ -3650,7 +3899,7 @@ export declare function client(t: Transport): {
|
|
|
3650
3899
|
/**
|
|
3651
3900
|
* List saved payment methods
|
|
3652
3901
|
*
|
|
3653
|
-
* Lists the signed-in customer's active
|
|
3902
|
+
* Lists the signed-in customer's active saved payment methods: each channel's default first, then the newest. Once a billing portal session was opened for the customer, the list follows what the provider has, as ListCustomerMethods does.
|
|
3654
3903
|
*/
|
|
3655
3904
|
listMyMethods(input?: {
|
|
3656
3905
|
signal?: AbortSignal;
|
|
@@ -3658,7 +3907,7 @@ export declare function client(t: Transport): {
|
|
|
3658
3907
|
/**
|
|
3659
3908
|
* Add saved payment method
|
|
3660
3909
|
*
|
|
3661
|
-
*
|
|
3910
|
+
* Opens a PCI-safe card-saving flow (the provider's own page, or a Masterpass OTP link) and returns a NextAction. A channel whose provider keeps no card for the project (iyzico) answers `setup_only_unsupported`. `409 provider_customer_gone` when the customer's record was deleted on the provider's own pages: it is let go of here, and calling again makes a new one.
|
|
3662
3911
|
*/
|
|
3663
3912
|
addMyMethod(input?: {
|
|
3664
3913
|
body?: AddMethodRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
@@ -3667,7 +3916,7 @@ export declare function client(t: Transport): {
|
|
|
3667
3916
|
/**
|
|
3668
3917
|
* Delete saved payment method
|
|
3669
3918
|
*
|
|
3670
|
-
*
|
|
3919
|
+
* Takes the saved payment method off the provider's vault and marks it revoked. When it was the default, the oldest card left on its channel becomes the default. `503 provider_unavailable` when the provider cannot be reached to remove it: the method is kept, and asking again is safe.
|
|
3671
3920
|
*/
|
|
3672
3921
|
deleteMyMethod(input: {
|
|
3673
3922
|
path: {
|
|
@@ -3678,7 +3927,7 @@ export declare function client(t: Transport): {
|
|
|
3678
3927
|
/**
|
|
3679
3928
|
* Create billing portal session
|
|
3680
3929
|
*
|
|
3681
|
-
* Opens a provider-hosted self-service billing portal session for the signed-in customer.
|
|
3930
|
+
* Opens a provider-hosted self-service billing portal session for the signed-in customer. `409 provider_customer_gone` when the customer's record was deleted on the provider's own pages.
|
|
3682
3931
|
*/
|
|
3683
3932
|
createMyPortal(input: {
|
|
3684
3933
|
body: PortalRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
@@ -3695,7 +3944,7 @@ export declare function client(t: Transport): {
|
|
|
3695
3944
|
/**
|
|
3696
3945
|
* Update customer billing profile
|
|
3697
3946
|
*
|
|
3698
|
-
* Saves the signed-in customer's billing/shipping profile sealed with the project's data key.
|
|
3947
|
+
* Saves the signed-in customer's billing/shipping profile sealed with the project's data key, and hands it to a provider that keeps a customer record of its own, as UpdateCustomer does.
|
|
3699
3948
|
*/
|
|
3700
3949
|
updateMyProfile(input: {
|
|
3701
3950
|
body: Buyer; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
@@ -4200,5 +4449,98 @@ export declare function client(t: Transport): {
|
|
|
4200
4449
|
stripeConnectWebhook(input?: {
|
|
4201
4450
|
signal?: AbortSignal;
|
|
4202
4451
|
}): Promise<Reply<200, undefined>>;
|
|
4452
|
+
/**
|
|
4453
|
+
* Get a payer's billing profile
|
|
4454
|
+
*
|
|
4455
|
+
* Reads the profile of a payer: a signed-in customer, or a company or team the project's server names. 404 `customer_not_found` when nothing is kept under that id.
|
|
4456
|
+
*/
|
|
4457
|
+
getCustomer(input: {
|
|
4458
|
+
path: {
|
|
4459
|
+
customer_id: string;
|
|
4460
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
4461
|
+
signal?: AbortSignal;
|
|
4462
|
+
}): Promise<Reply<200, Buyer>>;
|
|
4463
|
+
/**
|
|
4464
|
+
* Update a payer's billing profile
|
|
4465
|
+
*
|
|
4466
|
+
* Keeps a payer's billing profile whole, as given (the payer is made if it is not there). A provider that keeps a customer record of its own (Stripe) is handed the name, email, phone, billing address and — when `tax_id_type` names its kind — the tax number, which its invoices then carry. A tax number or an address the provider refuses is answered `tax_id_invalid` or `billing_address_invalid`, and the profile is not kept. A payer no provider has a record of yet is asked of none: its profile is handed over when its record is first made, and what the provider refuses then is told by the call that makes it (AddCustomerMethod). A provider that cannot be reached fails the change with `503 provider_unavailable`; a record that is gone at its provider, or a channel whose keys its provider refuses, does not: the profile is kept here.
|
|
4467
|
+
*/
|
|
4468
|
+
updateCustomer(input: {
|
|
4469
|
+
path: {
|
|
4470
|
+
customer_id: string;
|
|
4471
|
+
};
|
|
4472
|
+
body: Buyer; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
4473
|
+
signal?: AbortSignal;
|
|
4474
|
+
}): Promise<Reply<200, Buyer>>;
|
|
4475
|
+
/**
|
|
4476
|
+
* Delete a payer
|
|
4477
|
+
*
|
|
4478
|
+
* Forgets a payer. Its customer record at each provider is deleted first (its cards go with it) — every channel whose keys are still kept is asked, in use or not — then its profile, cards and references here. A provider that cannot be reached fails the deletion with `503 provider_unavailable`: the deletion is not finished and nothing is deleted here; retrying is safe. A provider that refuses the channel's keys, or whose account does not have the record (the channel's keys are another account's now), cannot be asked: its record stays there, the payer is forgotten here all the same, and the answer names the record (`provider_records_kept`). What the payer paid stays in the books: its payments no longer name it, and the entries of the append-only wallet ledger keep the id they were written under — name payers by an id of your own, not by a name or an email. Refused with `customer_has_subscriptions` while a subscription of its is not ended, and `customer_has_wallet_balance` while a wallet of its holds, reserves or owes money.
|
|
4479
|
+
*/
|
|
4480
|
+
deleteCustomer(input: {
|
|
4481
|
+
path: {
|
|
4482
|
+
customer_id: string;
|
|
4483
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
4484
|
+
signal?: AbortSignal;
|
|
4485
|
+
}): Promise<Reply<200, DeleteCustomerResponse>>;
|
|
4486
|
+
/**
|
|
4487
|
+
* List a payer's saved payment methods
|
|
4488
|
+
*
|
|
4489
|
+
* Lists a payer's active saved cards: each channel's default first, then the newest. Once a billing portal session was opened for the payer, the list follows what the provider has — a card removed on the provider's page is listed no more, one added there is — read from the provider on each listing for a day after. The provider is waited for a few seconds at most: slower, the list is answered as it is kept. A payer whose record was deleted on the provider's pages has no card there: the record is let go of here, and its cards are listed no more.
|
|
4490
|
+
*/
|
|
4491
|
+
listCustomerMethods(input: {
|
|
4492
|
+
path: {
|
|
4493
|
+
customer_id: string;
|
|
4494
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
4495
|
+
signal?: AbortSignal;
|
|
4496
|
+
}): Promise<Reply<200, SavedMethodListResponse>>;
|
|
4497
|
+
/**
|
|
4498
|
+
* Add a saved payment method for a payer
|
|
4499
|
+
*
|
|
4500
|
+
* Opens the provider's own page that saves a card for the payer, nothing charged, and returns it as a NextAction to send whoever holds the card to. The card is listed once the provider tells it saved. A channel whose provider keeps no card for the project (iyzico) answers `setup_only_unsupported` before the provider is asked anything. When this call makes the payer's record at the provider and the provider refuses a part of the payer's profile, it answers `tax_id_invalid` or `billing_address_invalid` and opens no page: write the profile again, then call again. Opened by an environment's token, the page saves a card no later than the token ends. An email or phone the provider finds malformed is left off the record and told the same way (`invalid_request`). A profile the provider refuses for another reason of its own is told the same way, on every call, until the profile is written again as the provider takes it; the payer's payments go on meanwhile. `409 provider_customer_gone` when the payer's record was deleted on the provider's own pages: it is let go of here, and calling again makes a new one. `503 provider_unavailable` when the provider could not be asked to write the payer's profile on a record it just made: the record is kept, and calling again writes it.
|
|
4501
|
+
*/
|
|
4502
|
+
addCustomerMethod(input: {
|
|
4503
|
+
path: {
|
|
4504
|
+
customer_id: string;
|
|
4505
|
+
};
|
|
4506
|
+
body: AddCustomerMethodRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
4507
|
+
signal?: AbortSignal;
|
|
4508
|
+
}): Promise<Reply<201, NextActionResponse>>;
|
|
4509
|
+
/**
|
|
4510
|
+
* Delete a payer's saved payment method
|
|
4511
|
+
*
|
|
4512
|
+
* Takes the card off the provider's vault and marks it revoked. When it was the default, the oldest card left on its channel becomes the default. `503 provider_unavailable` when the provider cannot be reached to remove it: the card is kept, and asking again is safe.
|
|
4513
|
+
*/
|
|
4514
|
+
deleteCustomerMethod(input: {
|
|
4515
|
+
path: {
|
|
4516
|
+
customer_id: string; /** Saved payment method UUID. */
|
|
4517
|
+
method_id: string;
|
|
4518
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
4519
|
+
signal?: AbortSignal;
|
|
4520
|
+
}): Promise<Reply<204, undefined>>;
|
|
4521
|
+
/**
|
|
4522
|
+
* Make a payer's saved payment method the default
|
|
4523
|
+
*
|
|
4524
|
+
* Makes the card the payer's default on its channel, and returns the payer's cards.
|
|
4525
|
+
*/
|
|
4526
|
+
setCustomerDefaultMethod(input: {
|
|
4527
|
+
path: {
|
|
4528
|
+
customer_id: string; /** Saved payment method UUID. */
|
|
4529
|
+
method_id: string;
|
|
4530
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
4531
|
+
signal?: AbortSignal;
|
|
4532
|
+
}): Promise<Reply<200, SavedMethodListResponse>>;
|
|
4533
|
+
/**
|
|
4534
|
+
* Create a payer's billing portal session
|
|
4535
|
+
*
|
|
4536
|
+
* Opens a provider-hosted self-service billing portal session for the payer: whoever holds its link manages the payer's cards and subscriptions at the provider. The cards the payer changes there are followed (ListCustomerMethods); the default card stays the one chosen here. Closed to an environment's token. `409 provider_customer_gone` when the payer's record was deleted on the provider's own pages: it is let go of here, and a card page or payment makes a new one.
|
|
4537
|
+
*/
|
|
4538
|
+
createCustomerPortal(input: {
|
|
4539
|
+
path: {
|
|
4540
|
+
customer_id: string;
|
|
4541
|
+
};
|
|
4542
|
+
body: PortalRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
4543
|
+
signal?: AbortSignal;
|
|
4544
|
+
}): Promise<Reply<200, PortalResponse>>;
|
|
4203
4545
|
};
|
|
4204
4546
|
export type Client = ReturnType<typeof client>;
|