@payrails/web-sdk 5.19.0 → 5.20.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 +1 -1
- package/payrails.d.ts +185 -203
- package/payrails.js +4 -4
package/package.json
CHANGED
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
|
}
|
|
@@ -878,14 +934,13 @@ interface GooglePayButtonOptions extends StoreInstrumentElementOptions {
|
|
|
878
934
|
} & StoreInstrumentElementOptions['styles'];
|
|
879
935
|
}
|
|
880
936
|
declare class GooglePayButton extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
881
|
-
private sdkConfig;
|
|
882
937
|
protected options: GooglePayButtonOptions;
|
|
883
938
|
private googleButton;
|
|
884
939
|
private readonly paymentExecutor;
|
|
885
940
|
private static googleSDKClient;
|
|
886
941
|
private static getSDKClient;
|
|
887
942
|
static isGooglePayAvailable(allowedPaymentMethods: google.payments.api.IsReadyToPayPaymentMethodSpecification[], environment?: PayrailsEnvironment, merchantInfo?: google.payments.api.MerchantInfo): Promise<boolean>;
|
|
888
|
-
constructor(
|
|
943
|
+
constructor(options: GooglePayButtonOptions);
|
|
889
944
|
private sdkLoaded;
|
|
890
945
|
private onLoadPaymentData;
|
|
891
946
|
private authorize;
|
|
@@ -904,6 +959,28 @@ interface DropinElementStyles {
|
|
|
904
959
|
active?: Partial<CSSStyleDeclaration>;
|
|
905
960
|
}
|
|
906
961
|
|
|
962
|
+
interface ApplePayDropinOptions extends ApplePayButtonOptions {
|
|
963
|
+
translations?: {
|
|
964
|
+
labels?: {
|
|
965
|
+
label?: string;
|
|
966
|
+
storeInstrument?: string;
|
|
967
|
+
};
|
|
968
|
+
};
|
|
969
|
+
events?: ApplePayButtonOptions['events'] & DropinElementEvents;
|
|
970
|
+
styles?: DropinElementStyles & ApplePayButtonOptions['styles'];
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
interface CrediCardDropinOptions {
|
|
974
|
+
showPaymentMethodLogo?: boolean;
|
|
975
|
+
styles?: DropinElementStyles;
|
|
976
|
+
events?: DropinElementEvents;
|
|
977
|
+
translations?: {
|
|
978
|
+
labels?: {
|
|
979
|
+
label?: string;
|
|
980
|
+
};
|
|
981
|
+
} & CardFormOptions['translations'];
|
|
982
|
+
}
|
|
983
|
+
|
|
907
984
|
interface ButtonOptions {
|
|
908
985
|
id: string;
|
|
909
986
|
events?: PayrailsSDKEvents & {
|
|
@@ -928,10 +1005,9 @@ interface GenericRedirectButtonOptions {
|
|
|
928
1005
|
paymentMethod: BasePaymentMethodConfig;
|
|
929
1006
|
}
|
|
930
1007
|
declare class GenericRedirectButton extends PayrailsElement {
|
|
931
|
-
private sdkConfig;
|
|
932
1008
|
protected options: GenericRedirectButtonOptions;
|
|
933
1009
|
private readonly returnInfo?;
|
|
934
|
-
constructor(
|
|
1010
|
+
constructor(options: GenericRedirectButtonOptions, returnInfo?: ReturnInfo | undefined);
|
|
935
1011
|
private popup;
|
|
936
1012
|
private buildRedirectButton;
|
|
937
1013
|
private readonly paymentExecutor;
|
|
@@ -982,9 +1058,8 @@ interface PaypalButtonOptions extends StoreInstrumentElementOptions {
|
|
|
982
1058
|
} & StoreInstrumentElementOptions['styles'];
|
|
983
1059
|
}
|
|
984
1060
|
declare class PaypalButton extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
985
|
-
private sdkConfig;
|
|
986
1061
|
protected options?: PaypalButtonOptions | undefined;
|
|
987
|
-
constructor(
|
|
1062
|
+
constructor(options?: PaypalButtonOptions | undefined);
|
|
988
1063
|
fraudNetGuid: string | undefined;
|
|
989
1064
|
private paymentExecutor;
|
|
990
1065
|
private button;
|
|
@@ -996,6 +1071,7 @@ declare class PaypalButton extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
|
996
1071
|
private createPaypalButton;
|
|
997
1072
|
private createPayPalButtonConfig;
|
|
998
1073
|
private createBillingAgreementConfig;
|
|
1074
|
+
private onCancel;
|
|
999
1075
|
private createOneTimeOrderConfig;
|
|
1000
1076
|
private createBaseConfig;
|
|
1001
1077
|
private createOneTimeOrder;
|
|
@@ -1020,14 +1096,13 @@ declare class Dropin extends PayrailsElement {
|
|
|
1020
1096
|
private collectContainer;
|
|
1021
1097
|
private readonly clientConfig;
|
|
1022
1098
|
private readonly dropinConfig;
|
|
1023
|
-
private readonly sdkConfig;
|
|
1024
1099
|
private cardPaymentButton;
|
|
1025
1100
|
private creditCard;
|
|
1026
1101
|
private googlePay;
|
|
1027
1102
|
private applePay;
|
|
1028
1103
|
private cardForm;
|
|
1029
1104
|
private paypal;
|
|
1030
|
-
constructor(collectContainer: PayrailsCollectContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions
|
|
1105
|
+
constructor(collectContainer: PayrailsCollectContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions);
|
|
1031
1106
|
private isHppIntegration;
|
|
1032
1107
|
private createStoredInstrumentElement;
|
|
1033
1108
|
private createInstallmentsDropdown;
|
|
@@ -1078,7 +1153,7 @@ interface DropinOptions {
|
|
|
1078
1153
|
[key: string]: any;
|
|
1079
1154
|
googlePayButton?: GooglePayDropinOptions['translations'];
|
|
1080
1155
|
cardPaymentButton?: CardPaymentButtonOptions['translations'];
|
|
1081
|
-
cardForm?:
|
|
1156
|
+
cardForm?: CrediCardDropinOptions['translations'];
|
|
1082
1157
|
paymentResult?: {
|
|
1083
1158
|
success?: string;
|
|
1084
1159
|
fail?: string;
|
|
@@ -1087,6 +1162,7 @@ interface DropinOptions {
|
|
|
1087
1162
|
paypalButton?: PaypalDropinOptions['translations'];
|
|
1088
1163
|
mercadoPago?: GenericRedirectDropinOptions['translations'];
|
|
1089
1164
|
addressSelector?: AddressSelectorElementOptions['translations'];
|
|
1165
|
+
applePayButton?: ApplePayDropinOptions['translations'];
|
|
1090
1166
|
};
|
|
1091
1167
|
styles?: {
|
|
1092
1168
|
[key: string]: any;
|
|
@@ -1149,9 +1225,7 @@ declare class FraudNet implements Mountable {
|
|
|
1149
1225
|
|
|
1150
1226
|
interface PayrailsClientOptions {
|
|
1151
1227
|
environment?: PayrailsEnvironment;
|
|
1152
|
-
events?:
|
|
1153
|
-
onClientInitialized: (execution?: typeof WorkflowExecution) => void;
|
|
1154
|
-
};
|
|
1228
|
+
events?: ClientEvents;
|
|
1155
1229
|
redirectFor3DS?: boolean;
|
|
1156
1230
|
returnInfo?: ReturnInfo;
|
|
1157
1231
|
telemetry?: {
|
|
@@ -1160,7 +1234,6 @@ interface PayrailsClientOptions {
|
|
|
1160
1234
|
};
|
|
1161
1235
|
}
|
|
1162
1236
|
declare class Payrails {
|
|
1163
|
-
private sdkConfiguration;
|
|
1164
1237
|
private vaultClient;
|
|
1165
1238
|
private options?;
|
|
1166
1239
|
private __container;
|
|
@@ -1197,9 +1270,9 @@ declare class Payrails {
|
|
|
1197
1270
|
private getContainerLayout;
|
|
1198
1271
|
binLookup(): Promise<any>;
|
|
1199
1272
|
}
|
|
1200
|
-
interface
|
|
1201
|
-
|
|
1202
|
-
|
|
1273
|
+
interface ClientEvents {
|
|
1274
|
+
onClientInitialized?: (execution?: typeof WorkflowExecution) => void;
|
|
1275
|
+
onSessionExpired?: () => Promise<InitOptions>;
|
|
1203
1276
|
}
|
|
1204
1277
|
interface PaymentEvents {
|
|
1205
1278
|
onAuthorizeSuccess?: (e?: any) => void;
|
|
@@ -1228,129 +1301,38 @@ interface DropinEvents {
|
|
|
1228
1301
|
onPaymentOptionSelected?: (e: onPaymentMethodSelectedParams) => void;
|
|
1229
1302
|
}
|
|
1230
1303
|
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
1304
|
declare enum PayrailsEnvironment {
|
|
1264
1305
|
TEST = "TEST",
|
|
1265
1306
|
PRODUCTION = "PRODUCTION"
|
|
1266
1307
|
}
|
|
1267
1308
|
|
|
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>;
|
|
1309
|
+
interface ApplePayButtonOptions extends StoreInstrumentElementOptions {
|
|
1310
|
+
clientDomain?: string;
|
|
1311
|
+
showPaymentMethodLogo?: boolean;
|
|
1312
|
+
events?: PaymentEvents & {
|
|
1313
|
+
onApplePayAvailable?: () => void;
|
|
1303
1314
|
};
|
|
1315
|
+
styles?: {
|
|
1316
|
+
type?: 'plain' | 'buy' | 'addMoney' | 'book' | 'checkout' | 'continue' | 'contribute' | 'donate' | 'inStore' | 'order' | 'reload' | 'rent' | 'setUp' | 'subscribe' | 'support' | 'tip' | 'topUp';
|
|
1317
|
+
style?: 'white' | 'whiteOutline' | 'black' | 'automatic';
|
|
1318
|
+
} & StoreInstrumentElementOptions['styles'];
|
|
1304
1319
|
}
|
|
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;
|
|
1320
|
+
declare global {
|
|
1321
|
+
interface Window {
|
|
1322
|
+
ApplePaySession?: ApplePaySession;
|
|
1323
|
+
}
|
|
1323
1324
|
}
|
|
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;
|
|
1325
|
+
declare class ApplePayButton extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
1326
|
+
protected options: ApplePayButtonOptions;
|
|
1327
|
+
private appleButton;
|
|
1328
|
+
private paymentExecutor;
|
|
1329
|
+
static isApplePayAvailable(): Promise<boolean>;
|
|
1330
|
+
constructor(options: ApplePayButtonOptions);
|
|
1331
|
+
mount(location: string): void;
|
|
1338
1332
|
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;
|
|
1333
|
+
private mountApplePayButton;
|
|
1334
|
+
private createApplePaySession;
|
|
1335
|
+
private onApplePayAuthorized;
|
|
1354
1336
|
}
|
|
1355
1337
|
|
|
1356
1338
|
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 };
|