@superlogic/spree-pay 0.0.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.
@@ -0,0 +1,84 @@
1
+ import { FC, ReactNode } from 'react';
2
+
3
+ type SpreePayProps = {
4
+ amount?: string;
5
+ className?: string;
6
+ };
7
+ declare const SpreePay: FC<SpreePayProps>;
8
+
9
+ type ENV = {
10
+ userId: string;
11
+ stripePublicKey: string;
12
+ slapiUrl: string;
13
+ slapiAuthKey: string;
14
+ accessToken: string;
15
+ };
16
+
17
+ type Card = {
18
+ active: boolean;
19
+ addressZipCheck: string;
20
+ cardId: string;
21
+ createdAt: Date;
22
+ default: boolean;
23
+ expireMonth: string;
24
+ expireYear: string;
25
+ id: string;
26
+ issuer: string;
27
+ issuerCountry: string;
28
+ lastFourNumbers: string;
29
+ metadata: Record<string, any>;
30
+ name: string;
31
+ paymentProvider: string;
32
+ schema: string | undefined;
33
+ updatedAt: Date;
34
+ userId: string;
35
+ zipCode: string;
36
+ };
37
+ declare const enum COIN {
38
+ SOL = "SOL",
39
+ TRUMP = "TRUMP",
40
+ BONK = "BONK",
41
+ USDC = "USDC"
42
+ }
43
+ type Coin = {
44
+ address: string;
45
+ name: string;
46
+ symbol: COIN;
47
+ decimals: number;
48
+ logoURI: string;
49
+ };
50
+ type CoinWithBallance = Coin & {
51
+ balance?: number;
52
+ };
53
+ type NewCard = Pick<Card, 'expireMonth' | 'expireYear' | 'lastFourNumbers' | 'schema' | 'active'> & {
54
+ token: string;
55
+ id: string;
56
+ };
57
+ type CardPaymentMethod = {
58
+ method: NewCard | Card | null;
59
+ type: PaymentType.CREDIT_CARD;
60
+ };
61
+ type CryptoPaymentMethod = {
62
+ method: CoinWithBallance | null;
63
+ type: PaymentType.CRYPTO;
64
+ };
65
+ type SelectedPaymentMethod = CardPaymentMethod | CryptoPaymentMethod;
66
+ declare enum PaymentType {
67
+ CREDIT_CARD = "CREDIT_CARD",
68
+ CRYPTO = "CRYPTO"
69
+ }
70
+
71
+ type SpreePayProviderProps = {
72
+ children: ReactNode;
73
+ env: ENV;
74
+ };
75
+ declare const SpreePayProvider: FC<SpreePayProviderProps>;
76
+ declare const useSpreePay: () => {
77
+ process: (data: {
78
+ hash: string;
79
+ }) => Promise<unknown>;
80
+ enabled: boolean;
81
+ selectedPaymentMethod: SelectedPaymentMethod;
82
+ };
83
+
84
+ export { SpreePay, type SpreePayProps, SpreePayProvider, useSpreePay };
@@ -0,0 +1,84 @@
1
+ import { FC, ReactNode } from 'react';
2
+
3
+ type SpreePayProps = {
4
+ amount?: string;
5
+ className?: string;
6
+ };
7
+ declare const SpreePay: FC<SpreePayProps>;
8
+
9
+ type ENV = {
10
+ userId: string;
11
+ stripePublicKey: string;
12
+ slapiUrl: string;
13
+ slapiAuthKey: string;
14
+ accessToken: string;
15
+ };
16
+
17
+ type Card = {
18
+ active: boolean;
19
+ addressZipCheck: string;
20
+ cardId: string;
21
+ createdAt: Date;
22
+ default: boolean;
23
+ expireMonth: string;
24
+ expireYear: string;
25
+ id: string;
26
+ issuer: string;
27
+ issuerCountry: string;
28
+ lastFourNumbers: string;
29
+ metadata: Record<string, any>;
30
+ name: string;
31
+ paymentProvider: string;
32
+ schema: string | undefined;
33
+ updatedAt: Date;
34
+ userId: string;
35
+ zipCode: string;
36
+ };
37
+ declare const enum COIN {
38
+ SOL = "SOL",
39
+ TRUMP = "TRUMP",
40
+ BONK = "BONK",
41
+ USDC = "USDC"
42
+ }
43
+ type Coin = {
44
+ address: string;
45
+ name: string;
46
+ symbol: COIN;
47
+ decimals: number;
48
+ logoURI: string;
49
+ };
50
+ type CoinWithBallance = Coin & {
51
+ balance?: number;
52
+ };
53
+ type NewCard = Pick<Card, 'expireMonth' | 'expireYear' | 'lastFourNumbers' | 'schema' | 'active'> & {
54
+ token: string;
55
+ id: string;
56
+ };
57
+ type CardPaymentMethod = {
58
+ method: NewCard | Card | null;
59
+ type: PaymentType.CREDIT_CARD;
60
+ };
61
+ type CryptoPaymentMethod = {
62
+ method: CoinWithBallance | null;
63
+ type: PaymentType.CRYPTO;
64
+ };
65
+ type SelectedPaymentMethod = CardPaymentMethod | CryptoPaymentMethod;
66
+ declare enum PaymentType {
67
+ CREDIT_CARD = "CREDIT_CARD",
68
+ CRYPTO = "CRYPTO"
69
+ }
70
+
71
+ type SpreePayProviderProps = {
72
+ children: ReactNode;
73
+ env: ENV;
74
+ };
75
+ declare const SpreePayProvider: FC<SpreePayProviderProps>;
76
+ declare const useSpreePay: () => {
77
+ process: (data: {
78
+ hash: string;
79
+ }) => Promise<unknown>;
80
+ enabled: boolean;
81
+ selectedPaymentMethod: SelectedPaymentMethod;
82
+ };
83
+
84
+ export { SpreePay, type SpreePayProps, SpreePayProvider, useSpreePay };