@suportepos/split-checkout 0.3.3 → 0.3.5

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.
@@ -1,48 +1,37 @@
1
+ import { PaymentResult } from "./types";
1
2
  export type Product = {
2
3
  id?: string;
3
- name: string;
4
- unitPrice: number;
5
- quantity?: number;
4
+ nome: string;
5
+ preco: number;
6
+ quantidade?: number;
6
7
  };
7
8
  export type Split = {
8
9
  subordinateMerchantId?: string;
9
10
  valor: number;
10
11
  };
11
12
  export type Customer = {
12
- buyerName?: string;
13
- buyerEmail?: string;
14
- buyerPhone?: string;
15
- docType?: string;
16
- docNumber?: string;
13
+ nomeComprador?: string;
14
+ emailComprador?: string;
15
+ telefoneComprador?: string;
16
+ tipoDoc?: string;
17
+ numeroDoc?: string;
17
18
  cep?: string;
18
- address?: string;
19
- neighborhood?: string;
20
- number?: string;
21
- complement?: string;
22
- city?: string;
23
- uf?: string;
24
- };
25
- export type PaymentResult = {
26
- success: boolean;
27
- status?: number;
28
- label?: string;
29
- paymentId?: string;
30
- amount?: number;
31
- buyerName?: string;
32
- buyerEmail?: string;
33
- buyerPhone?: string;
34
- message: string;
35
- raw?: any;
19
+ endereco?: string;
20
+ bairro?: string;
21
+ numero?: string;
22
+ complemento?: string;
23
+ cidade?: string;
24
+ estado?: string;
36
25
  };
37
26
  export type CheckoutFlowProps = {
38
27
  merchantId: string;
39
- orderId: string;
40
- production: boolean;
41
- products: Product[];
28
+ codigoPedido: string;
29
+ producao: boolean;
30
+ produtos: Product[];
42
31
  splits: Split[];
43
- customer?: Customer;
32
+ cliente?: Customer;
44
33
  merchantName?: string;
45
- amountOverride?: number;
34
+ valorTotal?: number;
46
35
  onResponse?: (payload: PaymentResult) => void;
47
36
  uuid?: string;
48
37
  };
@@ -1 +1 @@
1
- export default function CheckoutFlowContent({ step, setStep, amount, merchantName, products, splits, customer, merchantId, orderId, uuid, production, onResponse, paymentEnabled, }: any): import("react/jsx-runtime").JSX.Element;
1
+ export default function CheckoutFlowContent({ step, setStep, valor, merchantName, produtos, splits, cliente, merchantId, codigoPedido, uuid, producao, onResponse, paymentEnabled, }: any): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function Header(): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,9 @@
1
- export type Product = {
2
- id?: string;
3
- name: string;
4
- unitPrice: number;
5
- quantity?: number;
6
- };
1
+ import { Product } from "./CheckoutFlow";
7
2
  type Props = {
8
3
  amount: number;
9
4
  merchantName?: string;
10
5
  sticky?: boolean;
11
6
  items?: Product[];
12
7
  };
13
- export default function OrderSummary({ amount, merchantName, sticky, items }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export default function OrderSummary({ amount, merchantName, items }: Props): import("react/jsx-runtime").JSX.Element;
14
9
  export {};
@@ -1,17 +1,17 @@
1
- import { Product } from "./OrderSummary";
2
- import { PaymentResult, Split, Customer } from "./CheckoutFlow";
1
+ import { Split, Customer, Product } from "./CheckoutFlow";
2
+ import { PaymentResult } from "./types";
3
3
  export type SplitCardFormProps = {
4
4
  merchantId: string;
5
- orderId: string;
6
- production: boolean;
7
- amount: number;
5
+ codigoPedido: string;
6
+ producao: boolean;
7
+ valor: number;
8
8
  merchantName?: string;
9
- summaryItems?: Product[];
9
+ produtos?: Product[];
10
10
  splits: Split[];
11
- customer?: Customer;
11
+ cliente?: Customer;
12
12
  installmentsOptions?: number[];
13
13
  onBack?: () => void;
14
14
  onResponse?: (payload: PaymentResult) => void;
15
15
  uuid?: string;
16
16
  };
17
- export default function SplitCheckoutForm({ merchantId, orderId, production, amount, splits, summaryItems, merchantName, customer, installmentsOptions, onBack, onResponse, uuid }: SplitCardFormProps): import("react/jsx-runtime").JSX.Element;
17
+ export default function SplitCheckoutForm({ merchantId, codigoPedido, producao, valor, splits, produtos, merchantName, cliente, installmentsOptions, onBack, onResponse, uuid }: SplitCardFormProps): import("react/jsx-runtime").JSX.Element;
@@ -1,16 +1,16 @@
1
- import { Product } from "./OrderSummary";
2
- import { PaymentResult, Split, Customer } from "./CheckoutFlow";
1
+ import { Split, Customer, Product } from "./CheckoutFlow";
2
+ import { PaymentResult } from "./types";
3
3
  export type SplitPixFormProps = {
4
4
  merchantId: string;
5
- orderId: string;
6
- production: boolean;
7
- amount: number;
5
+ codigoPedido: string;
6
+ producao: boolean;
7
+ valor: number;
8
8
  merchantName?: string;
9
- summaryItems?: Product[];
9
+ produtos?: Product[];
10
10
  splits: Split[];
11
- customer?: Customer;
11
+ cliente?: Customer;
12
12
  onBack?: () => void;
13
13
  onResponse?: (payload: PaymentResult) => void;
14
14
  uuid?: string;
15
15
  };
16
- export default function SplitPixForm({ merchantId, orderId, production, amount, merchantName, summaryItems, splits, customer, onBack, onResponse, uuid }: SplitPixFormProps): import("react/jsx-runtime").JSX.Element;
16
+ export default function SplitPixForm({ merchantId, codigoPedido, producao, valor, merchantName, produtos, splits, cliente, onBack, onResponse, uuid }: SplitPixFormProps): import("react/jsx-runtime").JSX.Element;
@@ -3,5 +3,6 @@ export { default as OrderSummary } from "./lib/OrderSummary";
3
3
  export { default as SplitCardForm } from "./lib/SplitCardForm";
4
4
  export { default as SplitPixForm } from "./lib/SplitPixForm";
5
5
  export { default as CheckoutFlowContent } from "./lib/CheckoutFlowContent";
6
+ export type { PaymentResult } from "./lib/types";
6
7
  export * from "./lib/theme";
7
8
  export * from "./lib/validators";
@@ -1,48 +1,37 @@
1
+ import { PaymentResult } from "./types";
1
2
  export type Product = {
2
3
  id?: string;
3
- name: string;
4
- unitPrice: number;
5
- quantity?: number;
4
+ nome: string;
5
+ preco: number;
6
+ quantidade?: number;
6
7
  };
7
8
  export type Split = {
8
9
  subordinateMerchantId?: string;
9
10
  valor: number;
10
11
  };
11
12
  export type Customer = {
12
- buyerName?: string;
13
- buyerEmail?: string;
14
- buyerPhone?: string;
15
- docType?: string;
16
- docNumber?: string;
13
+ nomeComprador?: string;
14
+ emailComprador?: string;
15
+ telefoneComprador?: string;
16
+ tipoDoc?: string;
17
+ numeroDoc?: string;
17
18
  cep?: string;
18
- address?: string;
19
- neighborhood?: string;
20
- number?: string;
21
- complement?: string;
22
- city?: string;
23
- uf?: string;
24
- };
25
- export type PaymentResult = {
26
- success: boolean;
27
- status?: number;
28
- label?: string;
29
- paymentId?: string;
30
- amount?: number;
31
- buyerName?: string;
32
- buyerEmail?: string;
33
- buyerPhone?: string;
34
- message: string;
35
- raw?: any;
19
+ endereco?: string;
20
+ bairro?: string;
21
+ numero?: string;
22
+ complemento?: string;
23
+ cidade?: string;
24
+ estado?: string;
36
25
  };
37
26
  export type CheckoutFlowProps = {
38
27
  merchantId: string;
39
- orderId: string;
40
- production: boolean;
41
- products: Product[];
28
+ codigoPedido: string;
29
+ producao: boolean;
30
+ produtos: Product[];
42
31
  splits: Split[];
43
- customer?: Customer;
32
+ cliente?: Customer;
44
33
  merchantName?: string;
45
- amountOverride?: number;
34
+ valorTotal?: number;
46
35
  onResponse?: (payload: PaymentResult) => void;
47
36
  uuid?: string;
48
37
  };
@@ -1 +1 @@
1
- export default function CheckoutFlowContent({ step, setStep, amount, merchantName, products, splits, customer, merchantId, orderId, uuid, production, onResponse, paymentEnabled, }: any): import("react/jsx-runtime").JSX.Element;
1
+ export default function CheckoutFlowContent({ step, setStep, valor, merchantName, produtos, splits, cliente, merchantId, codigoPedido, uuid, producao, onResponse, paymentEnabled, }: any): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,9 @@
1
- export type Product = {
2
- id?: string;
3
- name: string;
4
- unitPrice: number;
5
- quantity?: number;
6
- };
1
+ import { Product } from "./CheckoutFlow";
7
2
  type Props = {
8
3
  amount: number;
9
4
  merchantName?: string;
10
5
  sticky?: boolean;
11
6
  items?: Product[];
12
7
  };
13
- export default function OrderSummary({ amount, merchantName, sticky, items }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export default function OrderSummary({ amount, merchantName, items }: Props): import("react/jsx-runtime").JSX.Element;
14
9
  export {};
@@ -1,17 +1,17 @@
1
- import { Product } from "./OrderSummary";
2
- import { PaymentResult, Split, Customer } from "./CheckoutFlow";
1
+ import { Split, Customer, Product } from "./CheckoutFlow";
2
+ import { PaymentResult } from "./types";
3
3
  export type SplitCardFormProps = {
4
4
  merchantId: string;
5
- orderId: string;
6
- production: boolean;
7
- amount: number;
5
+ codigoPedido: string;
6
+ producao: boolean;
7
+ valor: number;
8
8
  merchantName?: string;
9
- summaryItems?: Product[];
9
+ produtos?: Product[];
10
10
  splits: Split[];
11
- customer?: Customer;
11
+ cliente?: Customer;
12
12
  installmentsOptions?: number[];
13
13
  onBack?: () => void;
14
14
  onResponse?: (payload: PaymentResult) => void;
15
15
  uuid?: string;
16
16
  };
17
- export default function SplitCheckoutForm({ merchantId, orderId, production, amount, splits, summaryItems, merchantName, customer, installmentsOptions, onBack, onResponse, uuid }: SplitCardFormProps): import("react/jsx-runtime").JSX.Element;
17
+ export default function SplitCheckoutForm({ merchantId, codigoPedido, producao, valor, splits, produtos, merchantName, cliente, installmentsOptions, onBack, onResponse, uuid }: SplitCardFormProps): import("react/jsx-runtime").JSX.Element;
@@ -1,16 +1,16 @@
1
- import { Product } from "./OrderSummary";
2
- import { PaymentResult, Split, Customer } from "./CheckoutFlow";
1
+ import { Split, Customer, Product } from "./CheckoutFlow";
2
+ import { PaymentResult } from "./types";
3
3
  export type SplitPixFormProps = {
4
4
  merchantId: string;
5
- orderId: string;
6
- production: boolean;
7
- amount: number;
5
+ codigoPedido: string;
6
+ producao: boolean;
7
+ valor: number;
8
8
  merchantName?: string;
9
- summaryItems?: Product[];
9
+ produtos?: Product[];
10
10
  splits: Split[];
11
- customer?: Customer;
11
+ cliente?: Customer;
12
12
  onBack?: () => void;
13
13
  onResponse?: (payload: PaymentResult) => void;
14
14
  uuid?: string;
15
15
  };
16
- export default function SplitPixForm({ merchantId, orderId, production, amount, merchantName, summaryItems, splits, customer, onBack, onResponse, uuid }: SplitPixFormProps): import("react/jsx-runtime").JSX.Element;
16
+ export default function SplitPixForm({ merchantId, codigoPedido, producao, valor, merchantName, produtos, splits, cliente, onBack, onResponse, uuid }: SplitPixFormProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export type PaymentResult = {
2
+ successo: boolean;
3
+ payment_id?: string;
4
+ valor?: number;
5
+ nomeComprador?: string;
6
+ emailComprador?: string;
7
+ telefoneComprador?: string;
8
+ mensagem: string;
9
+ };
@@ -1,13 +1,14 @@
1
- import { Product, Split, PaymentResult, Customer } from "./lib/CheckoutFlow";
2
- export declare function renderCheckout({ elementId, merchantId, production, orderId, products, splits, customer, merchantName, amountOverride, onResponse, }: {
1
+ import { Product, Split, Customer } from "./lib/CheckoutFlow";
2
+ import { PaymentResult } from "./lib/types";
3
+ export declare function renderCheckout({ elementId, merchantId, producao, codigoPedido, produtos, splits, cliente, merchantName, valorTotal, onResponse, }: {
3
4
  elementId: string;
4
5
  merchantId: string;
5
- orderId: string;
6
- production: boolean;
7
- products: Product[];
6
+ codigoPedido: string;
7
+ producao: boolean;
8
+ produtos: Product[];
8
9
  splits?: Split[];
9
- customer?: Customer;
10
+ cliente?: Customer;
10
11
  merchantName: string;
11
- amountOverride?: number;
12
+ valorTotal?: number;
12
13
  onResponse?: (result: PaymentResult) => void;
13
14
  }): void;
@@ -0,0 +1,9 @@
1
+ export type PaymentResult = {
2
+ successo: boolean;
3
+ payment_id?: string;
4
+ valor?: number;
5
+ nomeComprador?: string;
6
+ emailComprador?: string;
7
+ telefoneComprador?: string;
8
+ mensagem: string;
9
+ };
package/package.json CHANGED
@@ -1,46 +1,46 @@
1
- {
2
- "name": "@suportepos/split-checkout",
3
- "version": "0.3.3",
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
- ],
11
- "scripts": {
12
- "dev": "vite",
13
- "build": "vite build && tsc --project tsconfig.build.json",
14
- "preview": "vite preview",
15
- "build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
16
- "build:standalone": "vite build --config vite.config.standalone.ts && npm run build:types",
17
- "prepublishOnly": "npm run build && npm run build:standalone && cp README.md dist/README.md"
18
- },
19
- "peerDependencies": {
20
- "@emotion/react": ">=11.0.0",
21
- "@emotion/styled": ">=11.0.0",
22
- "@mui/icons-material": "^5.0.0 || ^7.0.0",
23
- "@mui/material": "^5.0.0 || ^7.0.0",
24
- "react": ">=18.0.0 <20.0.0",
25
- "react-dom": ">=18.0.0 <20.0.0"
26
- },
27
- "devDependencies": {
28
- "@emotion/react": "11.14.0",
29
- "@emotion/styled": "11.14.1",
30
- "@mui/icons-material": "7.3.1",
31
- "@mui/material": "7.3.1",
32
- "@types/react": "18.3.11",
33
- "@types/react-dom": "18.3.0",
34
- "@vitejs/plugin-react": "^4.2.0",
35
- "react": "18.3.1",
36
- "react-dom": "18.3.1",
37
- "terser": "^5.43.1",
38
- "typescript": "^5.5.4",
39
- "vite": "^7.1.3",
40
- "vite-plugin-dts": "^4.5.4",
41
- "rollup": "^4.49.0"
42
- },
43
- "publishConfig": {
44
- "access": "public"
45
- }
46
- }
1
+ {
2
+ "name": "@suportepos/split-checkout",
3
+ "version": "0.3.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": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "dev": "vite",
13
+ "build": "vite build && tsc --project tsconfig.build.json",
14
+ "preview": "vite preview",
15
+ "build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
16
+ "build:standalone": "vite build --config vite.config.standalone.ts && npm run build:types",
17
+ "prepublishOnly": "npm run build && npm run build:standalone && cp README.md dist/README.md"
18
+ },
19
+ "peerDependencies": {
20
+ "@emotion/react": ">=11.0.0",
21
+ "@emotion/styled": ">=11.0.0",
22
+ "@mui/icons-material": "^5.0.0 || ^7.0.0",
23
+ "@mui/material": "^5.0.0 || ^7.0.0",
24
+ "react": ">=18.0.0 <20.0.0",
25
+ "react-dom": ">=18.0.0 <20.0.0"
26
+ },
27
+ "devDependencies": {
28
+ "@emotion/react": "11.14.0",
29
+ "@emotion/styled": "11.14.1",
30
+ "@mui/icons-material": "7.3.1",
31
+ "@mui/material": "7.3.1",
32
+ "@types/react": "18.3.11",
33
+ "@types/react-dom": "18.3.0",
34
+ "@vitejs/plugin-react": "^4.2.0",
35
+ "react": "18.3.1",
36
+ "react-dom": "18.3.1",
37
+ "rollup": "^4.49.0",
38
+ "terser": "^5.44.0",
39
+ "typescript": "^5.5.4",
40
+ "vite": "^7.1.3",
41
+ "vite-plugin-dts": "^4.5.4"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ }
46
+ }