@doujins/payments-ui 0.1.7 → 0.1.8
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/index.cjs +48 -125
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -65
- package/dist/index.d.ts +37 -65
- package/dist/index.js +48 -124
- package/dist/index.js.map +1 -1
- package/package.json +3 -4
- package/dist/styles.css +0 -2
package/dist/index.d.cts
CHANGED
|
@@ -57,6 +57,7 @@ interface PaymentConfig {
|
|
|
57
57
|
solanaRpcUrl?: string;
|
|
58
58
|
solana?: PaymentSolanaConfig;
|
|
59
59
|
}
|
|
60
|
+
type PaymentMode = 'cards' | 'solana';
|
|
60
61
|
type NotificationStatus = 'default' | 'success' | 'info' | 'destructive';
|
|
61
62
|
interface NotificationPayload {
|
|
62
63
|
title: string;
|
|
@@ -65,6 +66,8 @@ interface NotificationPayload {
|
|
|
65
66
|
}
|
|
66
67
|
type NotificationHandler = (payload: NotificationPayload) => void;
|
|
67
68
|
|
|
69
|
+
type PaymentPlatform = 'nmi' | 'ccbill';
|
|
70
|
+
type CheckoutStatus = 'success' | 'pending' | 'redirect_required' | 'blocked';
|
|
68
71
|
interface BillingDetails {
|
|
69
72
|
firstName: string;
|
|
70
73
|
lastName: string;
|
|
@@ -144,9 +147,6 @@ interface BillingStatus {
|
|
|
144
147
|
is_premium: boolean;
|
|
145
148
|
access: BillingAccessGrant[];
|
|
146
149
|
}
|
|
147
|
-
|
|
148
|
-
type PaymentPlatform = 'nmi' | 'ccbill';
|
|
149
|
-
type CheckoutStatus = 'success' | 'pending' | 'redirect_required' | 'blocked';
|
|
150
150
|
interface CheckoutResponse {
|
|
151
151
|
status: CheckoutStatus;
|
|
152
152
|
message?: string;
|
|
@@ -201,6 +201,39 @@ interface SubscriptionCheckoutPayload {
|
|
|
201
201
|
processor?: string;
|
|
202
202
|
billing: BillingDetails;
|
|
203
203
|
}
|
|
204
|
+
interface SolanaWallet {
|
|
205
|
+
id: string;
|
|
206
|
+
address: string;
|
|
207
|
+
is_verified: boolean;
|
|
208
|
+
verified_at?: string;
|
|
209
|
+
created_at: string;
|
|
210
|
+
updated_at?: string;
|
|
211
|
+
user_id?: string;
|
|
212
|
+
}
|
|
213
|
+
interface WalletListResponse {
|
|
214
|
+
wallets: SolanaWallet[];
|
|
215
|
+
count: number;
|
|
216
|
+
}
|
|
217
|
+
interface WalletChallengeResponse {
|
|
218
|
+
wallet: string;
|
|
219
|
+
message: string;
|
|
220
|
+
expires_at: number;
|
|
221
|
+
nonce: string;
|
|
222
|
+
}
|
|
223
|
+
interface VerifyWalletResponse {
|
|
224
|
+
verified: boolean;
|
|
225
|
+
wallet: string;
|
|
226
|
+
verified_at?: string;
|
|
227
|
+
linked_wallet?: SolanaWallet;
|
|
228
|
+
}
|
|
229
|
+
interface WalletConnectionState {
|
|
230
|
+
isConnected: boolean;
|
|
231
|
+
isConnecting: boolean;
|
|
232
|
+
publicKey: string | null;
|
|
233
|
+
wallets: SolanaWallet[];
|
|
234
|
+
isLoading: boolean;
|
|
235
|
+
error: string | null;
|
|
236
|
+
}
|
|
204
237
|
|
|
205
238
|
interface GeneratePaymentRequest {
|
|
206
239
|
price_id: string;
|
|
@@ -420,40 +453,6 @@ interface PaymentProviderProps {
|
|
|
420
453
|
declare const PaymentProvider: React$1.FC<PaymentProviderProps>;
|
|
421
454
|
declare const usePaymentContext: () => PaymentContextValue;
|
|
422
455
|
|
|
423
|
-
interface SolanaWallet {
|
|
424
|
-
id: string;
|
|
425
|
-
address: string;
|
|
426
|
-
is_verified: boolean;
|
|
427
|
-
verified_at?: string;
|
|
428
|
-
created_at: string;
|
|
429
|
-
updated_at?: string;
|
|
430
|
-
user_id?: string;
|
|
431
|
-
}
|
|
432
|
-
interface WalletListResponse {
|
|
433
|
-
wallets: SolanaWallet[];
|
|
434
|
-
count: number;
|
|
435
|
-
}
|
|
436
|
-
interface WalletChallengeResponse {
|
|
437
|
-
wallet: string;
|
|
438
|
-
message: string;
|
|
439
|
-
expires_at: number;
|
|
440
|
-
nonce: string;
|
|
441
|
-
}
|
|
442
|
-
interface VerifyWalletResponse {
|
|
443
|
-
verified: boolean;
|
|
444
|
-
wallet: string;
|
|
445
|
-
verified_at?: string;
|
|
446
|
-
linked_wallet?: SolanaWallet;
|
|
447
|
-
}
|
|
448
|
-
interface WalletConnectionState {
|
|
449
|
-
isConnected: boolean;
|
|
450
|
-
isConnecting: boolean;
|
|
451
|
-
publicKey: string | null;
|
|
452
|
-
wallets: SolanaWallet[];
|
|
453
|
-
isLoading: boolean;
|
|
454
|
-
error: string | null;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
456
|
interface SubscriptionCheckoutModalProps {
|
|
458
457
|
open: boolean;
|
|
459
458
|
onOpenChange: (open: boolean) => void;
|
|
@@ -516,33 +515,6 @@ interface PaymentsDialogContextValue {
|
|
|
516
515
|
declare const PaymentsDialogProvider: React$1.FC<React$1.PropsWithChildren>;
|
|
517
516
|
declare const usePaymentDialogs: () => PaymentsDialogContextValue;
|
|
518
517
|
|
|
519
|
-
interface BillingThemeProviderProps {
|
|
520
|
-
children: React$1.ReactNode;
|
|
521
|
-
className?: string;
|
|
522
|
-
/**
|
|
523
|
-
* When true, applies the dark theme variant
|
|
524
|
-
* @default false
|
|
525
|
-
*/
|
|
526
|
-
dark?: boolean;
|
|
527
|
-
}
|
|
528
|
-
/**
|
|
529
|
-
* Scopes the Payments UI theme variables so host app styles are left intact.
|
|
530
|
-
* Use this to wrap any Payments UI components to ensure styles don't conflict
|
|
531
|
-
* with the consuming application.
|
|
532
|
-
*
|
|
533
|
-
* @example
|
|
534
|
-
* ```tsx
|
|
535
|
-
* <BillingThemeProvider>
|
|
536
|
-
* <SubscriptionCheckoutModal ... />
|
|
537
|
-
* </BillingThemeProvider>
|
|
538
|
-
* ```
|
|
539
|
-
*/
|
|
540
|
-
declare const BillingThemeProvider: React$1.FC<BillingThemeProviderProps>;
|
|
541
|
-
/**
|
|
542
|
-
prevent conflicts with client app styles
|
|
543
|
-
*/
|
|
544
|
-
declare const BillingThemePortal: React$1.FC<BillingThemeProviderProps>;
|
|
545
|
-
|
|
546
518
|
interface CardDetailsFormProps {
|
|
547
519
|
visible: boolean;
|
|
548
520
|
onTokenize: (token: string, billing: BillingDetails) => void;
|
|
@@ -825,4 +797,4 @@ declare const useSubscriptionActions: () => {
|
|
|
825
797
|
subscribeWithCCBill: ({ priceId, email, firstName, lastName, zipCode, country, processor, idempotencyKey, }: SubscribeWithCCBillParams) => Promise<CheckoutResponse>;
|
|
826
798
|
};
|
|
827
799
|
|
|
828
|
-
export { type AuthTokenProvider, type BillingAccessGrant, type BillingDetails, BillingHistory, type BillingHistoryProps, type BillingHistoryTranslations, type BillingStatus,
|
|
800
|
+
export { type AuthTokenProvider, type BillingAccessGrant, type BillingDetails, BillingHistory, type BillingHistoryProps, type BillingHistoryTranslations, type BillingStatus, type CCBillSubscribePayload, CancelMembershipDialog, type CancelMembershipDialogProps, type CancelMembershipDialogTranslations, CardDetailsForm, type CardDetailsFormProps, type CheckoutRequestPayload, type CheckoutResponse, type CheckoutStatus, type Client, ClientApiError, type ClientConfig, type CreatePaymentMethodPayload, type GeneratePaymentRequest, type GeneratePaymentResponse, type HttpMethod, type NmiSubscribePayload, type NotificationHandler, type NotificationPayload, type NotificationStatus, type PaginatedPaymentMethods, type PaginatedPayments, type PaginatedResponse, type Payment, type PaymentCallbacks, type PaymentConfig, PaymentContext, type PaymentContextValue, type PaymentError, PaymentExperience, type PaymentExperienceProps, type PaymentFeatureFlags, type PaymentFetcher, type PaymentMethod, type PaymentMethodOption, PaymentMethodsSection, type PaymentMethodsSectionProps, type PaymentMethodsSectionTranslations, type PaymentMode, type PaymentPlatform, PaymentProvider, type PaymentProviderProps, type PaymentSolanaConfig, type PaymentState, type PaymentStatusPayload, type PaymentStatusResponse, type PaymentStep, type PaymentSuccessPayload, type PaymentUserDetails, PaymentsDialogProvider, type RequestOptions, type SolanaFlowConfig, type SolanaPayQRCodeIntent, type SolanaPayStatusResponse, type SolanaPayTransaction, type SolanaPaymentMethod, SolanaPaymentSelector, type SolanaPaymentSelectorProps, SolanaPaymentView, type SolanaPaymentViewProps, type SolanaWallet, StoredPaymentMethods, type StoredPaymentMethodsProps, type SubmitPaymentRequest, type SubmitPaymentResponse, type SubscribeWithCCBillParams, type SubscribeWithCardParams, type SubscribeWithSavedMethodParams, SubscriptionCheckoutModal, type SubscriptionCheckoutModalProps, type SubscriptionCheckoutPayload, SubscriptionSuccessDialog, type SupportedTokensResponse, type TokenBalance, type TokenInfo, type TransactionStatus, type VerifyWalletResponse, type WalletChallengeResponse, type WalletConnectionState, WalletDialog, type WalletDialogProps, type WalletListResponse, WalletModal, type WalletModalProps, createClient, usePaymentContext, usePaymentDialogs, usePaymentMethods, usePaymentNotifications, usePaymentStatus, useSolanaQrPayment, useSubscriptionActions, useSupportedTokens, useTokenBalance };
|
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ interface PaymentConfig {
|
|
|
57
57
|
solanaRpcUrl?: string;
|
|
58
58
|
solana?: PaymentSolanaConfig;
|
|
59
59
|
}
|
|
60
|
+
type PaymentMode = 'cards' | 'solana';
|
|
60
61
|
type NotificationStatus = 'default' | 'success' | 'info' | 'destructive';
|
|
61
62
|
interface NotificationPayload {
|
|
62
63
|
title: string;
|
|
@@ -65,6 +66,8 @@ interface NotificationPayload {
|
|
|
65
66
|
}
|
|
66
67
|
type NotificationHandler = (payload: NotificationPayload) => void;
|
|
67
68
|
|
|
69
|
+
type PaymentPlatform = 'nmi' | 'ccbill';
|
|
70
|
+
type CheckoutStatus = 'success' | 'pending' | 'redirect_required' | 'blocked';
|
|
68
71
|
interface BillingDetails {
|
|
69
72
|
firstName: string;
|
|
70
73
|
lastName: string;
|
|
@@ -144,9 +147,6 @@ interface BillingStatus {
|
|
|
144
147
|
is_premium: boolean;
|
|
145
148
|
access: BillingAccessGrant[];
|
|
146
149
|
}
|
|
147
|
-
|
|
148
|
-
type PaymentPlatform = 'nmi' | 'ccbill';
|
|
149
|
-
type CheckoutStatus = 'success' | 'pending' | 'redirect_required' | 'blocked';
|
|
150
150
|
interface CheckoutResponse {
|
|
151
151
|
status: CheckoutStatus;
|
|
152
152
|
message?: string;
|
|
@@ -201,6 +201,39 @@ interface SubscriptionCheckoutPayload {
|
|
|
201
201
|
processor?: string;
|
|
202
202
|
billing: BillingDetails;
|
|
203
203
|
}
|
|
204
|
+
interface SolanaWallet {
|
|
205
|
+
id: string;
|
|
206
|
+
address: string;
|
|
207
|
+
is_verified: boolean;
|
|
208
|
+
verified_at?: string;
|
|
209
|
+
created_at: string;
|
|
210
|
+
updated_at?: string;
|
|
211
|
+
user_id?: string;
|
|
212
|
+
}
|
|
213
|
+
interface WalletListResponse {
|
|
214
|
+
wallets: SolanaWallet[];
|
|
215
|
+
count: number;
|
|
216
|
+
}
|
|
217
|
+
interface WalletChallengeResponse {
|
|
218
|
+
wallet: string;
|
|
219
|
+
message: string;
|
|
220
|
+
expires_at: number;
|
|
221
|
+
nonce: string;
|
|
222
|
+
}
|
|
223
|
+
interface VerifyWalletResponse {
|
|
224
|
+
verified: boolean;
|
|
225
|
+
wallet: string;
|
|
226
|
+
verified_at?: string;
|
|
227
|
+
linked_wallet?: SolanaWallet;
|
|
228
|
+
}
|
|
229
|
+
interface WalletConnectionState {
|
|
230
|
+
isConnected: boolean;
|
|
231
|
+
isConnecting: boolean;
|
|
232
|
+
publicKey: string | null;
|
|
233
|
+
wallets: SolanaWallet[];
|
|
234
|
+
isLoading: boolean;
|
|
235
|
+
error: string | null;
|
|
236
|
+
}
|
|
204
237
|
|
|
205
238
|
interface GeneratePaymentRequest {
|
|
206
239
|
price_id: string;
|
|
@@ -420,40 +453,6 @@ interface PaymentProviderProps {
|
|
|
420
453
|
declare const PaymentProvider: React$1.FC<PaymentProviderProps>;
|
|
421
454
|
declare const usePaymentContext: () => PaymentContextValue;
|
|
422
455
|
|
|
423
|
-
interface SolanaWallet {
|
|
424
|
-
id: string;
|
|
425
|
-
address: string;
|
|
426
|
-
is_verified: boolean;
|
|
427
|
-
verified_at?: string;
|
|
428
|
-
created_at: string;
|
|
429
|
-
updated_at?: string;
|
|
430
|
-
user_id?: string;
|
|
431
|
-
}
|
|
432
|
-
interface WalletListResponse {
|
|
433
|
-
wallets: SolanaWallet[];
|
|
434
|
-
count: number;
|
|
435
|
-
}
|
|
436
|
-
interface WalletChallengeResponse {
|
|
437
|
-
wallet: string;
|
|
438
|
-
message: string;
|
|
439
|
-
expires_at: number;
|
|
440
|
-
nonce: string;
|
|
441
|
-
}
|
|
442
|
-
interface VerifyWalletResponse {
|
|
443
|
-
verified: boolean;
|
|
444
|
-
wallet: string;
|
|
445
|
-
verified_at?: string;
|
|
446
|
-
linked_wallet?: SolanaWallet;
|
|
447
|
-
}
|
|
448
|
-
interface WalletConnectionState {
|
|
449
|
-
isConnected: boolean;
|
|
450
|
-
isConnecting: boolean;
|
|
451
|
-
publicKey: string | null;
|
|
452
|
-
wallets: SolanaWallet[];
|
|
453
|
-
isLoading: boolean;
|
|
454
|
-
error: string | null;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
456
|
interface SubscriptionCheckoutModalProps {
|
|
458
457
|
open: boolean;
|
|
459
458
|
onOpenChange: (open: boolean) => void;
|
|
@@ -516,33 +515,6 @@ interface PaymentsDialogContextValue {
|
|
|
516
515
|
declare const PaymentsDialogProvider: React$1.FC<React$1.PropsWithChildren>;
|
|
517
516
|
declare const usePaymentDialogs: () => PaymentsDialogContextValue;
|
|
518
517
|
|
|
519
|
-
interface BillingThemeProviderProps {
|
|
520
|
-
children: React$1.ReactNode;
|
|
521
|
-
className?: string;
|
|
522
|
-
/**
|
|
523
|
-
* When true, applies the dark theme variant
|
|
524
|
-
* @default false
|
|
525
|
-
*/
|
|
526
|
-
dark?: boolean;
|
|
527
|
-
}
|
|
528
|
-
/**
|
|
529
|
-
* Scopes the Payments UI theme variables so host app styles are left intact.
|
|
530
|
-
* Use this to wrap any Payments UI components to ensure styles don't conflict
|
|
531
|
-
* with the consuming application.
|
|
532
|
-
*
|
|
533
|
-
* @example
|
|
534
|
-
* ```tsx
|
|
535
|
-
* <BillingThemeProvider>
|
|
536
|
-
* <SubscriptionCheckoutModal ... />
|
|
537
|
-
* </BillingThemeProvider>
|
|
538
|
-
* ```
|
|
539
|
-
*/
|
|
540
|
-
declare const BillingThemeProvider: React$1.FC<BillingThemeProviderProps>;
|
|
541
|
-
/**
|
|
542
|
-
prevent conflicts with client app styles
|
|
543
|
-
*/
|
|
544
|
-
declare const BillingThemePortal: React$1.FC<BillingThemeProviderProps>;
|
|
545
|
-
|
|
546
518
|
interface CardDetailsFormProps {
|
|
547
519
|
visible: boolean;
|
|
548
520
|
onTokenize: (token: string, billing: BillingDetails) => void;
|
|
@@ -825,4 +797,4 @@ declare const useSubscriptionActions: () => {
|
|
|
825
797
|
subscribeWithCCBill: ({ priceId, email, firstName, lastName, zipCode, country, processor, idempotencyKey, }: SubscribeWithCCBillParams) => Promise<CheckoutResponse>;
|
|
826
798
|
};
|
|
827
799
|
|
|
828
|
-
export { type AuthTokenProvider, type BillingAccessGrant, type BillingDetails, BillingHistory, type BillingHistoryProps, type BillingHistoryTranslations, type BillingStatus,
|
|
800
|
+
export { type AuthTokenProvider, type BillingAccessGrant, type BillingDetails, BillingHistory, type BillingHistoryProps, type BillingHistoryTranslations, type BillingStatus, type CCBillSubscribePayload, CancelMembershipDialog, type CancelMembershipDialogProps, type CancelMembershipDialogTranslations, CardDetailsForm, type CardDetailsFormProps, type CheckoutRequestPayload, type CheckoutResponse, type CheckoutStatus, type Client, ClientApiError, type ClientConfig, type CreatePaymentMethodPayload, type GeneratePaymentRequest, type GeneratePaymentResponse, type HttpMethod, type NmiSubscribePayload, type NotificationHandler, type NotificationPayload, type NotificationStatus, type PaginatedPaymentMethods, type PaginatedPayments, type PaginatedResponse, type Payment, type PaymentCallbacks, type PaymentConfig, PaymentContext, type PaymentContextValue, type PaymentError, PaymentExperience, type PaymentExperienceProps, type PaymentFeatureFlags, type PaymentFetcher, type PaymentMethod, type PaymentMethodOption, PaymentMethodsSection, type PaymentMethodsSectionProps, type PaymentMethodsSectionTranslations, type PaymentMode, type PaymentPlatform, PaymentProvider, type PaymentProviderProps, type PaymentSolanaConfig, type PaymentState, type PaymentStatusPayload, type PaymentStatusResponse, type PaymentStep, type PaymentSuccessPayload, type PaymentUserDetails, PaymentsDialogProvider, type RequestOptions, type SolanaFlowConfig, type SolanaPayQRCodeIntent, type SolanaPayStatusResponse, type SolanaPayTransaction, type SolanaPaymentMethod, SolanaPaymentSelector, type SolanaPaymentSelectorProps, SolanaPaymentView, type SolanaPaymentViewProps, type SolanaWallet, StoredPaymentMethods, type StoredPaymentMethodsProps, type SubmitPaymentRequest, type SubmitPaymentResponse, type SubscribeWithCCBillParams, type SubscribeWithCardParams, type SubscribeWithSavedMethodParams, SubscriptionCheckoutModal, type SubscriptionCheckoutModalProps, type SubscriptionCheckoutPayload, SubscriptionSuccessDialog, type SupportedTokensResponse, type TokenBalance, type TokenInfo, type TransactionStatus, type VerifyWalletResponse, type WalletChallengeResponse, type WalletConnectionState, WalletDialog, type WalletDialogProps, type WalletListResponse, WalletModal, type WalletModalProps, createClient, usePaymentContext, usePaymentDialogs, usePaymentMethods, usePaymentNotifications, usePaymentStatus, useSolanaQrPayment, useSubscriptionActions, useSupportedTokens, useTokenBalance };
|