@suportepos/split-checkout 0.1.5 → 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.
@@ -8,6 +8,20 @@ export type Split = {
8
8
  subordinateMerchantId?: string;
9
9
  valor: number;
10
10
  };
11
+ export type Customer = {
12
+ buyerName?: string;
13
+ buyerEmail?: string;
14
+ buyerPhone?: string;
15
+ docType?: string;
16
+ docNumber?: string;
17
+ cep?: string;
18
+ address?: string;
19
+ neighborhood?: string;
20
+ number?: string;
21
+ complement?: string;
22
+ city?: string;
23
+ uf?: string;
24
+ };
11
25
  export type PaymentResult = {
12
26
  success: boolean;
13
27
  status?: number;
@@ -24,9 +38,10 @@ export type CheckoutFlowProps = {
24
38
  merchantId: string;
25
39
  products: Product[];
26
40
  splits: Split[];
41
+ customer?: Customer;
27
42
  merchantName?: string;
28
43
  description?: string;
29
44
  amountOverride?: number;
30
45
  onResponse?: (payload: PaymentResult) => void;
31
46
  };
32
- export default function CheckoutFlow({ merchantId, products, merchantName, amountOverride, splits, onResponse, }: CheckoutFlowProps): import("react/jsx-runtime").JSX.Element;
47
+ export default function CheckoutFlow({ merchantId, products, customer, merchantName, amountOverride, splits, onResponse, }: CheckoutFlowProps): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,14 @@
1
1
  import { Product } from './OrderSummary';
2
- import { PaymentResult, Split } from './CheckoutFlow';
2
+ import { PaymentResult, Split, Customer } from './CheckoutFlow';
3
3
  export type SplitCardFormProps = {
4
4
  merchantId: string;
5
5
  amount: number;
6
6
  merchantName?: string;
7
7
  summaryItems?: Product[];
8
8
  splits: Split[];
9
+ customer?: Customer;
9
10
  installmentsOptions?: number[];
10
11
  onBack?: () => void;
11
12
  onResponse?: (payload: PaymentResult) => void;
12
13
  };
13
- export default function SplitCheckoutForm({ merchantId, amount, splits, summaryItems, merchantName, installmentsOptions, onBack, onResponse, }: SplitCardFormProps): import("react/jsx-runtime").JSX.Element;
14
+ export default function SplitCheckoutForm({ merchantId, amount, splits, summaryItems, merchantName, customer, installmentsOptions, onBack, onResponse, }: SplitCardFormProps): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,13 @@
1
1
  import { Product } from './OrderSummary';
2
- import { PaymentResult, Split } from './CheckoutFlow';
2
+ import { PaymentResult, Split, Customer } from './CheckoutFlow';
3
3
  export type SplitPixFormProps = {
4
4
  merchantId: string;
5
5
  amount: number;
6
6
  merchantName?: string;
7
7
  summaryItems?: Product[];
8
8
  splits: Split[];
9
+ customer?: Customer;
9
10
  onBack?: () => void;
10
11
  onResponse?: (payload: PaymentResult) => void;
11
12
  };
12
- export default function SplitPixForm({ merchantId, amount, merchantName, summaryItems, splits, onBack, onResponse, }: SplitPixFormProps): import("react/jsx-runtime").JSX.Element;
13
+ export default function SplitPixForm({ merchantId, amount, merchantName, summaryItems, splits, customer, onBack, onResponse, }: SplitPixFormProps): import("react/jsx-runtime").JSX.Element;
@@ -8,6 +8,20 @@ export type Split = {
8
8
  subordinateMerchantId?: string;
9
9
  valor: number;
10
10
  };
11
+ export type Customer = {
12
+ buyerName?: string;
13
+ buyerEmail?: string;
14
+ buyerPhone?: string;
15
+ docType?: string;
16
+ docNumber?: string;
17
+ cep?: string;
18
+ address?: string;
19
+ neighborhood?: string;
20
+ number?: string;
21
+ complement?: string;
22
+ city?: string;
23
+ uf?: string;
24
+ };
11
25
  export type PaymentResult = {
12
26
  success: boolean;
13
27
  status?: number;
@@ -24,9 +38,10 @@ export type CheckoutFlowProps = {
24
38
  merchantId: string;
25
39
  products: Product[];
26
40
  splits: Split[];
41
+ customer?: Customer;
27
42
  merchantName?: string;
28
43
  description?: string;
29
44
  amountOverride?: number;
30
45
  onResponse?: (payload: PaymentResult) => void;
31
46
  };
32
- export default function CheckoutFlow({ merchantId, products, merchantName, amountOverride, splits, onResponse, }: CheckoutFlowProps): import("react/jsx-runtime").JSX.Element;
47
+ export default function CheckoutFlow({ merchantId, products, customer, merchantName, amountOverride, splits, onResponse, }: CheckoutFlowProps): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,14 @@
1
1
  import { Product } from "./OrderSummary";
2
- import { PaymentResult, Split } from "./CheckoutFlow";
2
+ import { PaymentResult, Split, Customer } from "./CheckoutFlow";
3
3
  export type SplitCardFormProps = {
4
4
  merchantId: string;
5
5
  amount: number;
6
6
  merchantName?: string;
7
7
  summaryItems?: Product[];
8
8
  splits: Split[];
9
+ customer?: Customer;
9
10
  installmentsOptions?: number[];
10
11
  onBack?: () => void;
11
12
  onResponse?: (payload: PaymentResult) => void;
12
13
  };
13
- export default function SplitCheckoutForm({ merchantId, amount, splits, summaryItems, merchantName, installmentsOptions, onBack, onResponse, }: SplitCardFormProps): import("react/jsx-runtime").JSX.Element;
14
+ export default function SplitCheckoutForm({ merchantId, amount, splits, summaryItems, merchantName, customer, installmentsOptions, onBack, onResponse, }: SplitCardFormProps): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,13 @@
1
1
  import { Product } from "./OrderSummary";
2
- import { PaymentResult, Split } from "./CheckoutFlow";
2
+ import { PaymentResult, Split, Customer } from "./CheckoutFlow";
3
3
  export type SplitPixFormProps = {
4
4
  merchantId: string;
5
5
  amount: number;
6
6
  merchantName?: string;
7
7
  summaryItems?: Product[];
8
8
  splits: Split[];
9
+ customer?: Customer;
9
10
  onBack?: () => void;
10
11
  onResponse?: (payload: PaymentResult) => void;
11
12
  };
12
- export default function SplitPixForm({ merchantId, amount, merchantName, summaryItems, splits, onBack, onResponse, }: SplitPixFormProps): import("react/jsx-runtime").JSX.Element;
13
+ export default function SplitPixForm({ merchantId, amount, merchantName, summaryItems, splits, customer, onBack, onResponse, }: SplitPixFormProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { Product, Split, PaymentResult } from "./lib/CheckoutFlow";
2
+ export declare function renderCheckout({ elementId, merchantId, products, splits, merchantName, amountOverride, onResponse, }: {
3
+ elementId: string;
4
+ merchantId: string;
5
+ products: Product[];
6
+ splits?: Split[];
7
+ merchantName: string;
8
+ amountOverride?: number;
9
+ onResponse?: (result: PaymentResult) => void;
10
+ }): void;
package/package.json CHANGED
@@ -1,42 +1,48 @@
1
- {
2
- "name": "@suportepos/split-checkout",
3
- "version": "0.1.5",
4
- "type": "module",
5
- "main": "dist/index.umd.js",
6
- "module": "dist/index.es.js",
7
- "types": "dist/types/index.d.ts",
8
- "files": ["dist", "dist/split-checkout.standalone.js"],
9
- "scripts": {
10
- "dev": "vite",
11
- "build": "vite build && tsc --project tsconfig.build.json",
12
- "preview": "vite preview",
13
- "build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
14
- "build:standalone": "vite build && vite build --config vite.config.standalone.ts && npm run build:types",
15
- "prepublishOnly": "npm run build && npm run build:standalone"
16
- },
17
- "peerDependencies": {
18
- "react": ">=18.0.0 <20.0.0",
19
- "react-dom": ">=18.0.0 <20.0.0",
20
- "@mui/material": ">=5.0.0",
21
- "@mui/icons-material": ">=5.0.0",
22
- "@emotion/react": ">=11.0.0",
23
- "@emotion/styled": ">=11.0.0"
24
- },
25
- "devDependencies": {
26
- "react": "18.3.1",
27
- "react-dom": "18.3.1",
28
- "@mui/material": "7.3.1",
29
- "@mui/icons-material": "7.3.1",
30
- "@emotion/react": "11.14.0",
31
- "@emotion/styled": "11.14.1",
32
- "@types/react": "18.3.11",
33
- "@types/react-dom": "18.3.0",
34
- "@vitejs/plugin-react": "^4.2.0",
35
- "typescript": "^5.5.4",
36
- "vite": "^7.1.3",
37
- "vite-plugin-dts": "^4.5.4"
38
- },
39
- "publishConfig": {
40
- "access": "public"
41
- }
42
- }
1
+ {
2
+ "name": "@suportepos/split-checkout",
3
+ "version": "0.1.8",
4
+ "type": "module",
5
+ "main": "dist/index.umd.js",
6
+ "module": "dist/index.es.js",
7
+ "types": "dist/types/index.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "dist/split-checkout.standalone.js"
11
+ ],
12
+ "scripts": {
13
+ "dev": "vite",
14
+ "build": "vite build && tsc --project tsconfig.build.json",
15
+ "preview": "vite preview",
16
+ "build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
17
+ "build:standalone": "vite build && vite build --config vite.config.standalone.ts && npm run build:types",
18
+ "prepublishOnly": "npm run build && npm run build:standalone"
19
+ },
20
+ "peerDependencies": {
21
+ "@emotion/react": ">=11.0.0",
22
+ "@emotion/styled": ">=11.0.0",
23
+ "@mui/icons-material": ">=5.0.0",
24
+ "@mui/material": ">=5.0.0",
25
+ "react": ">=18.0.0 <20.0.0",
26
+ "react-dom": ">=18.0.0 <20.0.0"
27
+ },
28
+ "devDependencies": {
29
+ "@emotion/react": "11.14.0",
30
+ "@emotion/styled": "11.14.1",
31
+ "@mui/icons-material": "7.3.1",
32
+ "@mui/material": "7.3.1",
33
+ "@types/react": "18.3.11",
34
+ "@types/react-dom": "18.3.0",
35
+ "@vitejs/plugin-react": "^4.2.0",
36
+ "react": "18.3.1",
37
+ "react-dom": "18.3.1",
38
+ "typescript": "^5.5.4",
39
+ "vite": "^7.1.3",
40
+ "vite-plugin-dts": "^4.5.4"
41
+ },
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "dependencies": {
46
+ "rollup": "^4.49.0"
47
+ }
48
+ }