@payrails/web-sdk 5.19.0 → 5.21.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/index.js +4 -4
- package/package.json +2 -2
- package/payrails.d.ts +186 -203
- package/payrails.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payrails/web-sdk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.21.0",
|
|
4
4
|
"description": "SDK providing tokenization options on the client for merchants",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "payrails.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"author": "Payrails GitHub Bot <github@payrails.com>",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@payrails/fraud-sdk": "1.
|
|
11
|
+
"@payrails/fraud-sdk": "1.4.1",
|
|
12
12
|
"@payrails/web-cse": "1.2.3",
|
|
13
13
|
"@types/applepayjs": "14.0.4",
|
|
14
14
|
"@types/googlepay": "0.7.5"
|
package/payrails.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as _payrails_iframe_event_bus from '@payrails/iframe-event-bus';
|
|
1
2
|
import { LogLevel as LogLevel$1 } from '@payrails/logger';
|
|
2
3
|
import { FraudProvider } from '@payrails/fraud-sdk';
|
|
3
4
|
|
|
@@ -516,6 +517,7 @@ declare class PayrailsElement implements Mountable {
|
|
|
516
517
|
protected element: HTMLElement;
|
|
517
518
|
protected subElements: Array<Mountable>;
|
|
518
519
|
readonly id: string | undefined;
|
|
520
|
+
protected eventBus: _payrails_iframe_event_bus.IframeEventBus;
|
|
519
521
|
constructor(elementType: string, { id, className }?: ElementOptions);
|
|
520
522
|
get parentElement(): HTMLElement | null;
|
|
521
523
|
get selector(): string;
|
|
@@ -524,6 +526,92 @@ declare class PayrailsElement implements Mountable {
|
|
|
524
526
|
unmount(): void;
|
|
525
527
|
}
|
|
526
528
|
|
|
529
|
+
declare enum ElementType {
|
|
530
|
+
CARD_NUMBER = "CARD_NUMBER",
|
|
531
|
+
CARDHOLDER_NAME = "CARDHOLDER_NAME",
|
|
532
|
+
CVV = "CVV",
|
|
533
|
+
EXPIRATION_MONTH = "EXPIRATION_MONTH",
|
|
534
|
+
EXPIRATION_YEAR = "EXPIRATION_YEAR",
|
|
535
|
+
EXPIRATION_DATE = "EXPIRATION_DATE"
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
interface EncryptedCollectResult {
|
|
539
|
+
vaultProviderConfigId: string;
|
|
540
|
+
encryptedData: string;
|
|
541
|
+
}
|
|
542
|
+
interface CollectElementOptions {
|
|
543
|
+
type: ElementType;
|
|
544
|
+
label?: string;
|
|
545
|
+
placeholder?: string;
|
|
546
|
+
altText?: string;
|
|
547
|
+
format?: string;
|
|
548
|
+
inputStyles?: object;
|
|
549
|
+
labelStyles?: object;
|
|
550
|
+
errorTextStyles?: object;
|
|
551
|
+
required?: boolean;
|
|
552
|
+
enableCardIcon?: boolean;
|
|
553
|
+
}
|
|
554
|
+
type PayrailsContainerType = 'COLLECT' | 'COMPOSABLE';
|
|
555
|
+
interface CollectContainerOptions {
|
|
556
|
+
layout?: number[];
|
|
557
|
+
cardTableName?: string;
|
|
558
|
+
containerType?: PayrailsContainerType;
|
|
559
|
+
styles?: {
|
|
560
|
+
base?: Partial<CSSStyleDeclaration>;
|
|
561
|
+
};
|
|
562
|
+
errorTextStyles?: {
|
|
563
|
+
base?: Partial<CSSStyleDeclaration>;
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
type PayrailsSecureFieldEvent = 'CHANGE' | 'FOCUS' | 'BLUR' | 'READY' | 'SUBMIT';
|
|
567
|
+
interface PayrailsSecureField {
|
|
568
|
+
on(eventName: PayrailsSecureFieldEvent, handler: any): void;
|
|
569
|
+
mount?: (domElement: any) => void;
|
|
570
|
+
unmount?: () => void;
|
|
571
|
+
getState?: () => {
|
|
572
|
+
isEmpty: boolean;
|
|
573
|
+
isComplete: boolean;
|
|
574
|
+
isValid: boolean;
|
|
575
|
+
isFocused: boolean;
|
|
576
|
+
value: unknown;
|
|
577
|
+
required: boolean;
|
|
578
|
+
};
|
|
579
|
+
isValidElement?: () => boolean;
|
|
580
|
+
setError?: (clientErrorText: string) => void;
|
|
581
|
+
resetError?: () => void;
|
|
582
|
+
setValue?: (elementValue: string) => void;
|
|
583
|
+
clearValue?: () => void;
|
|
584
|
+
}
|
|
585
|
+
declare class PayrailsCollectContainer implements Mountable {
|
|
586
|
+
bin: string;
|
|
587
|
+
isBinLookupEnabled: boolean;
|
|
588
|
+
readonly id = "payrails-container-wrapper";
|
|
589
|
+
private static instance;
|
|
590
|
+
private readonly __container;
|
|
591
|
+
private element;
|
|
592
|
+
private readonly cardTableName;
|
|
593
|
+
private readonly containerType;
|
|
594
|
+
constructor(__client: Skyflow, options: CollectContainerOptions);
|
|
595
|
+
static init(vaultClient: Skyflow, options: CollectContainerOptions): PayrailsCollectContainer;
|
|
596
|
+
createCollectElement(options: CollectElementOptions): PayrailsSecureField;
|
|
597
|
+
mount(selector: string): void;
|
|
598
|
+
unmount(): void;
|
|
599
|
+
collect(): Promise<EncryptedCollectResult>;
|
|
600
|
+
private collectPayrailsData;
|
|
601
|
+
tokenize(opts: TokenizeOptions): Promise<SaveInstrumentResponse>;
|
|
602
|
+
private constructSaveInstrumentBody;
|
|
603
|
+
private attachCustomEventHandler;
|
|
604
|
+
private formatBin;
|
|
605
|
+
private get elementToFieldMap();
|
|
606
|
+
fetchBinLookup: (bin: string) => Promise<string | BinLookupResponse | {
|
|
607
|
+
bin: string;
|
|
608
|
+
}>;
|
|
609
|
+
}
|
|
610
|
+
interface TokenizeOptions {
|
|
611
|
+
futureUsage?: 'CardOnFile' | 'Subscription' | 'UnscheduledCardOnFile';
|
|
612
|
+
storeInstrument?: boolean;
|
|
613
|
+
}
|
|
614
|
+
|
|
527
615
|
interface IAddress {
|
|
528
616
|
country?: {
|
|
529
617
|
code?: string;
|
|
@@ -565,65 +653,6 @@ interface AddressSelectorElementOptions extends ElementOptions {
|
|
|
565
653
|
};
|
|
566
654
|
}
|
|
567
655
|
|
|
568
|
-
interface StoreInstrumentElementOptions extends ElementOptions {
|
|
569
|
-
showStoreInstrumentCheckbox?: boolean;
|
|
570
|
-
alwaysStoreInstrument?: boolean;
|
|
571
|
-
translations?: {
|
|
572
|
-
labels?: {
|
|
573
|
-
storeInstrument?: string;
|
|
574
|
-
saveInstrument?: string;
|
|
575
|
-
};
|
|
576
|
-
};
|
|
577
|
-
styles?: {
|
|
578
|
-
storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
|
|
579
|
-
};
|
|
580
|
-
events?: PayrailsSDKEvents;
|
|
581
|
-
}
|
|
582
|
-
declare class StoreInstrumentCheckbox extends PayrailsElement {
|
|
583
|
-
private options;
|
|
584
|
-
constructor(options: StoreInstrumentElementOptions);
|
|
585
|
-
get isChecked(): boolean;
|
|
586
|
-
private createHTML;
|
|
587
|
-
private applyStyles;
|
|
588
|
-
private addListeners;
|
|
589
|
-
}
|
|
590
|
-
declare abstract class PayrailsElementWithStoreInstrumentCheckbox extends PayrailsElement {
|
|
591
|
-
protected options?: StoreInstrumentElementOptions | undefined;
|
|
592
|
-
protected storeInstrumentCheckbox: StoreInstrumentCheckbox | null;
|
|
593
|
-
protected constructor(elementType: string, options?: StoreInstrumentElementOptions | undefined);
|
|
594
|
-
protected get shouldStoreInstrument(): boolean;
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
interface ApplePayButtonOptions extends StoreInstrumentElementOptions {
|
|
598
|
-
clientDomain?: string;
|
|
599
|
-
showPaymentMethodLogo?: boolean;
|
|
600
|
-
events?: PaymentEvents & {
|
|
601
|
-
onApplePayAvailable?: () => void;
|
|
602
|
-
};
|
|
603
|
-
styles?: {
|
|
604
|
-
type?: 'plain' | 'buy' | 'addMoney' | 'book' | 'checkout' | 'continue' | 'contribute' | 'donate' | 'inStore' | 'order' | 'reload' | 'rent' | 'setUp' | 'subscribe' | 'support' | 'tip' | 'topUp';
|
|
605
|
-
style?: 'white' | 'whiteOutline' | 'black' | 'automatic';
|
|
606
|
-
} & StoreInstrumentElementOptions['styles'];
|
|
607
|
-
}
|
|
608
|
-
declare global {
|
|
609
|
-
interface Window {
|
|
610
|
-
ApplePaySession?: ApplePaySession;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
declare class ApplePayButton extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
614
|
-
private sdkConfig;
|
|
615
|
-
protected options: ApplePayButtonOptions;
|
|
616
|
-
private appleButton;
|
|
617
|
-
private paymentExecutor;
|
|
618
|
-
static isApplePayAvailable(): Promise<boolean>;
|
|
619
|
-
constructor(sdkConfig: SdkConfiguration, options: ApplePayButtonOptions);
|
|
620
|
-
mount(location: string): void;
|
|
621
|
-
unmount(): void;
|
|
622
|
-
private mountApplePayButton;
|
|
623
|
-
private createApplePaySession;
|
|
624
|
-
private onApplePayAuthorized;
|
|
625
|
-
}
|
|
626
|
-
|
|
627
656
|
declare const regexes: {
|
|
628
657
|
visa: RegExp;
|
|
629
658
|
mastercard: RegExp;
|
|
@@ -637,15 +666,6 @@ declare const regexes: {
|
|
|
637
666
|
};
|
|
638
667
|
type CardNetwork = keyof typeof regexes;
|
|
639
668
|
|
|
640
|
-
declare enum ElementType {
|
|
641
|
-
CARD_NUMBER = "CARD_NUMBER",
|
|
642
|
-
CARDHOLDER_NAME = "CARDHOLDER_NAME",
|
|
643
|
-
CVV = "CVV",
|
|
644
|
-
EXPIRATION_MONTH = "EXPIRATION_MONTH",
|
|
645
|
-
EXPIRATION_YEAR = "EXPIRATION_YEAR",
|
|
646
|
-
EXPIRATION_DATE = "EXPIRATION_DATE"
|
|
647
|
-
}
|
|
648
|
-
|
|
649
669
|
interface PaymentInstallmentsElementOptions extends ElementOptions {
|
|
650
670
|
showPaymentInstallmentsDropdown?: boolean;
|
|
651
671
|
installmentOptions?: BaseInstallmentOption[] | null;
|
|
@@ -683,6 +703,35 @@ declare class PayrailsElementWithPaymentInstallmentsDropdown extends PayrailsEle
|
|
|
683
703
|
setDisabled(state: boolean): void;
|
|
684
704
|
}
|
|
685
705
|
|
|
706
|
+
interface StoreInstrumentElementOptions extends ElementOptions {
|
|
707
|
+
showStoreInstrumentCheckbox?: boolean;
|
|
708
|
+
alwaysStoreInstrument?: boolean;
|
|
709
|
+
translations?: {
|
|
710
|
+
labels?: {
|
|
711
|
+
storeInstrument?: string;
|
|
712
|
+
saveInstrument?: string;
|
|
713
|
+
};
|
|
714
|
+
};
|
|
715
|
+
styles?: {
|
|
716
|
+
storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
|
|
717
|
+
};
|
|
718
|
+
events?: PayrailsSDKEvents;
|
|
719
|
+
}
|
|
720
|
+
declare class StoreInstrumentCheckbox extends PayrailsElement {
|
|
721
|
+
private options;
|
|
722
|
+
constructor(options: StoreInstrumentElementOptions);
|
|
723
|
+
get isChecked(): boolean;
|
|
724
|
+
private createHTML;
|
|
725
|
+
private applyStyles;
|
|
726
|
+
private addListeners;
|
|
727
|
+
}
|
|
728
|
+
declare abstract class PayrailsElementWithStoreInstrumentCheckbox extends PayrailsElement {
|
|
729
|
+
protected options?: StoreInstrumentElementOptions | undefined;
|
|
730
|
+
protected storeInstrumentCheckbox: StoreInstrumentCheckbox | null;
|
|
731
|
+
protected constructor(elementType: string, options?: StoreInstrumentElementOptions | undefined);
|
|
732
|
+
protected get shouldStoreInstrument(): boolean;
|
|
733
|
+
}
|
|
734
|
+
|
|
686
735
|
interface OnChange {
|
|
687
736
|
isValid: boolean;
|
|
688
737
|
cardNetwork: CardNetwork | '';
|
|
@@ -752,8 +801,8 @@ declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
|
752
801
|
get cardNetwork(): "" | "visa" | "mastercard" | "amex" | "diners" | "discover" | "jcb" | "hipercard" | "unionpay" | "maestro";
|
|
753
802
|
onChange(): void;
|
|
754
803
|
private updateInstallments;
|
|
755
|
-
collectValues
|
|
756
|
-
cardData:
|
|
804
|
+
collectValues(): Promise<{
|
|
805
|
+
cardData: EncryptedCollectResult;
|
|
757
806
|
storeInstrument: boolean;
|
|
758
807
|
selectedInstallment: number | undefined;
|
|
759
808
|
enrollInstrumentToNetworkOffers: boolean;
|
|
@@ -789,6 +838,15 @@ declare class CardList extends PayrailsElement {
|
|
|
789
838
|
reset(): void;
|
|
790
839
|
}
|
|
791
840
|
|
|
841
|
+
interface InitOptions {
|
|
842
|
+
version: string;
|
|
843
|
+
data: string;
|
|
844
|
+
}
|
|
845
|
+
interface PayrailsAmount {
|
|
846
|
+
value: string;
|
|
847
|
+
currency: string;
|
|
848
|
+
}
|
|
849
|
+
|
|
792
850
|
interface ReturnInfo {
|
|
793
851
|
success?: string;
|
|
794
852
|
cancel?: string;
|
|
@@ -821,7 +879,6 @@ interface CardPaymentButtonOptions {
|
|
|
821
879
|
};
|
|
822
880
|
}
|
|
823
881
|
declare class CardPaymentButton extends PayrailsElement {
|
|
824
|
-
private readonly sdkConfig;
|
|
825
882
|
private readonly options;
|
|
826
883
|
private readonly returnInfo?;
|
|
827
884
|
selectedInstrument: StoredPaymentInstrument | null;
|
|
@@ -829,7 +886,7 @@ declare class CardPaymentButton extends PayrailsElement {
|
|
|
829
886
|
get bin(): string | undefined;
|
|
830
887
|
private readonly paymentExecutor;
|
|
831
888
|
private cardForm;
|
|
832
|
-
constructor(
|
|
889
|
+
constructor(options: CardPaymentButtonOptions, returnInfo?: ReturnInfo | undefined);
|
|
833
890
|
setDisabled(isDisabled: boolean): void;
|
|
834
891
|
setSavedCreditCard(savedCard: StoredPaymentInstrument<CardMetadata>): void;
|
|
835
892
|
setSavedInstrument(savedInstrument: StoredPaymentInstrument): void;
|
|
@@ -841,7 +898,6 @@ declare class CardPaymentButton extends PayrailsElement {
|
|
|
841
898
|
triggerLoading(isLoading: boolean): void;
|
|
842
899
|
private onAuthorizationFailed;
|
|
843
900
|
private onPay;
|
|
844
|
-
private constructTokenizedPayment;
|
|
845
901
|
private constructEncryptedPayment;
|
|
846
902
|
private handleAuthorizationResult;
|
|
847
903
|
}
|
|
@@ -876,16 +932,16 @@ interface GooglePayButtonOptions extends StoreInstrumentElementOptions {
|
|
|
876
932
|
buttonSizeMode?: google.payments.api.ButtonSizeMode;
|
|
877
933
|
buttonLocale?: string;
|
|
878
934
|
} & StoreInstrumentElementOptions['styles'];
|
|
935
|
+
returnInfo?: ReturnInfo;
|
|
879
936
|
}
|
|
880
937
|
declare class GooglePayButton extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
881
|
-
private sdkConfig;
|
|
882
938
|
protected options: GooglePayButtonOptions;
|
|
883
939
|
private googleButton;
|
|
884
940
|
private readonly paymentExecutor;
|
|
885
941
|
private static googleSDKClient;
|
|
886
942
|
private static getSDKClient;
|
|
887
943
|
static isGooglePayAvailable(allowedPaymentMethods: google.payments.api.IsReadyToPayPaymentMethodSpecification[], environment?: PayrailsEnvironment, merchantInfo?: google.payments.api.MerchantInfo): Promise<boolean>;
|
|
888
|
-
constructor(
|
|
944
|
+
constructor(options: GooglePayButtonOptions);
|
|
889
945
|
private sdkLoaded;
|
|
890
946
|
private onLoadPaymentData;
|
|
891
947
|
private authorize;
|
|
@@ -904,6 +960,28 @@ interface DropinElementStyles {
|
|
|
904
960
|
active?: Partial<CSSStyleDeclaration>;
|
|
905
961
|
}
|
|
906
962
|
|
|
963
|
+
interface ApplePayDropinOptions extends ApplePayButtonOptions {
|
|
964
|
+
translations?: {
|
|
965
|
+
labels?: {
|
|
966
|
+
label?: string;
|
|
967
|
+
storeInstrument?: string;
|
|
968
|
+
};
|
|
969
|
+
};
|
|
970
|
+
events?: ApplePayButtonOptions['events'] & DropinElementEvents;
|
|
971
|
+
styles?: DropinElementStyles & ApplePayButtonOptions['styles'];
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
interface CrediCardDropinOptions {
|
|
975
|
+
showPaymentMethodLogo?: boolean;
|
|
976
|
+
styles?: DropinElementStyles;
|
|
977
|
+
events?: DropinElementEvents;
|
|
978
|
+
translations?: {
|
|
979
|
+
labels?: {
|
|
980
|
+
label?: string;
|
|
981
|
+
};
|
|
982
|
+
} & CardFormOptions['translations'];
|
|
983
|
+
}
|
|
984
|
+
|
|
907
985
|
interface ButtonOptions {
|
|
908
986
|
id: string;
|
|
909
987
|
events?: PayrailsSDKEvents & {
|
|
@@ -928,10 +1006,9 @@ interface GenericRedirectButtonOptions {
|
|
|
928
1006
|
paymentMethod: BasePaymentMethodConfig;
|
|
929
1007
|
}
|
|
930
1008
|
declare class GenericRedirectButton extends PayrailsElement {
|
|
931
|
-
private sdkConfig;
|
|
932
1009
|
protected options: GenericRedirectButtonOptions;
|
|
933
1010
|
private readonly returnInfo?;
|
|
934
|
-
constructor(
|
|
1011
|
+
constructor(options: GenericRedirectButtonOptions, returnInfo?: ReturnInfo | undefined);
|
|
935
1012
|
private popup;
|
|
936
1013
|
private buildRedirectButton;
|
|
937
1014
|
private readonly paymentExecutor;
|
|
@@ -982,9 +1059,8 @@ interface PaypalButtonOptions extends StoreInstrumentElementOptions {
|
|
|
982
1059
|
} & StoreInstrumentElementOptions['styles'];
|
|
983
1060
|
}
|
|
984
1061
|
declare class PaypalButton extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
985
|
-
private sdkConfig;
|
|
986
1062
|
protected options?: PaypalButtonOptions | undefined;
|
|
987
|
-
constructor(
|
|
1063
|
+
constructor(options?: PaypalButtonOptions | undefined);
|
|
988
1064
|
fraudNetGuid: string | undefined;
|
|
989
1065
|
private paymentExecutor;
|
|
990
1066
|
private button;
|
|
@@ -996,6 +1072,7 @@ declare class PaypalButton extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
|
996
1072
|
private createPaypalButton;
|
|
997
1073
|
private createPayPalButtonConfig;
|
|
998
1074
|
private createBillingAgreementConfig;
|
|
1075
|
+
private onCancel;
|
|
999
1076
|
private createOneTimeOrderConfig;
|
|
1000
1077
|
private createBaseConfig;
|
|
1001
1078
|
private createOneTimeOrder;
|
|
@@ -1020,14 +1097,13 @@ declare class Dropin extends PayrailsElement {
|
|
|
1020
1097
|
private collectContainer;
|
|
1021
1098
|
private readonly clientConfig;
|
|
1022
1099
|
private readonly dropinConfig;
|
|
1023
|
-
private readonly sdkConfig;
|
|
1024
1100
|
private cardPaymentButton;
|
|
1025
1101
|
private creditCard;
|
|
1026
1102
|
private googlePay;
|
|
1027
1103
|
private applePay;
|
|
1028
1104
|
private cardForm;
|
|
1029
1105
|
private paypal;
|
|
1030
|
-
constructor(collectContainer: PayrailsCollectContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions
|
|
1106
|
+
constructor(collectContainer: PayrailsCollectContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions);
|
|
1031
1107
|
private isHppIntegration;
|
|
1032
1108
|
private createStoredInstrumentElement;
|
|
1033
1109
|
private createInstallmentsDropdown;
|
|
@@ -1078,7 +1154,7 @@ interface DropinOptions {
|
|
|
1078
1154
|
[key: string]: any;
|
|
1079
1155
|
googlePayButton?: GooglePayDropinOptions['translations'];
|
|
1080
1156
|
cardPaymentButton?: CardPaymentButtonOptions['translations'];
|
|
1081
|
-
cardForm?:
|
|
1157
|
+
cardForm?: CrediCardDropinOptions['translations'];
|
|
1082
1158
|
paymentResult?: {
|
|
1083
1159
|
success?: string;
|
|
1084
1160
|
fail?: string;
|
|
@@ -1087,6 +1163,7 @@ interface DropinOptions {
|
|
|
1087
1163
|
paypalButton?: PaypalDropinOptions['translations'];
|
|
1088
1164
|
mercadoPago?: GenericRedirectDropinOptions['translations'];
|
|
1089
1165
|
addressSelector?: AddressSelectorElementOptions['translations'];
|
|
1166
|
+
applePayButton?: ApplePayDropinOptions['translations'];
|
|
1090
1167
|
};
|
|
1091
1168
|
styles?: {
|
|
1092
1169
|
[key: string]: any;
|
|
@@ -1149,9 +1226,7 @@ declare class FraudNet implements Mountable {
|
|
|
1149
1226
|
|
|
1150
1227
|
interface PayrailsClientOptions {
|
|
1151
1228
|
environment?: PayrailsEnvironment;
|
|
1152
|
-
events?:
|
|
1153
|
-
onClientInitialized: (execution?: typeof WorkflowExecution) => void;
|
|
1154
|
-
};
|
|
1229
|
+
events?: ClientEvents;
|
|
1155
1230
|
redirectFor3DS?: boolean;
|
|
1156
1231
|
returnInfo?: ReturnInfo;
|
|
1157
1232
|
telemetry?: {
|
|
@@ -1160,7 +1235,6 @@ interface PayrailsClientOptions {
|
|
|
1160
1235
|
};
|
|
1161
1236
|
}
|
|
1162
1237
|
declare class Payrails {
|
|
1163
|
-
private sdkConfiguration;
|
|
1164
1238
|
private vaultClient;
|
|
1165
1239
|
private options?;
|
|
1166
1240
|
private __container;
|
|
@@ -1197,9 +1271,9 @@ declare class Payrails {
|
|
|
1197
1271
|
private getContainerLayout;
|
|
1198
1272
|
binLookup(): Promise<any>;
|
|
1199
1273
|
}
|
|
1200
|
-
interface
|
|
1201
|
-
|
|
1202
|
-
|
|
1274
|
+
interface ClientEvents {
|
|
1275
|
+
onClientInitialized?: (execution?: typeof WorkflowExecution) => void;
|
|
1276
|
+
onSessionExpired?: () => Promise<InitOptions>;
|
|
1203
1277
|
}
|
|
1204
1278
|
interface PaymentEvents {
|
|
1205
1279
|
onAuthorizeSuccess?: (e?: any) => void;
|
|
@@ -1228,129 +1302,38 @@ interface DropinEvents {
|
|
|
1228
1302
|
onPaymentOptionSelected?: (e: onPaymentMethodSelectedParams) => void;
|
|
1229
1303
|
}
|
|
1230
1304
|
type PayrailsSDKEvents = PaymentEvents & UIEvents & DropinEvents;
|
|
1231
|
-
interface SdkConfiguration {
|
|
1232
|
-
token: string;
|
|
1233
|
-
amount: PayrailsAmount;
|
|
1234
|
-
holderReference: string;
|
|
1235
|
-
usePayrailsFrames: boolean;
|
|
1236
|
-
links?: {
|
|
1237
|
-
binLookup?: {
|
|
1238
|
-
method: 'GET' | 'POST';
|
|
1239
|
-
href: string;
|
|
1240
|
-
};
|
|
1241
|
-
};
|
|
1242
|
-
vaultConfiguration: {
|
|
1243
|
-
cardTableName: string;
|
|
1244
|
-
token: string;
|
|
1245
|
-
vaultId: string;
|
|
1246
|
-
vaultUrl: string;
|
|
1247
|
-
providerId: string;
|
|
1248
|
-
providerConfigId: string;
|
|
1249
|
-
vaultType: 'Skyflow' | 'Payrails' | 'Test';
|
|
1250
|
-
encryptionPublicKey?: string;
|
|
1251
|
-
links: {
|
|
1252
|
-
saveInstrument: {
|
|
1253
|
-
href: string;
|
|
1254
|
-
};
|
|
1255
|
-
};
|
|
1256
|
-
};
|
|
1257
|
-
execution?: WorkflowExecutionResponse;
|
|
1258
|
-
}
|
|
1259
|
-
interface PayrailsAmount {
|
|
1260
|
-
value: string;
|
|
1261
|
-
currency: string;
|
|
1262
|
-
}
|
|
1263
1305
|
declare enum PayrailsEnvironment {
|
|
1264
1306
|
TEST = "TEST",
|
|
1265
1307
|
PRODUCTION = "PRODUCTION"
|
|
1266
1308
|
}
|
|
1267
1309
|
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
expiry_year?: string;
|
|
1274
|
-
security_code: string;
|
|
1275
|
-
instrumentId?: string;
|
|
1276
|
-
};
|
|
1277
|
-
interface EncryptedCollectResult {
|
|
1278
|
-
vaultProviderConfigId: string;
|
|
1279
|
-
encryptedData: string;
|
|
1280
|
-
}
|
|
1281
|
-
interface CollectElementOptions {
|
|
1282
|
-
type: ElementType;
|
|
1283
|
-
label?: string;
|
|
1284
|
-
placeholder?: string;
|
|
1285
|
-
altText?: string;
|
|
1286
|
-
format?: string;
|
|
1287
|
-
inputStyles?: object;
|
|
1288
|
-
labelStyles?: object;
|
|
1289
|
-
errorTextStyles?: object;
|
|
1290
|
-
required?: boolean;
|
|
1291
|
-
enableCardIcon?: boolean;
|
|
1292
|
-
}
|
|
1293
|
-
type PayrailsContainerType = 'COLLECT' | 'COMPOSABLE';
|
|
1294
|
-
interface CollectContainerOptions {
|
|
1295
|
-
layout?: number[];
|
|
1296
|
-
cardTableName?: string;
|
|
1297
|
-
containerType?: PayrailsContainerType;
|
|
1298
|
-
styles?: {
|
|
1299
|
-
base?: Partial<CSSStyleDeclaration>;
|
|
1300
|
-
};
|
|
1301
|
-
errorTextStyles?: {
|
|
1302
|
-
base?: Partial<CSSStyleDeclaration>;
|
|
1310
|
+
interface ApplePayButtonOptions extends StoreInstrumentElementOptions {
|
|
1311
|
+
clientDomain?: string;
|
|
1312
|
+
showPaymentMethodLogo?: boolean;
|
|
1313
|
+
events?: PaymentEvents & {
|
|
1314
|
+
onApplePayAvailable?: () => void;
|
|
1303
1315
|
};
|
|
1316
|
+
styles?: {
|
|
1317
|
+
type?: 'plain' | 'buy' | 'addMoney' | 'book' | 'checkout' | 'continue' | 'contribute' | 'donate' | 'inStore' | 'order' | 'reload' | 'rent' | 'setUp' | 'subscribe' | 'support' | 'tip' | 'topUp';
|
|
1318
|
+
style?: 'white' | 'whiteOutline' | 'black' | 'automatic';
|
|
1319
|
+
} & StoreInstrumentElementOptions['styles'];
|
|
1304
1320
|
}
|
|
1305
|
-
|
|
1306
|
-
interface
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
unmount?: () => void;
|
|
1310
|
-
getState?: () => {
|
|
1311
|
-
isEmpty: boolean;
|
|
1312
|
-
isComplete: boolean;
|
|
1313
|
-
isValid: boolean;
|
|
1314
|
-
isFocused: boolean;
|
|
1315
|
-
value: unknown;
|
|
1316
|
-
required: boolean;
|
|
1317
|
-
};
|
|
1318
|
-
isValidElement?: () => boolean;
|
|
1319
|
-
setError?: (clientErrorText: string) => void;
|
|
1320
|
-
resetError?: () => void;
|
|
1321
|
-
setValue?: (elementValue: string) => void;
|
|
1322
|
-
clearValue?: () => void;
|
|
1321
|
+
declare global {
|
|
1322
|
+
interface Window {
|
|
1323
|
+
ApplePaySession?: ApplePaySession;
|
|
1324
|
+
}
|
|
1323
1325
|
}
|
|
1324
|
-
declare class
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
private element;
|
|
1332
|
-
private readonly cardTableName;
|
|
1333
|
-
private readonly containerType;
|
|
1334
|
-
constructor(__client: Skyflow, options: CollectContainerOptions, sdkConfig: SdkConfiguration);
|
|
1335
|
-
static init(vaultClient: Skyflow, options: CollectContainerOptions, sdkConfig: SdkConfiguration): PayrailsCollectContainer;
|
|
1336
|
-
createCollectElement(options: CollectElementOptions): PayrailsSecureField;
|
|
1337
|
-
mount(selector: string): void;
|
|
1326
|
+
declare class ApplePayButton extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
1327
|
+
protected options: ApplePayButtonOptions;
|
|
1328
|
+
private appleButton;
|
|
1329
|
+
private paymentExecutor;
|
|
1330
|
+
static isApplePayAvailable(): Promise<boolean>;
|
|
1331
|
+
constructor(options: ApplePayButtonOptions);
|
|
1332
|
+
mount(location: string): void;
|
|
1338
1333
|
unmount(): void;
|
|
1339
|
-
|
|
1340
|
-
private
|
|
1341
|
-
private
|
|
1342
|
-
tokenize(opts: TokenizeOptions): Promise<SaveInstrumentResponse>;
|
|
1343
|
-
private constructSaveInstrumentBody;
|
|
1344
|
-
private attachCustomEventHandler;
|
|
1345
|
-
private formatBin;
|
|
1346
|
-
private get elementToFieldMap();
|
|
1347
|
-
fetchBinLookup: (bin: string) => Promise<string | BinLookupResponse | {
|
|
1348
|
-
bin: string;
|
|
1349
|
-
}>;
|
|
1350
|
-
}
|
|
1351
|
-
interface TokenizeOptions {
|
|
1352
|
-
futureUsage?: 'CardOnFile' | 'Subscription' | 'UnscheduledCardOnFile';
|
|
1353
|
-
storeInstrument?: boolean;
|
|
1334
|
+
private mountApplePayButton;
|
|
1335
|
+
private createApplePaySession;
|
|
1336
|
+
private onApplePayAuthorized;
|
|
1354
1337
|
}
|
|
1355
1338
|
|
|
1356
1339
|
export { ApplePayButtonOptions, AuthorizationFailureReasons, CardFormOptions, CardListOptions, CardPaymentButtonOptions, DropinOptions, ElementType, GooglePayButtonOptions, INTEGRATION_TYPE, InitOptions, PAYMENT_METHOD_CODES, PaymentEvents, PaypalButtonOptions, Payrails, PayrailsAmount, PayrailsClientOptions, PayrailsContainerType, PayrailsEnvironment, PayrailsSecureField, PayrailsSecureFieldEvent, SaveInstrumentResponse, WorkflowExecutionResponse };
|