@payfurl/client 3.0.5 → 3.1.1

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.
@@ -3,12 +3,14 @@ import type { CardOptionsType } from "./types/CardOptions.type";
3
3
  import { PayfurlInterface } from "./interfaces/payfurl.interface";
4
4
  import type { DropInOptionsType } from "./types/DropInOptions.type";
5
5
  import { PaypalOptionsType } from "./types/PaypalOptions.type";
6
+ import { PayToOptionsType } from "./types/PayToOptions.type";
6
7
  declare global {
7
8
  interface Window {
8
9
  paypal: any;
9
10
  }
10
11
  }
11
12
  declare class Payfurl implements PayfurlInterface {
13
+ private container;
12
14
  private form;
13
15
  private environment;
14
16
  private debug;
@@ -18,6 +20,7 @@ declare class Payfurl implements PayfurlInterface {
18
20
  private threeDsProcessor;
19
21
  private paypalProcessor;
20
22
  private cardProcessor;
23
+ private payToProcessor;
21
24
  private userOnSuccess;
22
25
  private userOnFailure;
23
26
  init(environment: Environment, publicKey: string, debug: boolean): this;
@@ -31,11 +34,13 @@ declare class Payfurl implements PayfurlInterface {
31
34
  private _addDropIn;
32
35
  addDropIn(dropinParentId: string, amount: number, currency: string, options?: DropInOptionsType): this;
33
36
  addPaypal(parentId: string, amount: number, currency: string, providerId: string, options: PaypalOptionsType): this;
37
+ addPayTo(parentId: string, amount: number, providerId: string, options: PayToOptionsType): this;
34
38
  addThreeDsWithFullParameters(parentId: string, cardNumber: string, cardExpiry: string, cardHolderName: string, email: string, amount: number, currency: string): this;
35
39
  private getPaymentOptions;
36
40
  setAmount(amount: number): this;
37
41
  onSuccess(f: (message: object) => void): void;
38
42
  onFailure(f: (message: object) => void): void;
43
+ private showErrorMessage;
39
44
  }
40
45
  declare const _default: Payfurl;
41
46
  export default _default;
@@ -19,6 +19,7 @@ export declare class CardProcessor implements CardProcessorInterface {
19
19
  private container;
20
20
  private threeDsContainer;
21
21
  private iframe;
22
+ private form;
22
23
  private readonly log;
23
24
  private readonly debug;
24
25
  private readonly environment;
@@ -34,7 +35,7 @@ export declare class CardProcessor implements CardProcessorInterface {
34
35
  private httpInvoker;
35
36
  constructor(log: LoggerType, config: CardProcessorConfigType);
36
37
  addThreeDsProcessor(threeDsProcessor: ThreeDsProcessorInterface): void;
37
- addCard(container: HTMLElement, providerId: string, amount: number, currency: string, options?: CardOptionsType): this;
38
+ addCard(container: HTMLElement, form: HTMLFormElement | null, providerId: string, amount: number, currency: string, options?: CardOptionsType): this;
38
39
  private messageHandler;
39
40
  private onSubmit;
40
41
  tokenise(threeDSServerTransID: string | null): void;
@@ -0,0 +1,36 @@
1
+ import { PaymentOptionsCall } from "../types/PaymentOptionsCall.type";
2
+ import { FailureCallbackFunc, SuccessCallbackFunc } from "../types/Callback.type";
3
+ import { PayToProcessorInterface } from "../interfaces/processors/PayToProcessor.interface";
4
+ import { LoggerType } from "../types/Logger.type";
5
+ import { PayToOptionsType } from "../types/PayToOptions.type";
6
+ declare type PayToProcessorConfigType = {
7
+ debug: boolean;
8
+ publicKey: string;
9
+ apiUrl: string;
10
+ getPaymentOptions: PaymentOptionsCall;
11
+ onSuccess: SuccessCallbackFunc | null;
12
+ onFailure: FailureCallbackFunc | null;
13
+ };
14
+ export declare class PayToProcessor implements PayToProcessorInterface {
15
+ private container;
16
+ private readonly debug;
17
+ private readonly log;
18
+ private readonly apiUrl;
19
+ private readonly getPaymentOptions;
20
+ private options;
21
+ private providerId;
22
+ private tokenId;
23
+ private checkAgreementHandler;
24
+ private readonly failureCallback;
25
+ private readonly successCallback;
26
+ private httpInvoker;
27
+ constructor(log: LoggerType, config: PayToProcessorConfigType);
28
+ addPayTo(container: HTMLElement, amount: number, providerId: string, options: PayToOptionsType): void;
29
+ private tokenise;
30
+ private successPayToHandler;
31
+ private failurePayToHandler;
32
+ private failurePayToAgreementHandler;
33
+ private successPayToAgreementHandler;
34
+ private checkAgreement;
35
+ }
36
+ export {};
@@ -15,12 +15,13 @@ export declare class PaypalProcessor implements PaypalProcessorInterface {
15
15
  private container;
16
16
  private readonly log;
17
17
  private readonly apiUrl;
18
+ private form;
18
19
  private readonly getPaymentOptions;
19
20
  private readonly failureCallback;
20
21
  private readonly successCallback;
21
22
  private httpInvoker;
22
23
  private paypalData;
23
24
  constructor(log: LoggerType, config: PaypalProcessorConfigType);
24
- addPaypal(container: HTMLElement, amount: number, currency: string, providerId: string, options: PaypalOptionsType): void;
25
+ addPaypal(container: HTMLElement, form: HTMLFormElement | null, amount: number, currency: string, providerId: string, options: PaypalOptionsType): void;
25
26
  }
26
27
  export {};
@@ -3,12 +3,8 @@ export declare type DropInOptionsType = {
3
3
  paypalEnablePayIn4: string;
4
4
  cardProviderId: string;
5
5
  paypalProviderId: string;
6
+ payToProviderId: string;
6
7
  threeDSEmail: string;
7
- };
8
- export declare function getEmptyDropInOptions(): {
9
- paypalButtonStyle: string;
10
- paypalEnablePayIn4: string;
11
- cardProviderId: string;
12
- paypalProviderId: string;
13
- threeDSEmail: string;
8
+ payToMaximumAmount: number;
9
+ payToDescription: string;
14
10
  };
@@ -0,0 +1,5 @@
1
+ export declare type PayToFormDataType = {
2
+ payerName: string;
3
+ payIdType: string;
4
+ payId: string;
5
+ };
@@ -0,0 +1,4 @@
1
+ export declare type PayToOptionsType = {
2
+ maximumAmount: number;
3
+ description: string;
4
+ };
@@ -1,2 +1,3 @@
1
- export declare type PaymentOptionsCall = (amount: number, currency: string, overridePaypalProviderId: string, callback: (hasCardProviders: boolean, required3dsProvider: string, providerId: string) => void) => void;
1
+ export declare type PaymentOptionsCallbackType = (hasCardProviders: boolean, required3dsProvider: string, paypalProviderId: string, payToProviderId: string) => void;
2
+ export declare type PaymentOptionsCall = (amount: number, currency: string, overridePaypalProviderId: string, overridePayToProviderId: string, callback: PaymentOptionsCallbackType) => void;
2
3
  export declare type TokeniseCall = (threeDSServerTransID: string | null) => void;
@@ -0,0 +1,5 @@
1
+ export default function (): {
2
+ errorMessage: import("vue").Ref<string>;
3
+ showErrorMessage: (message: string) => void;
4
+ hideErrorMessage: () => void;
5
+ };
@@ -0,0 +1,5 @@
1
+ export default function (): {
2
+ isLoading: import("vue").Ref<boolean>;
3
+ startLoading: () => void;
4
+ stopLoading: () => void;
5
+ };
@@ -1 +1 @@
1
- .message[data-v-78588f23]{color:var(--color-error);font-size:20px;font-weight:700;margin-bottom:20px}svg#paypal[data-v-6c3f4e5e]{--size: 30px;width:var(--size);height:var(--size)}svg[data-v-09c4ea7e]{--size: 30px;width:var(--size);height:var(--size)}.combined-container[data-v-5dce19d0]{width:fit-content;display:flex;flex-direction:column}.combined-tabs[data-v-5dce19d0]{width:100%;display:flex;justify-items:flex-start;align-items:center}.combined-tab[data-v-5dce19d0]{height:42px;padding:0 10px;display:flex;align-items:center;justify-items:center;cursor:pointer;background-color:#fff;color:var(--color-text);border:var(--border)}.combined-tab.active[data-v-5dce19d0]{background-color:#3273dc;color:#fff;border:1px solid #3273dc}.combined-tab>svg[data-v-5dce19d0]{margin-right:10px}.combined-tab[data-v-5dce19d0]:first-child{border-top-left-radius:4px;border-bottom-left-radius:4px}.combined-tab[data-v-5dce19d0]:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px}.combined-components[data-v-5dce19d0]{margin-top:20px}.message[data-v-0c5d4794]{color:var(--color-success);font-size:20px;font-weight:700;margin-bottom:20px}svg[data-v-ad18c358]{fill:#000;stroke:transparent;width:20px;height:20px}iframe[data-v-7bf4e048]{width:250px;height:400px;border:none;overflow:hidden}.mask[data-v-7bf4e048]{align-items:normal;display:flex;justify-content:center;position:fixed;z-index:9999;top:0;left:0;width:100%;height:100%;background-color:#000c;transition:opacity .3s ease}.wrapper[data-v-7bf4e048]{max-height:calc(100vh - 20px);margin:50px auto auto}.container[data-v-7bf4e048]{position:relative;width:300px;background:white;display:flex;justify-content:center;align-items:center}svg[data-v-7bf4e048]{cursor:pointer;position:absolute;right:5px;top:5px}svg#spinner[data-v-4280055c]{--size: 50px;position:absolute;left:calc(50% - var(--size)/2);top:calc(50% - var(--size)/2);width:var(--size);height:var(--size);z-index:9999}body,body.common{--background-color: white;--color-text: #4a4a4a;--color-input-text: #4a4a4a;--border: 1px solid #dbdbdb;--border-hover: 1px solid #363636;--color-error: red;--color-success: #48b608}body.dark{--background-color: black;--color-text: white;--color-input-text: #4a4a4a;--border: 1px solid #b4e1ee;--border-hover: 1px solid #363636;--color-error: red;--color-success: #48b608}.loading[data-v-ed95d8b0]{position:relative;height:40px;width:200px;color:var(--color-text);font-size:20px;display:flex;align-items:center;justify-items:center;margin:0 auto}iframe[data-v-4a2f1e14]{border:none;overflow:hidden;width:100%;height:240px}button[data-v-4a2f1e14]{appearance:none;background-color:#1a82b7;border:1px solid rgba(27,31,35,.15);border-radius:6px;box-shadow:#1b1f231a 0 1px;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-size:14px;font-weight:600;line-height:20px;padding:6px 16px;position:relative;text-align:center;text-decoration:none;user-select:none;-webkit-user-select:none;touch-action:manipulation;vertical-align:middle;white-space:nowrap}
1
+ .message[data-v-e78635f4]{color:var(--color-error);background:transparent;font-size:20px;font-weight:700;margin-bottom:20px}svg#paypal[data-v-6c3f4e5e]{--size: 30px;width:var(--size);height:var(--size)}svg[data-v-09c4ea7e]{--size: 30px;width:var(--size);height:var(--size)}svg#payto-icon[data-v-45e10a6c]{--size: 30px;width:var(--size);height:var(--size)}.combined-container[data-v-022194b8]{width:fit-content;display:flex;flex-direction:column}.combined-tabs[data-v-022194b8]{width:100%;display:flex;justify-items:flex-start;align-items:center}.combined-tab[data-v-022194b8]{height:42px;padding:0 10px;display:flex;align-items:center;justify-items:center;cursor:pointer;background-color:#fff;color:var(--color-text);border:var(--border);border-left:1px solid transparent}.combined-tab.active[data-v-022194b8]{background-color:#3273dc;color:#fff;border:1px solid #3273dc}.combined-tab>svg[data-v-022194b8]{margin-right:10px}.combined-tab[data-v-022194b8]:first-child{border-left:var(--border);border-top-left-radius:4px;border-bottom-left-radius:4px}.combined-tab[data-v-022194b8]:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px}.combined-components[data-v-022194b8]{margin-top:20px}.message[data-v-1f496df5]{color:var(--color-success);background:transparent;font-size:20px;font-weight:700;margin-bottom:20px}svg[data-v-ad18c358]{fill:#000;stroke:transparent;width:20px;height:20px}iframe[data-v-7bf4e048]{width:250px;height:400px;border:none;overflow:hidden}.mask[data-v-7bf4e048]{align-items:normal;display:flex;justify-content:center;position:fixed;z-index:9999;top:0;left:0;width:100%;height:100%;background-color:#000c;transition:opacity .3s ease}.wrapper[data-v-7bf4e048]{max-height:calc(100vh - 20px);margin:50px auto auto}.container[data-v-7bf4e048]{position:relative;width:300px;background:white;display:flex;justify-content:center;align-items:center}svg[data-v-7bf4e048]{cursor:pointer;position:absolute;right:5px;top:5px}svg#spinner[data-v-4280055c]{--size: 50px;position:absolute;left:calc(50% - var(--size)/2);top:calc(50% - var(--size)/2);width:var(--size);height:var(--size);z-index:9999}.loading[data-v-ed95d8b0]{position:relative;height:40px;width:200px;color:var(--color-text);font-size:20px;display:flex;align-items:center;justify-items:center;margin:0 auto}iframe[data-v-2a78dd48]{border:none;overflow:hidden;width:100%;height:240px}button[data-v-2a78dd48]{appearance:none;background-color:#1a82b7;border:1px solid rgba(27,31,35,.15);border-radius:6px;box-shadow:#1b1f231a 0 1px;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-size:14px;font-weight:600;line-height:20px;padding:6px 16px;position:relative;text-align:center;text-decoration:none;user-select:none;-webkit-user-select:none;touch-action:manipulation;vertical-align:middle;white-space:nowrap}div#payfurl-payto-form[data-v-59338927]{padding-bottom:20px}.small[data-v-59338927]{font-size:.8em}.payfurl-form{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:var(--color-text);font-size:1em;font-weight:400;line-height:1.5;background-color:var(--background-color);box-sizing:border-box}.payfurl-form *,.payfurl-form *:before,.payfurl-form *:after{box-sizing:inherit}.payfurl-form *:focus{outline:none}.payfurl-form label{font-size:.8em;font-weight:700}.payfurl-form input{-webkit-appearance:none}.payfurl-form input,.payfurl-form select{max-width:100%;width:100%;border:var(--border);border-radius:4px;box-shadow:inset 0 .0625em .125em #0a0a0a0d;background-color:#fff;color:var(--color-input-text);align-items:center;font-size:1rem;height:2.5em;line-height:1.5;padding:calc(.5em - 1px) calc(.75em - 1px);position:relative;margin:0}.payfurl-form input:hover,.payfurl-form select:hover{border-color:var(--border-hover)}.payfurl-form ::placeholder{color:#3b3b3b4d}.payfurl-form ::-webkit-input-placeholder{color:#3b3b3b4d}.payfurl-form ::-moz-placeholder{color:#3b3b3b4d}.payfurl-form :-ms-input-placeholder{color:#3b3b3b4d}.payfurl-form :-moz-placeholder{color:#3b3b3b4d}.payfurl-form .error{font-size:.75em;color:var(--color-error)}.payfurl-form .success{font-size:.75em;color:var(--color-success)}.payfurl-form .group{display:flex;justify-content:flex-start}.payfurl-form .group>div:first-child{margin-right:10px}.payfurl-form .container-form{position:relative;width:200px;margin-left:10px;margin-right:10px}.payfurl-form .container-form .text-big{font-size:1.25em}.payfurl-form .container-form .text-normal{font-size:1em}body,body.common{--background-color: white;--color-text: #4a4a4a;--color-input-text: #4a4a4a;--border: 1px solid #dbdbdb;--border-hover: 1px solid #363636;--color-error: red;--color-success: #48b608}body.dark{--background-color: black;--color-text: white;--color-input-text: #4a4a4a;--border: 1px solid #b4e1ee;--border-hover: 1px solid #363636;--color-error: red;--color-success: #48b608}div#payfurl-payto-agreement[data-v-ca368eb8]{padding-bottom:20px}.message[data-v-ca368eb8]{color:var(--color-text);background:transparent;font-size:20px;font-weight:700;margin-bottom:20px}
@@ -0,0 +1 @@
1
+ export declare function capitalizeFirstLetter(str: string): string;
@@ -2,9 +2,12 @@ import { FailureCallbackFunc } from "../sdk/types/Callback.type";
2
2
  export declare function checkCard(card: string): boolean;
3
3
  export declare function luhnCheck(card: string): boolean;
4
4
  export declare function checkExpiry(expiry: string): boolean;
5
+ export declare function get10DigitsPhone(phone: string): string;
6
+ export declare function checkPhone(phone: string): boolean;
5
7
  export declare function checkEmail(email: string): boolean;
6
8
  export declare function checkCcv(ccv: string): boolean;
7
9
  export declare function checkEmpty(value: any): boolean;
8
10
  export declare function checkAmount(amount: any): boolean;
9
11
  export declare type ValidatorFunc = (value: any) => boolean;
10
12
  export declare function validateInput(value: any, validator: ValidatorFunc, errorText: string, failureCallback: FailureCallbackFunc | null): void;
13
+ export declare function checkABN(abn: string): boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@payfurl/client",
3
3
  "private": false,
4
- "version": "3.0.5",
4
+ "version": "3.1.1",
5
5
  "files": [
6
6
  "dist/sdk"
7
7
  ],