@payconductor/react 1.1.0 → 1.2.0
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/README.md +253 -253
- package/dist/esm/three-ds.d.ts +1 -1
- package/dist/esm/tokenizer.d.ts +1 -1
- package/dist/index.cjs.js +49 -49
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +12 -11
- package/dist/index.es.js +1318 -1308
- package/dist/index.es.js.map +1 -1
- package/dist/payconductor/constants.d.ts +31 -31
- package/dist/payconductor/hooks/index.d.ts +7 -7
- package/dist/payconductor/hooks/use-element.d.ts +30 -30
- package/dist/payconductor/hooks/use-payconductor.d.ts +6 -6
- package/dist/payconductor/hooks/use-three-ds.d.ts +13 -13
- package/dist/payconductor/hooks/use-tokenizer.d.ts +11 -11
- package/dist/payconductor/iframe/constants.d.ts +8 -8
- package/dist/payconductor/iframe/types.d.ts +464 -464
- package/dist/payconductor/internal.d.ts +11 -11
- package/dist/payconductor/loader.d.ts +1 -1
- package/dist/payconductor/payconductor-element.d.ts +5 -5
- package/dist/payconductor/payconductor-three-ds.d.ts +5 -5
- package/dist/payconductor/payconductor.d.ts +17 -17
- package/dist/payconductor/three-ds/api.d.ts +12 -12
- package/dist/payconductor/three-ds/browser.d.ts +13 -13
- package/dist/payconductor/three-ds/handler.d.ts +11 -11
- package/dist/payconductor/three-ds/index.d.ts +3 -1
- package/dist/payconductor/three-ds/providers/index.d.ts +6 -6
- package/dist/payconductor/three-ds/providers/mercado-pago.d.ts +9 -9
- package/dist/payconductor/three-ds/providers/pagarme.d.ts +9 -9
- package/dist/payconductor/three-ds/providers/pagseguro.d.ts +7 -7
- package/dist/payconductor/three-ds/providers/payconductor.d.ts +7 -7
- package/dist/payconductor/three-ds/types.d.ts +93 -78
- package/dist/payconductor/tokenizer/api.d.ts +26 -26
- package/dist/payconductor/tokenizer/handler.d.ts +9 -9
- package/dist/payconductor/tokenizer/index.d.ts +1 -1
- package/dist/payconductor/tokenizer/providers/index.d.ts +6 -6
- package/dist/payconductor/tokenizer/providers/mercado-pago.d.ts +6 -6
- package/dist/payconductor/tokenizer/types.d.ts +50 -50
- package/dist/payconductor/types.d.ts +42 -42
- package/dist/payconductor/utils.d.ts +6 -6
- package/package.json +58 -58
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { IncomingMessage, OutgoingMessage } from './iframe/types';
|
|
2
|
-
|
|
3
|
-
export declare const IFRAME_BASE_URL: string;
|
|
4
|
-
export declare const ALLOWED_ORIGINS: string[];
|
|
5
|
-
export declare const IFRAME_DEFAULT_HEIGHT_VALUE = "600px";
|
|
6
|
-
export declare const REQUEST_TIMEOUT = 300000;
|
|
7
|
-
export declare const POST_MESSAGES: {
|
|
8
|
-
readonly INIT: OutgoingMessage.Init;
|
|
9
|
-
readonly CONFIG: OutgoingMessage.Config;
|
|
10
|
-
readonly UPDATE: OutgoingMessage.Update;
|
|
11
|
-
readonly CONFIRM_PAYMENT: OutgoingMessage.ConfirmPayment;
|
|
12
|
-
readonly VALIDATE: OutgoingMessage.Validate;
|
|
13
|
-
readonly RESET: OutgoingMessage.Reset;
|
|
14
|
-
readonly READY: IncomingMessage.Ready;
|
|
15
|
-
readonly ERROR: IncomingMessage.Error;
|
|
16
|
-
readonly PAYMENT_COMPLETE: IncomingMessage.PaymentComplete;
|
|
17
|
-
readonly PAYMENT_FAILED: IncomingMessage.PaymentFailed;
|
|
18
|
-
readonly PAYMENT_PENDING: IncomingMessage.PaymentPending;
|
|
19
|
-
readonly VALIDATION_ERROR: IncomingMessage.ValidationError;
|
|
20
|
-
readonly PAYMENT_METHOD_SELECTED: IncomingMessage.PaymentMethodSelected;
|
|
21
|
-
readonly RESIZE: IncomingMessage.Resize;
|
|
22
|
-
};
|
|
23
|
-
export declare const ERROR_CODES: {
|
|
24
|
-
readonly INVALID_CLIENT: "InvalidClient";
|
|
25
|
-
readonly INVALID_TOKEN: "InvalidToken";
|
|
26
|
-
readonly NETWORK_ERROR: "NetworkError";
|
|
27
|
-
readonly IFRAME_NOT_READY: "IframeNotReady";
|
|
28
|
-
readonly PAYMENT_DECLINED: "PaymentDeclined";
|
|
29
|
-
readonly VALIDATION_ERROR: "ValidationError";
|
|
30
|
-
readonly TIMEOUT: "Timeout";
|
|
31
|
-
};
|
|
1
|
+
import { IncomingMessage, OutgoingMessage } from './iframe/types';
|
|
2
|
+
|
|
3
|
+
export declare const IFRAME_BASE_URL: string;
|
|
4
|
+
export declare const ALLOWED_ORIGINS: string[];
|
|
5
|
+
export declare const IFRAME_DEFAULT_HEIGHT_VALUE = "600px";
|
|
6
|
+
export declare const REQUEST_TIMEOUT = 300000;
|
|
7
|
+
export declare const POST_MESSAGES: {
|
|
8
|
+
readonly INIT: OutgoingMessage.Init;
|
|
9
|
+
readonly CONFIG: OutgoingMessage.Config;
|
|
10
|
+
readonly UPDATE: OutgoingMessage.Update;
|
|
11
|
+
readonly CONFIRM_PAYMENT: OutgoingMessage.ConfirmPayment;
|
|
12
|
+
readonly VALIDATE: OutgoingMessage.Validate;
|
|
13
|
+
readonly RESET: OutgoingMessage.Reset;
|
|
14
|
+
readonly READY: IncomingMessage.Ready;
|
|
15
|
+
readonly ERROR: IncomingMessage.Error;
|
|
16
|
+
readonly PAYMENT_COMPLETE: IncomingMessage.PaymentComplete;
|
|
17
|
+
readonly PAYMENT_FAILED: IncomingMessage.PaymentFailed;
|
|
18
|
+
readonly PAYMENT_PENDING: IncomingMessage.PaymentPending;
|
|
19
|
+
readonly VALIDATION_ERROR: IncomingMessage.ValidationError;
|
|
20
|
+
readonly PAYMENT_METHOD_SELECTED: IncomingMessage.PaymentMethodSelected;
|
|
21
|
+
readonly RESIZE: IncomingMessage.Resize;
|
|
22
|
+
};
|
|
23
|
+
export declare const ERROR_CODES: {
|
|
24
|
+
readonly INVALID_CLIENT: "InvalidClient";
|
|
25
|
+
readonly INVALID_TOKEN: "InvalidToken";
|
|
26
|
+
readonly NETWORK_ERROR: "NetworkError";
|
|
27
|
+
readonly IFRAME_NOT_READY: "IframeNotReady";
|
|
28
|
+
readonly PAYMENT_DECLINED: "PaymentDeclined";
|
|
29
|
+
readonly VALIDATION_ERROR: "ValidationError";
|
|
30
|
+
readonly TIMEOUT: "Timeout";
|
|
31
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { usePayConductor } from './use-payconductor';
|
|
2
|
-
export { usePayconductorElement } from './use-element';
|
|
3
|
-
export type { UsePayconductorElementReturn } from './use-element';
|
|
4
|
-
export { useThreeDS } from './use-three-ds';
|
|
5
|
-
export type { UseThreeDSOptions, UseThreeDSReturn } from './use-three-ds';
|
|
6
|
-
export { useTokenizer } from './use-tokenizer';
|
|
7
|
-
export type { UseTokenizerOptions, UseTokenizerReturn } from './use-tokenizer';
|
|
1
|
+
export { usePayConductor } from './use-payconductor';
|
|
2
|
+
export { usePayconductorElement } from './use-element';
|
|
3
|
+
export type { UsePayconductorElementReturn } from './use-element';
|
|
4
|
+
export { useThreeDS } from './use-three-ds';
|
|
5
|
+
export type { UseThreeDSOptions, UseThreeDSReturn } from './use-three-ds';
|
|
6
|
+
export { useTokenizer } from './use-tokenizer';
|
|
7
|
+
export type { UseTokenizerOptions, UseTokenizerReturn } from './use-tokenizer';
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { BillingDetails, PayConductorConfig, PaymentMethod, PaymentResult } from '../iframe/types';
|
|
2
|
-
|
|
3
|
-
export type SubmitResult = {
|
|
4
|
-
error?: {
|
|
5
|
-
message: string;
|
|
6
|
-
code?: string;
|
|
7
|
-
type?: "validation_error" | "payment_error";
|
|
8
|
-
};
|
|
9
|
-
paymentMethod?: PaymentMethod;
|
|
10
|
-
};
|
|
11
|
-
export type ConfirmPaymentOptions = {
|
|
12
|
-
orderId: string;
|
|
13
|
-
returnUrl?: string;
|
|
14
|
-
};
|
|
15
|
-
export type UpdateOptions = {
|
|
16
|
-
billingDetails?: Partial<BillingDetails>;
|
|
17
|
-
address?: Partial<BillingDetails["address"]>;
|
|
18
|
-
};
|
|
19
|
-
export interface UsePayconductorElementReturn {
|
|
20
|
-
init: (config: PayConductorConfig) => Promise<void>;
|
|
21
|
-
confirmPayment: (options: ConfirmPaymentOptions) => Promise<PaymentResult>;
|
|
22
|
-
validate: (data: unknown) => Promise<boolean>;
|
|
23
|
-
reset: () => Promise<void>;
|
|
24
|
-
getSelectedPaymentMethod: () => PaymentMethod | null;
|
|
25
|
-
updateConfig: (config: Partial<Pick<PayConductorConfig, "theme" | "locale" | "paymentMethods">>) => void;
|
|
26
|
-
updateOrderId: (orderId: string) => void;
|
|
27
|
-
update: (options: UpdateOptions) => void;
|
|
28
|
-
submit: () => Promise<SubmitResult>;
|
|
29
|
-
}
|
|
30
|
-
export declare function usePayconductorElement(): UsePayconductorElementReturn;
|
|
1
|
+
import { BillingDetails, PayConductorConfig, PaymentMethod, PaymentResult } from '../iframe/types';
|
|
2
|
+
|
|
3
|
+
export type SubmitResult = {
|
|
4
|
+
error?: {
|
|
5
|
+
message: string;
|
|
6
|
+
code?: string;
|
|
7
|
+
type?: "validation_error" | "payment_error";
|
|
8
|
+
};
|
|
9
|
+
paymentMethod?: PaymentMethod;
|
|
10
|
+
};
|
|
11
|
+
export type ConfirmPaymentOptions = {
|
|
12
|
+
orderId: string;
|
|
13
|
+
returnUrl?: string;
|
|
14
|
+
};
|
|
15
|
+
export type UpdateOptions = {
|
|
16
|
+
billingDetails?: Partial<BillingDetails>;
|
|
17
|
+
address?: Partial<BillingDetails["address"]>;
|
|
18
|
+
};
|
|
19
|
+
export interface UsePayconductorElementReturn {
|
|
20
|
+
init: (config: PayConductorConfig) => Promise<void>;
|
|
21
|
+
confirmPayment: (options: ConfirmPaymentOptions) => Promise<PaymentResult>;
|
|
22
|
+
validate: (data: unknown) => Promise<boolean>;
|
|
23
|
+
reset: () => Promise<void>;
|
|
24
|
+
getSelectedPaymentMethod: () => PaymentMethod | null;
|
|
25
|
+
updateConfig: (config: Partial<Pick<PayConductorConfig, "theme" | "locale" | "paymentMethods">>) => void;
|
|
26
|
+
updateOrderId: (orderId: string) => void;
|
|
27
|
+
update: (options: UpdateOptions) => void;
|
|
28
|
+
submit: () => Promise<SubmitResult>;
|
|
29
|
+
}
|
|
30
|
+
export declare function usePayconductorElement(): UsePayconductorElementReturn;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PayConductorConfig } from '../iframe/types';
|
|
2
|
-
import { PayConductorFrame } from '../types';
|
|
3
|
-
|
|
4
|
-
type UsePayConductorReturn = PayConductorFrame & Partial<PayConductorConfig>;
|
|
5
|
-
export declare function usePayConductor(): UsePayConductorReturn;
|
|
6
|
-
export {};
|
|
1
|
+
import { PayConductorConfig } from '../iframe/types';
|
|
2
|
+
import { PayConductorFrame } from '../types';
|
|
3
|
+
|
|
4
|
+
type UsePayConductorReturn = PayConductorFrame & Partial<PayConductorConfig>;
|
|
5
|
+
export declare function usePayConductor(): UsePayConductorReturn;
|
|
6
|
+
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ThreeDSecureData, ThreeDSecureResult } from '../three-ds/types';
|
|
2
|
-
|
|
3
|
-
export type UseThreeDSOptions = {
|
|
4
|
-
onChallenge?: () => void;
|
|
5
|
-
onComplete?: () => void;
|
|
6
|
-
onError?: (error: Error) => void;
|
|
7
|
-
onTimeout?: () => void;
|
|
8
|
-
};
|
|
9
|
-
export type UseThreeDSReturn = {
|
|
10
|
-
handleChallenge: (threeDSecure: ThreeDSecureData) => Promise<ThreeDSecureResult>;
|
|
11
|
-
destroy: () => void;
|
|
12
|
-
};
|
|
13
|
-
export declare function useThreeDS(options?: UseThreeDSOptions): UseThreeDSReturn;
|
|
1
|
+
import { ThreeDSecureData, ThreeDSecureResult } from '../three-ds/types';
|
|
2
|
+
|
|
3
|
+
export type UseThreeDSOptions = {
|
|
4
|
+
onChallenge?: () => void;
|
|
5
|
+
onComplete?: () => void;
|
|
6
|
+
onError?: (error: Error) => void;
|
|
7
|
+
onTimeout?: () => void;
|
|
8
|
+
};
|
|
9
|
+
export type UseThreeDSReturn = {
|
|
10
|
+
handleChallenge: (threeDSecure: ThreeDSecureData) => Promise<ThreeDSecureResult>;
|
|
11
|
+
destroy: () => void;
|
|
12
|
+
};
|
|
13
|
+
export declare function useThreeDS(options?: UseThreeDSOptions): UseThreeDSReturn;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CardTokenizerRequest } from '../tokenizer/types';
|
|
2
|
-
|
|
3
|
-
export type UseTokenizerOptions = {
|
|
4
|
-
publicKey: string;
|
|
5
|
-
onSuccess?: (token: string) => void;
|
|
6
|
-
onError?: (error: Error) => void;
|
|
7
|
-
};
|
|
8
|
-
export type UseTokenizerReturn = {
|
|
9
|
-
tokenizeCard: (input: CardTokenizerRequest) => Promise<string | null>;
|
|
10
|
-
};
|
|
11
|
-
export declare function useTokenizer(options: UseTokenizerOptions): UseTokenizerReturn;
|
|
1
|
+
import { CardTokenizerRequest } from '../tokenizer/types';
|
|
2
|
+
|
|
3
|
+
export type UseTokenizerOptions = {
|
|
4
|
+
publicKey: string;
|
|
5
|
+
onSuccess?: (token: string) => void;
|
|
6
|
+
onError?: (error: Error) => void;
|
|
7
|
+
};
|
|
8
|
+
export type UseTokenizerReturn = {
|
|
9
|
+
tokenizeCard: (input: CardTokenizerRequest) => Promise<string | null>;
|
|
10
|
+
};
|
|
11
|
+
export declare function useTokenizer(options: UseTokenizerOptions): UseTokenizerReturn;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare const APP_BASE_URL_PROD = "https://app.payconductor.ai";
|
|
2
|
-
export declare const API_BASE_URL_PROD = "https://app.payconductor.ai/api/v1";
|
|
3
|
-
export declare const IFRAME_BASE_URL_PROD = "https://iframe.payconductor.ai/v1";
|
|
4
|
-
export declare const IFRAME_BASE_URL_DEV = "http://localhost:5175/v1";
|
|
5
|
-
export declare const APP_BASE_URL_DEV = "http://localhost:3000";
|
|
6
|
-
export declare const DEFAULT_LOCALE = "pt-BR";
|
|
7
|
-
export declare const REQUEST_TIMEOUT_MS = 300000;
|
|
8
|
-
export declare const IFRAME_DEFAULT_HEIGHT = "600px";
|
|
1
|
+
export declare const APP_BASE_URL_PROD = "https://app.payconductor.ai";
|
|
2
|
+
export declare const API_BASE_URL_PROD = "https://app.payconductor.ai/api/v1";
|
|
3
|
+
export declare const IFRAME_BASE_URL_PROD = "https://iframe.payconductor.ai/v1";
|
|
4
|
+
export declare const IFRAME_BASE_URL_DEV = "http://localhost:5175/v1";
|
|
5
|
+
export declare const APP_BASE_URL_DEV = "http://localhost:3000";
|
|
6
|
+
export declare const DEFAULT_LOCALE = "pt-BR";
|
|
7
|
+
export declare const REQUEST_TIMEOUT_MS = 300000;
|
|
8
|
+
export declare const IFRAME_DEFAULT_HEIGHT = "600px";
|