@monei-js/components 1.2.0 → 1.5.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/dist/api.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { CreateApplePaySessionRequest, CreatePaymentRequest, CreateTokenRequest, CreateTokenResponse, GetPaymentMethodsRequest, GetPaymentMethodsResponse, PaymentResult, SendPaymentReceiptRequest } from './types';
1
+ import { CalculateFinancingRequest, CalculateFinancingResponse, CreateApplePaySessionRequest, CreatePaymentRequest, CreateTokenRequest, CreateTokenResponse, GetPaymentMethodsRequest, GetPaymentMethodsResponse, PaymentResult, SendPaymentReceiptRequest } from './types';
2
2
  import { ConfirmPaymentParams } from './paymentModal';
3
- export declare const getPaymentMethods: ({ accountId, paymentId, }: GetPaymentMethodsRequest) => Promise<GetPaymentMethodsResponse>;
4
- export declare const createToken: ({ paymentMethod, paymentId, sessionId, amount, currency, accountId, }: CreateTokenRequest) => Promise<CreateTokenResponse>;
3
+ export declare const getPaymentMethods: ({ accountId, paymentId }: GetPaymentMethodsRequest) => Promise<GetPaymentMethodsResponse>;
4
+ export declare const createToken: ({ paymentMethod, paymentId, sessionId, amount, currency, accountId }: CreateTokenRequest) => Promise<CreateTokenResponse>;
5
5
  export declare const getPayment: (paymentId: string) => Promise<PaymentResult>;
6
- export declare const confirmPayment: ({ paymentId, ...params }: ConfirmPaymentParams) => Promise<PaymentResult>;
7
- export declare const createPayment: ({ signature, ...params }: CreatePaymentRequest) => Promise<PaymentResult>;
8
- export declare const sendPaymentReceipt: ({ paymentId, customerEmail, signature, language, }: SendPaymentReceiptRequest) => Promise<PaymentResult>;
9
- export declare const createApplePaySession: (params: CreateApplePaySessionRequest) => Promise<any>;
6
+ export declare const confirmPayment: ({ paymentId, ...body }: ConfirmPaymentParams) => Promise<PaymentResult>;
7
+ export declare const createPayment: ({ signature, ...body }: CreatePaymentRequest) => Promise<PaymentResult>;
8
+ export declare const sendPaymentReceipt: ({ paymentId, customerEmail, signature, language }: SendPaymentReceiptRequest) => Promise<PaymentResult>;
9
+ export declare const createApplePaySession: (body: CreateApplePaySessionRequest) => Promise<any>;
10
+ export declare const calculateFinancing: (req: CalculateFinancingRequest) => Promise<CalculateFinancingResponse>;
@@ -1,4 +1,4 @@
1
1
  export declare enum EVENT {
2
2
  BEFORE_CLOSE = "BEFORE_CLOSE"
3
3
  }
4
- export declare function containerTemplate({ uid, frame, prerenderFrame, doc, props, event, dimensions: { width, height }, }: Record<any, any>): HTMLElement | undefined;
4
+ export declare function containerTemplate({ uid, frame, prerenderFrame, doc, props, event, dimensions: { width, height } }: Record<any, any>): HTMLElement | undefined;
@@ -1,7 +1,7 @@
1
1
  import { CardInputProps } from './types';
2
2
  import { MoneiComponent } from '../../types/component';
3
3
  export * from './types';
4
- export declare const createToken: (component?: MoneiComponent<CardInputProps> | undefined) => Promise<{
4
+ export declare const createToken: (component?: MoneiComponent<CardInputProps> | undefined, options?: any) => Promise<{
5
5
  token?: string;
6
6
  error?: string;
7
7
  }>;
@@ -11,8 +11,8 @@ export declare type CardInputStyle = {
11
11
  };
12
12
  export declare type CardInputOnChangeEvent = {
13
13
  isTouched: boolean;
14
+ isSubmitted: boolean;
14
15
  error?: string;
15
- focused?: string;
16
16
  cardType?: string;
17
17
  };
18
18
  export declare type CardInputProps = {
@@ -0,0 +1,4 @@
1
+ export declare enum EVENT {
2
+ BEFORE_CLOSE = "BEFORE_CLOSE"
3
+ }
4
+ export declare function containerTemplate({ uid, frame, prerenderFrame, doc, props, event, dimensions: { width, height } }: Record<any, any>): HTMLElement | undefined;
@@ -0,0 +1,5 @@
1
+ import { Click2PayProps } from './types';
2
+ import { MoneiComponent } from '../../types/component';
3
+ export * from './types';
4
+ export * from './modal';
5
+ export declare const Click2Pay: MoneiComponent<Click2PayProps>;
@@ -0,0 +1,3 @@
1
+ import { Click2PayModalProps } from './types';
2
+ import { MoneiComponent } from '../../types/component';
3
+ export declare const Click2PayModal: MoneiComponent<Click2PayModalProps>;
@@ -0,0 +1,23 @@
1
+ export interface Click2PayProps {
2
+ paymentId: string;
3
+ amount: number;
4
+ currency: string;
5
+ fullscreen?: boolean;
6
+ language?: string;
7
+ onError?: (error: any) => void;
8
+ onProps?: (cb: (props: Click2PayProps) => void) => Promise<void>;
9
+ onSubmit: (data: {
10
+ token?: string;
11
+ error?: string;
12
+ }) => void;
13
+ onLoad?: (isSupported: boolean) => void;
14
+ onOpen?: () => void;
15
+ style?: {
16
+ height?: number;
17
+ type?: 'pay' | 'plain';
18
+ };
19
+ }
20
+ export interface Click2PayModalProps extends Click2PayProps {
21
+ isOpen?: boolean;
22
+ onError: (error: any) => void;
23
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum EVENT {
2
+ BEFORE_CLOSE = "BEFORE_CLOSE"
3
+ }
4
+ export declare function containerTemplate({ uid, frame, prerenderFrame, doc, props, event, dimensions: { width, height } }: Record<any, any>): HTMLElement | undefined;
@@ -0,0 +1,6 @@
1
+ import { CofidisProps } from './types';
2
+ import { MoneiComponent } from '../../types/component';
3
+ export * from './types';
4
+ export * from './modal';
5
+ export * from './widget';
6
+ export declare const Cofidis: MoneiComponent<CofidisProps>;
@@ -0,0 +1,3 @@
1
+ import { CofidisModalProps } from './types';
2
+ import { MoneiComponent } from '../../types/component';
3
+ export declare const CofidisModal: MoneiComponent<CofidisModalProps>;
@@ -0,0 +1,44 @@
1
+ import { CSSObject } from '../../types/css';
2
+ export interface CofidisProps {
3
+ paymentId?: string;
4
+ language?: string;
5
+ hint?: boolean;
6
+ onError?: (error: any) => void;
7
+ onProps?: (cb: (props: CofidisProps) => void) => Promise<void>;
8
+ onLoad?: (isSupported: boolean) => void;
9
+ onOpen?: () => void;
10
+ onSubmit: (data: {
11
+ token?: string;
12
+ error?: string;
13
+ redirectUrl?: string;
14
+ }) => void;
15
+ fullscreen?: boolean;
16
+ style?: {
17
+ height?: number;
18
+ };
19
+ }
20
+ export interface CofidisModalProps extends CofidisProps {
21
+ isOpen?: boolean;
22
+ amount: number;
23
+ currency: string;
24
+ accountId: string;
25
+ onError: (error: any) => void;
26
+ }
27
+ export interface CofidisWidgetProps {
28
+ amount?: number;
29
+ amountInt?: number;
30
+ accountId: string;
31
+ language?: string;
32
+ showLogo?: boolean;
33
+ style?: {
34
+ base?: CSSObject;
35
+ link?: CSSObject;
36
+ amount?: CSSObject;
37
+ label?: CSSObject;
38
+ terms?: CSSObject;
39
+ logo?: CSSObject;
40
+ content?: CSSObject;
41
+ };
42
+ onError?: (error: any) => void;
43
+ onLoad?: () => void;
44
+ }
@@ -0,0 +1,3 @@
1
+ import { CofidisWidgetProps } from './types';
2
+ import { MoneiComponent } from '../../types/component';
3
+ export declare const CofidisWidget: MoneiComponent<CofidisWidgetProps>;
@@ -0,0 +1,4 @@
1
+ export declare enum EVENT {
2
+ BEFORE_CLOSE = "BEFORE_CLOSE"
3
+ }
4
+ export declare function containerTemplate({ uid, frame, prerenderFrame, doc, props, event, dimensions: { width, height } }: Record<any, any>): HTMLElement | undefined;
@@ -0,0 +1,6 @@
1
+ import { CofidisLoanProps } from './types';
2
+ import { MoneiComponent } from '../../types/component';
3
+ export * from './types';
4
+ export * from './modal';
5
+ export * from './widget';
6
+ export declare const CofidisLoan: MoneiComponent<CofidisLoanProps>;
@@ -0,0 +1,3 @@
1
+ import { CofidisLoanModalProps } from './types';
2
+ import { MoneiComponent } from '../../types/component';
3
+ export declare const CofidisLoanModal: MoneiComponent<CofidisLoanModalProps>;
@@ -0,0 +1,44 @@
1
+ import { CSSObject } from '../../types/css';
2
+ export interface CofidisLoanProps {
3
+ paymentId?: string;
4
+ language?: string;
5
+ hint?: boolean;
6
+ onError?: (error: any) => void;
7
+ onProps?: (cb: (props: CofidisLoanProps) => void) => Promise<void>;
8
+ onLoad?: (isSupported: boolean) => void;
9
+ onOpen?: () => void;
10
+ onSubmit: (data: {
11
+ token?: string;
12
+ error?: string;
13
+ redirectUrl?: string;
14
+ }) => void;
15
+ fullscreen?: boolean;
16
+ style?: {
17
+ height?: number;
18
+ };
19
+ }
20
+ export interface CofidisLoanModalProps extends CofidisLoanProps {
21
+ isOpen?: boolean;
22
+ amount: number;
23
+ currency: string;
24
+ accountId: string;
25
+ onError: (error: any) => void;
26
+ }
27
+ export interface CofidisLoanWidgetProps {
28
+ amount?: number;
29
+ amountInt?: number;
30
+ accountId: string;
31
+ language?: string;
32
+ showLogo?: boolean;
33
+ style?: {
34
+ base?: CSSObject;
35
+ link?: CSSObject;
36
+ amount?: CSSObject;
37
+ label?: CSSObject;
38
+ terms?: CSSObject;
39
+ logo?: CSSObject;
40
+ content?: CSSObject;
41
+ };
42
+ onError?: (error: any) => void;
43
+ onLoad?: () => void;
44
+ }
@@ -0,0 +1,3 @@
1
+ import { CofidisLoanWidgetProps } from './types';
2
+ import { MoneiComponent } from '../../types/component';
3
+ export declare const CofidisLoanWidget: MoneiComponent<CofidisLoanWidgetProps>;