@superlogic/spree-pay 0.1.4 → 0.1.6

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/build/index.d.cts CHANGED
@@ -12,11 +12,20 @@ declare const useCapture3DS: (searchParams: Record<string, string | null>) => vo
12
12
 
13
13
  type ENV = {
14
14
  environment: 'dev' | 'stg' | 'prod';
15
- accessToken: string;
15
+ ssoPageURI: string;
16
16
  tenantId: string;
17
17
  redirect3dsURI: string;
18
+ accessToken?: string;
18
19
  };
19
20
 
21
+ declare enum BASE_SYMBOLS {
22
+ MOCA = "MOCA",
23
+ USDC = "USDC",
24
+ WETH = "WETH",
25
+ USDT = "USDT",
26
+ ETH = "ETH"
27
+ }
28
+
20
29
  type Coin = {
21
30
  address: `0x${string}`;
22
31
  chainId: number;
@@ -25,13 +34,13 @@ type Coin = {
25
34
  logoURI?: string;
26
35
  name: string;
27
36
  raw?: bigint;
28
- symbol: string;
37
+ symbol: BASE_SYMBOLS;
29
38
  };
30
39
  type NativeCoin = {
31
40
  decimals: number;
32
41
  formatted: string;
33
42
  logoURI: string;
34
- symbol: string;
43
+ symbol: BASE_SYMBOLS;
35
44
  value: bigint;
36
45
  };
37
46
 
@@ -72,6 +81,20 @@ declare enum PaymentType {
72
81
  CREDIT_CARD = "CREDIT_CARD",
73
82
  CRYPTO = "CRYPTO"
74
83
  }
84
+ declare const enum SlapiPaymentStatus {
85
+ NOT_INITIALIZED = "NOT_INITIALIZED",// back-end only
86
+ PENDING = "PENDING",// back-end only
87
+ AUTHORIZED = "AUTHORIZED",// success
88
+ FAILED = "FAILED",// failed
89
+ CAPTURED = "CAPTURED",// success
90
+ VOIDED = "VOIDED",// back-end only
91
+ CAPTURE_FAILED = "CAPTURE_FAILED"
92
+ }
93
+ type PaymentMethodResult = {
94
+ status: SlapiPaymentStatus;
95
+ txHash?: string;
96
+ paymentId?: string;
97
+ };
75
98
 
76
99
  type SpreePayProviderProps = {
77
100
  children: ReactNode;
@@ -81,9 +104,7 @@ declare const SpreePayProvider: FC<SpreePayProviderProps>;
81
104
  declare const useSpreePay: () => {
82
105
  process: (data: {
83
106
  hash: string;
84
- }) => Promise<{
85
- status: string;
86
- }>;
107
+ }) => Promise<PaymentMethodResult>;
87
108
  enabled: boolean;
88
109
  selectedPaymentMethod: SelectedPaymentMethod;
89
110
  };
package/build/index.d.ts CHANGED
@@ -12,11 +12,20 @@ declare const useCapture3DS: (searchParams: Record<string, string | null>) => vo
12
12
 
13
13
  type ENV = {
14
14
  environment: 'dev' | 'stg' | 'prod';
15
- accessToken: string;
15
+ ssoPageURI: string;
16
16
  tenantId: string;
17
17
  redirect3dsURI: string;
18
+ accessToken?: string;
18
19
  };
19
20
 
21
+ declare enum BASE_SYMBOLS {
22
+ MOCA = "MOCA",
23
+ USDC = "USDC",
24
+ WETH = "WETH",
25
+ USDT = "USDT",
26
+ ETH = "ETH"
27
+ }
28
+
20
29
  type Coin = {
21
30
  address: `0x${string}`;
22
31
  chainId: number;
@@ -25,13 +34,13 @@ type Coin = {
25
34
  logoURI?: string;
26
35
  name: string;
27
36
  raw?: bigint;
28
- symbol: string;
37
+ symbol: BASE_SYMBOLS;
29
38
  };
30
39
  type NativeCoin = {
31
40
  decimals: number;
32
41
  formatted: string;
33
42
  logoURI: string;
34
- symbol: string;
43
+ symbol: BASE_SYMBOLS;
35
44
  value: bigint;
36
45
  };
37
46
 
@@ -72,6 +81,20 @@ declare enum PaymentType {
72
81
  CREDIT_CARD = "CREDIT_CARD",
73
82
  CRYPTO = "CRYPTO"
74
83
  }
84
+ declare const enum SlapiPaymentStatus {
85
+ NOT_INITIALIZED = "NOT_INITIALIZED",// back-end only
86
+ PENDING = "PENDING",// back-end only
87
+ AUTHORIZED = "AUTHORIZED",// success
88
+ FAILED = "FAILED",// failed
89
+ CAPTURED = "CAPTURED",// success
90
+ VOIDED = "VOIDED",// back-end only
91
+ CAPTURE_FAILED = "CAPTURE_FAILED"
92
+ }
93
+ type PaymentMethodResult = {
94
+ status: SlapiPaymentStatus;
95
+ txHash?: string;
96
+ paymentId?: string;
97
+ };
75
98
 
76
99
  type SpreePayProviderProps = {
77
100
  children: ReactNode;
@@ -81,9 +104,7 @@ declare const SpreePayProvider: FC<SpreePayProviderProps>;
81
104
  declare const useSpreePay: () => {
82
105
  process: (data: {
83
106
  hash: string;
84
- }) => Promise<{
85
- status: string;
86
- }>;
107
+ }) => Promise<PaymentMethodResult>;
87
108
  enabled: boolean;
88
109
  selectedPaymentMethod: SelectedPaymentMethod;
89
110
  };