@paydock/client-sdk 1.115.0 → 1.116.2
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 +531 -40
- package/bundles/index.cjs +515 -87
- package/bundles/index.cjs.d.ts +214 -1
- package/bundles/index.mjs +514 -88
- package/bundles/index.mjs.d.ts +214 -1
- package/bundles/types/api/api-charge-internal.d.ts +1 -0
- package/bundles/types/api/api-charge-internal.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.generic.show_message.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/payment-methods.d.ts +0 -1
- package/bundles/types/checkout/layout-widgets/payment-methods.d.ts.map +1 -1
- package/bundles/types/index-cba.d.ts +2 -0
- package/bundles/types/index-cba.d.ts.map +1 -1
- package/bundles/types/index.d.ts +2 -0
- package/bundles/types/index.d.ts.map +1 -1
- package/bundles/types/paypal-data-collector/index.d.ts +23 -0
- package/bundles/types/paypal-data-collector/index.d.ts.map +1 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts +58 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts.map +1 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.interfaces.d.ts +21 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.interfaces.d.ts.map +1 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.service.d.ts +17 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.service.d.ts.map +1 -0
- package/bundles/types/paypal-save-payment-source/index.d.ts +61 -0
- package/bundles/types/paypal-save-payment-source/index.d.ts.map +1 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.d.ts +85 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.d.ts.map +1 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.interfaces.d.ts +84 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.interfaces.d.ts.map +1 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.service.d.ts +36 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.service.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/index.d.ts +0 -1
- package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/interfaces.d.ts +1 -5
- package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/wallet-capture-request.interface.d.ts +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/wallet-capture-request.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts.map +1 -1
- package/bundles/widget.umd.js +515 -87
- package/bundles/widget.umd.js.d.ts +214 -1
- package/bundles/widget.umd.js.min.d.ts +214 -1
- package/bundles/widget.umd.min.js +7 -7
- package/docs/click-to-pay-examples.md +0 -36
- package/docs/click-to-pay.md +0 -3
- package/docs/paypal-data-collector-examples.md +58 -0
- package/docs/paypal-data-collector.md +149 -0
- package/docs/paypal-save-payment-source-examples.md +63 -0
- package/docs/paypal-save-payment-source.md +256 -0
- package/docs/wallet-buttons-express-examples.md +1 -1
- package/package.json +1 -1
- package/slate.md +0 -36
package/bundles/index.mjs.d.ts
CHANGED
|
@@ -1824,6 +1824,7 @@ interface WalletCaptureBody {
|
|
|
1824
1824
|
address_country?: string;
|
|
1825
1825
|
external_payer_id?: string;
|
|
1826
1826
|
ref_token?: string;
|
|
1827
|
+
wallet_express?: boolean;
|
|
1827
1828
|
};
|
|
1828
1829
|
};
|
|
1829
1830
|
}
|
|
@@ -3459,6 +3460,7 @@ interface WalletCaptureRequest {
|
|
|
3459
3460
|
address_state?: string;
|
|
3460
3461
|
ref_token?: string;
|
|
3461
3462
|
external_payer_id?: string;
|
|
3463
|
+
wallet_express?: boolean;
|
|
3462
3464
|
};
|
|
3463
3465
|
};
|
|
3464
3466
|
}
|
|
@@ -3803,4 +3805,215 @@ declare class PaypalWalletButtonExpress extends BaseWalletButton<PaypalWalletMet
|
|
|
3803
3805
|
private paypalSharedProps;
|
|
3804
3806
|
}
|
|
3805
3807
|
|
|
3806
|
-
|
|
3808
|
+
declare enum ErrorCodes$1 {
|
|
3809
|
+
PROMISE_NOT_ENABLED = "promise_not_enabled",
|
|
3810
|
+
SCRIPT_ERROR = "script_error"
|
|
3811
|
+
}
|
|
3812
|
+
interface PayPalDataCollectorConfig {
|
|
3813
|
+
mouse_movement?: boolean;
|
|
3814
|
+
}
|
|
3815
|
+
interface IPayPalDataCollector {
|
|
3816
|
+
collectDeviceData(): Promise<CollectedDeviceData>;
|
|
3817
|
+
setEnv(env: string): void;
|
|
3818
|
+
}
|
|
3819
|
+
interface CollectedDeviceData {
|
|
3820
|
+
correlation_id: string;
|
|
3821
|
+
}
|
|
3822
|
+
interface IOnErrorEventData$1 {
|
|
3823
|
+
error_code: ErrorCodes$1;
|
|
3824
|
+
}
|
|
3825
|
+
|
|
3826
|
+
/**
|
|
3827
|
+
* PayPal Data Collector Widget constructor
|
|
3828
|
+
*
|
|
3829
|
+
* @param {string} flowId - This string identifies the source website of the FraudNet request.
|
|
3830
|
+
* @param {PayPalDataCollectorConfig} config - Extra configuration for the widget.
|
|
3831
|
+
*
|
|
3832
|
+
* @example
|
|
3833
|
+
* var payPalDataCollector = new PayPalDataCollector('FLOW_ID', {});
|
|
3834
|
+
*/
|
|
3835
|
+
declare class PayPalDataCollector {
|
|
3836
|
+
protected service: IPayPalDataCollector;
|
|
3837
|
+
protected eventEmitter: EventEmitter;
|
|
3838
|
+
/** @constructs */ constructor(flowId?: string, config?: PayPalDataCollectorConfig);
|
|
3839
|
+
/**
|
|
3840
|
+
* After configuring the PayPalDataCollector Widget, starts the process and returns
|
|
3841
|
+
* the correlation id used among the requests.
|
|
3842
|
+
*
|
|
3843
|
+
* @returns {Promise<CollectedDeviceData>} Promise when resolved, returnsa an object
|
|
3844
|
+
* that contains the `correlation_id` key.
|
|
3845
|
+
*
|
|
3846
|
+
* @example
|
|
3847
|
+
* const collectedDeviceData = await payPalDataCollectorWidget.collectDeviceData();
|
|
3848
|
+
* console.log(collectedDeviceData.correlation_id)
|
|
3849
|
+
*/
|
|
3850
|
+
collectDeviceData(): Promise<CollectedDeviceData>;
|
|
3851
|
+
/**
|
|
3852
|
+
* Callback for onError method.
|
|
3853
|
+
*
|
|
3854
|
+
* @callback OnErrorCallback
|
|
3855
|
+
* @param {IOnErrorEventData|null} data
|
|
3856
|
+
*/
|
|
3857
|
+
/**
|
|
3858
|
+
* If the process fails, the function passed as parameter will be called.
|
|
3859
|
+
* Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
3860
|
+
*
|
|
3861
|
+
* @example
|
|
3862
|
+
* PayPalDataCollector.onError((eventData) => console.log('Some error occur'));
|
|
3863
|
+
*
|
|
3864
|
+
* @param {OnErrorCallback} [callback] - Function to be called when there is an error in the flow.
|
|
3865
|
+
*/
|
|
3866
|
+
onError(callback?: (data?: IOnErrorEventData$1) => void): () => void;
|
|
3867
|
+
/**
|
|
3868
|
+
* Current method can change environment. By default environment = test.
|
|
3869
|
+
* This method does not affect Paydock's API calls or environments, is only for PayPal Data Collector
|
|
3870
|
+
* script, in order to know if the script is injected on a live server or is a testing
|
|
3871
|
+
* environment. The available values are `test` and `live`. This should match with the used
|
|
3872
|
+
* `gateway.mode` in Paydock to process the transaction.
|
|
3873
|
+
*
|
|
3874
|
+
* @example
|
|
3875
|
+
* PayPalDataCollector.setEnv('live');
|
|
3876
|
+
* @param {string} env - test, live
|
|
3877
|
+
*/
|
|
3878
|
+
setEnv(env: string): void;
|
|
3879
|
+
}
|
|
3880
|
+
|
|
3881
|
+
interface PayPalStyleConfig {
|
|
3882
|
+
layout?: 'vertical' | 'horizontal';
|
|
3883
|
+
color?: 'blue' | 'gold' | 'silver' | 'black' | 'white';
|
|
3884
|
+
shape?: 'rect' | 'sharp' | 'pill';
|
|
3885
|
+
label?: 'paypal' | 'checkout' | 'buynow' | 'pay';
|
|
3886
|
+
disableMaxWidth?: boolean;
|
|
3887
|
+
disableMaxHeight?: boolean;
|
|
3888
|
+
height?: number;
|
|
3889
|
+
borderRadius?: number;
|
|
3890
|
+
tagline?: boolean;
|
|
3891
|
+
}
|
|
3892
|
+
interface PayPalMessageConfig {
|
|
3893
|
+
amount?: number;
|
|
3894
|
+
align?: 'center' | 'left' | 'right';
|
|
3895
|
+
color?: 'black' | 'white';
|
|
3896
|
+
position?: 'top' | 'bottom';
|
|
3897
|
+
}
|
|
3898
|
+
interface PayPalSavePaymentSourceWidgetConfig {
|
|
3899
|
+
style?: PayPalStyleConfig;
|
|
3900
|
+
message?: PayPalMessageConfig;
|
|
3901
|
+
}
|
|
3902
|
+
interface IPayPalSavePaymentSourceWidget {
|
|
3903
|
+
load(container: Container): void;
|
|
3904
|
+
setEnv(env: string, alias?: string): void;
|
|
3905
|
+
}
|
|
3906
|
+
declare enum ErrorCodes {
|
|
3907
|
+
UNAVAILABLE = "unavailable",
|
|
3908
|
+
ON_PAYPAL_VAULT_SETUP_TOKEN_ERROR = "onPaypalVaultSetupTokenError",
|
|
3909
|
+
ON_GET_ID_TOKEN_ERROR = "onGetIdTokenError",
|
|
3910
|
+
ON_GET_WALLET_CONFIG_ERROR = "onGetWalletConfigError",
|
|
3911
|
+
ON_GET_SETUP_TOKEN_ERROR = "onGetSetupTokenError",
|
|
3912
|
+
ON_ONE_TIME_TOKEN_ERROR = "onOneTimeTokenError"
|
|
3913
|
+
}
|
|
3914
|
+
declare enum EVENTS {
|
|
3915
|
+
ON_SUCCESS = "ON_SUCCESS",
|
|
3916
|
+
ON_ERROR = "ON_ERROR",
|
|
3917
|
+
ON_CANCEL = "ON_CANCEL"
|
|
3918
|
+
}
|
|
3919
|
+
interface IOnSuccessEventData {
|
|
3920
|
+
event: EVENTS.ON_SUCCESS;
|
|
3921
|
+
data: {
|
|
3922
|
+
token: string;
|
|
3923
|
+
email: string;
|
|
3924
|
+
};
|
|
3925
|
+
}
|
|
3926
|
+
interface IOnErrorEventData {
|
|
3927
|
+
event: EVENTS.ON_ERROR;
|
|
3928
|
+
data: {
|
|
3929
|
+
error_code: ErrorCodes;
|
|
3930
|
+
details?: string;
|
|
3931
|
+
message?: string;
|
|
3932
|
+
};
|
|
3933
|
+
}
|
|
3934
|
+
interface IOnCancelEventData {
|
|
3935
|
+
event: EVENTS.ON_CANCEL;
|
|
3936
|
+
}
|
|
3937
|
+
|
|
3938
|
+
/**
|
|
3939
|
+
* PayPal Save Payment Source Widget constructor
|
|
3940
|
+
*
|
|
3941
|
+
* @param {string} selector - Selector of html element. Container for PayPal Save Payment Source Widget.
|
|
3942
|
+
* @param {string} publicKey - PayDock users public key.
|
|
3943
|
+
* @param {string} gatewayId - PayDock's PayPal gatewayId.
|
|
3944
|
+
* @param {PayPalSavePaymentSourceWidgetConfig} config - Extra configuration for the widget, like styles.
|
|
3945
|
+
*
|
|
3946
|
+
* @example
|
|
3947
|
+
* var payPalSavePaymentSourceWidget = new PayPalSavePaymentSourceWidget('#paypalButton', 'public_key', 'gateway_id');
|
|
3948
|
+
*/
|
|
3949
|
+
declare class PayPalSavePaymentSourceWidget {
|
|
3950
|
+
protected container: Container;
|
|
3951
|
+
protected service: IPayPalSavePaymentSourceWidget;
|
|
3952
|
+
protected eventEmitter: EventEmitter;
|
|
3953
|
+
/** @constructs */ constructor(selector: string, publicKey: string, gatewayId: string, config?: PayPalSavePaymentSourceWidgetConfig);
|
|
3954
|
+
/**
|
|
3955
|
+
* The final method after configuring the PayPalSavePaymentSource Widget to
|
|
3956
|
+
* start the load process.
|
|
3957
|
+
*/
|
|
3958
|
+
load(): void;
|
|
3959
|
+
/**
|
|
3960
|
+
* Current method can change environment. By default environment = sandbox.
|
|
3961
|
+
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
3962
|
+
*
|
|
3963
|
+
* @example
|
|
3964
|
+
* payPalSavePaymentSourceWidget.setEnv('production');
|
|
3965
|
+
* @param {string} env - sandbox, production
|
|
3966
|
+
* @param {string} [alias] - Own domain alias
|
|
3967
|
+
*/
|
|
3968
|
+
setEnv(env: string, alias?: string): void;
|
|
3969
|
+
/**
|
|
3970
|
+
* Callback for onSuccess method.
|
|
3971
|
+
*
|
|
3972
|
+
* @callback OnSuccessCallback
|
|
3973
|
+
* @param {IOnSuccessEventData} data
|
|
3974
|
+
*/
|
|
3975
|
+
/**
|
|
3976
|
+
* If the setup token was successfully approved and a OTT was generated, the function passed as parameter will be called.
|
|
3977
|
+
* Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
3978
|
+
*
|
|
3979
|
+
* @example
|
|
3980
|
+
* payPalSavePaymentSourceWidget.onSuccess((eventData) => console.log('One time token and email obtained successfully'));
|
|
3981
|
+
*
|
|
3982
|
+
* @param {OnSuccessCallback} [callback] - Function to be called when the result is successful.
|
|
3983
|
+
*/
|
|
3984
|
+
onSuccess(callback?: (data: IOnSuccessEventData) => void): () => void;
|
|
3985
|
+
/**
|
|
3986
|
+
* Callback for onError method.
|
|
3987
|
+
*
|
|
3988
|
+
* @callback OnErrorCallback
|
|
3989
|
+
* @param {IOnErrorEventData} data
|
|
3990
|
+
*/
|
|
3991
|
+
/**
|
|
3992
|
+
* If in the process for obtaining the setup token fails, the function passed as parameter will be called.
|
|
3993
|
+
* Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
3994
|
+
*
|
|
3995
|
+
* @example
|
|
3996
|
+
* payPalSavePaymentSourceWidget.onError((eventData) => console.log('Some error occurred'));
|
|
3997
|
+
*
|
|
3998
|
+
* @param {OnErrorCallback} [callback] - Function to be called when there is an error in the flow.
|
|
3999
|
+
*/
|
|
4000
|
+
onError(callback?: (data: IOnErrorEventData) => void): () => void;
|
|
4001
|
+
/**
|
|
4002
|
+
* Callback for onCancel method.
|
|
4003
|
+
*
|
|
4004
|
+
* @callback OnCancelCallback
|
|
4005
|
+
* @param {IOnCancelEventData} data
|
|
4006
|
+
*/
|
|
4007
|
+
/**
|
|
4008
|
+
* If in the process for obtaining the setup token was cancelled, the function passed as parameter will be called.
|
|
4009
|
+
* Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
4010
|
+
*
|
|
4011
|
+
* @example
|
|
4012
|
+
* payPalSavePaymentSourceWidget.onCancel(() => console.log('Operation cancelled'));
|
|
4013
|
+
*
|
|
4014
|
+
* @param {OnCancelCallback} [callback] - Function to be called when the operation is cancelled.
|
|
4015
|
+
*/
|
|
4016
|
+
onCancel(callback?: (data?: IOnCancelEventData) => void): () => void;
|
|
4017
|
+
}
|
|
4018
|
+
|
|
4019
|
+
export { AfterpayCheckoutButton, Api, ApplePayWalletButtonExpress, CHECKOUT_BUTTON_EVENT, Canvas3ds, Checkout, ClickToPay, Configuration, ELEMENT, EVENT$1 as EVENT, Builder$1 as ExternalCheckoutBuilder, Checker as ExternalCheckoutChecker, FORM_FIELD, HtmlMultiWidget, HtmlPaymentSourceWidget, HtmlWidget, type ICheckout, type IDetails, type IElementStyleInput, type IEventCheckoutFinishData, type IPayPalMeta, type IStyles$1 as IStyles, type ITexts, InstructionDebugger, MultiWidget, PAYMENT_TYPE, PURPOSE, PayPalDataCollector, PayPalSavePaymentSourceWidget, Builder as PaymentSourceBuilder, PaymentSourceWidget, PaypalCheckoutButton, PaypalWalletButtonExpress, STYLABLE_ELEMENT, STYLABLE_ELEMENT_STATE, STYLE, SUPPORTED_CARD_TYPES, TEXT, TRIGGER, TYPE, VAULT_DISPLAY_STYLE, type VaultDisplayStyle, VaultDisplayWidget, WalletButtons, ZipmoneyCheckoutButton };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-charge-internal.d.ts","sourceRoot":"","sources":["../../src/api/api-charge-internal.ts"],"names":[],"mappings":"AAAA,OAAO,EA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C;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instruction.generic.show_message.d.ts","sourceRoot":"","sources":["../../../../src/checkout/instructions/v1/instruction.generic.show_message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAOvE,UAAU,gBAAgB;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,aAAa,CAAA;CACzB;AAED,UAAU,aAAa;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;IACxC,aAAa,CAAC,EAAE;QAAE,IAAI,EAAE;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,WAAW,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAC3F;AAED,qBACa,6BAA8B,SAAQ,kBAAkB;IACjE,OAAO,CAAC,SAAS,CAAM;IAEvB,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAwBhC,OAAO;
|
|
1
|
+
{"version":3,"file":"instruction.generic.show_message.d.ts","sourceRoot":"","sources":["../../../../src/checkout/instructions/v1/instruction.generic.show_message.ts"],"names":[],"mappings":"AA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AAY,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,EAClJ,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EACxC,iBAAiB,EAAE,MAAM,EACzB,IAAI,GAAE,OAAe;IAYzB,OAAO,CAAC,IAAI;IAsCZ,OAAO,CAAC,kBAAkB;IAmBnB,MAAM,CAAC,iBAAiB,KAAA;IAS/B,OAAO,CAAC,SAAS;IAkCjB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,2BAA2B;IAM5B,oBAAoB;CAmB9B"}
|
|
@@ -9,6 +9,8 @@ export * from './checkout/index';
|
|
|
9
9
|
export * from './wallet-buttons';
|
|
10
10
|
export * from './checkout/index';
|
|
11
11
|
export * from './widget';
|
|
12
|
+
export * from './paypal-data-collector';
|
|
13
|
+
export * from './paypal-save-payment-source';
|
|
12
14
|
export { ELEMENT, FORM_FIELD, STYLE, SUPPORTED_CARD_TYPES, TEXT, VAULT_DISPLAY_STYLE, type IPayPalMeta, type IStyles, type ITexts, type VaultDisplayStyle, } from './components/param';
|
|
13
15
|
export { EVENT } from './components/iframe-event';
|
|
14
16
|
export { TRIGGER } from './components/trigger';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-cba.d.ts","sourceRoot":"","sources":["../src/index-cba.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index-cba.d.ts","sourceRoot":"","sources":["../src/index-cba.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAE7C,OAAO,EACH,OAAO,EACP,UAAU,EACV,KAAK,EACL,oBAAoB,EACpB,IAAI,EACJ,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,iBAAiB,GACzB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC"}
|
package/bundles/types/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export * from './wallet-buttons';
|
|
|
10
10
|
export * from './widget';
|
|
11
11
|
export * from './checkout/index';
|
|
12
12
|
export * from './wallet-buttons-express';
|
|
13
|
+
export * from './paypal-data-collector';
|
|
14
|
+
export * from './paypal-save-payment-source';
|
|
13
15
|
export { ELEMENT, FORM_FIELD, STYLE, SUPPORTED_CARD_TYPES, TEXT, VAULT_DISPLAY_STYLE, type IPayPalMeta, type IStyles, type ITexts, type VaultDisplayStyle, } from './components/param';
|
|
14
16
|
export { EVENT } from './components/iframe-event';
|
|
15
17
|
export { TRIGGER } from './components/trigger';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAE7C,OAAO,EACH,OAAO,EACP,UAAU,EACV,KAAK,EACL,oBAAoB,EACpB,IAAI,EACJ,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,iBAAiB,GACzB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { PayPalDataCollector } from './paypal-data-collector';
|
|
2
|
+
/**
|
|
3
|
+
* Interface of data used for PayPal configuration. For further information refer to [the documentation](https://developer.paypal.com/sdk/js/reference/#style).
|
|
4
|
+
* @interface PayPalDataCollectorConfig
|
|
5
|
+
*
|
|
6
|
+
* @type {object}
|
|
7
|
+
* @param {boolean} [mouse_movement] Used for indicating if is enabled mouse movement collection.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Data object with the corresponding `correlation_id`.
|
|
11
|
+
* @interface CollectedDeviceData
|
|
12
|
+
*
|
|
13
|
+
* @type {object}
|
|
14
|
+
* @param {string} [correlation_id] The correlation ID that was used on the subsecuent requests.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Interface for IOnErrorEventData
|
|
18
|
+
* @interface IOnErrorEventData
|
|
19
|
+
*
|
|
20
|
+
* @type {object}
|
|
21
|
+
* @param {string} error_code Error code. One of 'promise_not_enabled' or 'script_error'.
|
|
22
|
+
**/
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/paypal-data-collector/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;;;;;GAMG;AAEH;;;;;;GAMG;AAEH;;;;;;IAMI"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { EventEmitter } from "../helper/event-emitter";
|
|
2
|
+
import { type CollectedDeviceData, type IOnErrorEventData, type IPayPalDataCollector, type PayPalDataCollectorConfig } from "./paypal-data-collector.interfaces";
|
|
3
|
+
/**
|
|
4
|
+
* PayPal Data Collector Widget constructor
|
|
5
|
+
*
|
|
6
|
+
* @param {string} flowId - This string identifies the source website of the FraudNet request.
|
|
7
|
+
* @param {PayPalDataCollectorConfig} config - Extra configuration for the widget.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* var payPalDataCollector = new PayPalDataCollector('FLOW_ID', {});
|
|
11
|
+
*/
|
|
12
|
+
declare class PayPalDataCollector {
|
|
13
|
+
protected service: IPayPalDataCollector;
|
|
14
|
+
protected eventEmitter: EventEmitter;
|
|
15
|
+
/** @constructs */ constructor(flowId?: string, config?: PayPalDataCollectorConfig);
|
|
16
|
+
/**
|
|
17
|
+
* After configuring the PayPalDataCollector Widget, starts the process and returns
|
|
18
|
+
* the correlation id used among the requests.
|
|
19
|
+
*
|
|
20
|
+
* @returns {Promise<CollectedDeviceData>} Promise when resolved, returnsa an object
|
|
21
|
+
* that contains the `correlation_id` key.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* const collectedDeviceData = await payPalDataCollectorWidget.collectDeviceData();
|
|
25
|
+
* console.log(collectedDeviceData.correlation_id)
|
|
26
|
+
*/
|
|
27
|
+
collectDeviceData(): Promise<CollectedDeviceData>;
|
|
28
|
+
/**
|
|
29
|
+
* Callback for onError method.
|
|
30
|
+
*
|
|
31
|
+
* @callback OnErrorCallback
|
|
32
|
+
* @param {IOnErrorEventData|null} data
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* If the process fails, the function passed as parameter will be called.
|
|
36
|
+
* Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* PayPalDataCollector.onError((eventData) => console.log('Some error occur'));
|
|
40
|
+
*
|
|
41
|
+
* @param {OnErrorCallback} [callback] - Function to be called when there is an error in the flow.
|
|
42
|
+
*/
|
|
43
|
+
onError(callback?: (data?: IOnErrorEventData) => void): () => void;
|
|
44
|
+
/**
|
|
45
|
+
* Current method can change environment. By default environment = test.
|
|
46
|
+
* This method does not affect Paydock's API calls or environments, is only for PayPal Data Collector
|
|
47
|
+
* script, in order to know if the script is injected on a live server or is a testing
|
|
48
|
+
* environment. The available values are `test` and `live`. This should match with the used
|
|
49
|
+
* `gateway.mode` in Paydock to process the transaction.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* PayPalDataCollector.setEnv('live');
|
|
53
|
+
* @param {string} env - test, live
|
|
54
|
+
*/
|
|
55
|
+
setEnv(env: string): void;
|
|
56
|
+
}
|
|
57
|
+
export { PayPalDataCollector };
|
|
58
|
+
//# sourceMappingURL=paypal-data-collector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paypal-data-collector.d.ts","sourceRoot":"","sources":["../../src/paypal-data-collector/paypal-data-collector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAEzB,KAAK,yBAAyB,EAC/B,MAAM,oCAAoC,CAAC;AAI5C;;;;;;;;GAQG;AACH,cAAM,mBAAmB;IACvB,SAAS,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACxC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAErC,kBAAkB,aAEhB,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,yBAAyB;IAUpC;;;;;;;;;;OAUG;IACI,iBAAiB,IAAI,OAAO,CAAC,mBAAmB,CAAC;IASxD;;;;;OAKG;IACH;;;;;;;;OAQG;IACI,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,iBAAiB,KAAK,IAAI;IAI5D;;;;;;;;;;OAUG;IACI,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAGjC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare enum PAYPAL_DATA_COLLECTOR_EVENTS {
|
|
2
|
+
ON_ERROR = "ON_ERROR"
|
|
3
|
+
}
|
|
4
|
+
export declare enum ErrorCodes {
|
|
5
|
+
PROMISE_NOT_ENABLED = "promise_not_enabled",
|
|
6
|
+
SCRIPT_ERROR = "script_error"
|
|
7
|
+
}
|
|
8
|
+
export interface PayPalDataCollectorConfig {
|
|
9
|
+
mouse_movement?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface IPayPalDataCollector {
|
|
12
|
+
collectDeviceData(): Promise<CollectedDeviceData>;
|
|
13
|
+
setEnv(env: string): void;
|
|
14
|
+
}
|
|
15
|
+
export interface CollectedDeviceData {
|
|
16
|
+
correlation_id: string;
|
|
17
|
+
}
|
|
18
|
+
export interface IOnErrorEventData {
|
|
19
|
+
error_code: ErrorCodes;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=paypal-data-collector.interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paypal-data-collector.interfaces.d.ts","sourceRoot":"","sources":["../../src/paypal-data-collector/paypal-data-collector.interfaces.ts"],"names":[],"mappings":"AAAA,oBAAY,4BAA4B;IACtC,QAAQ,aAAa;CACtB;AAED,oBAAY,UAAU;IACpB,mBAAmB,wBAAwB;IAC3C,YAAY,iBAAiB;CAC9B;AAED,MAAM,WAAW,yBAAyB;IACxC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,iBAAiB,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,UAAU,CAAC;CACxB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { EventEmitter } from "../helper/event-emitter";
|
|
2
|
+
import { type CollectedDeviceData, type IPayPalDataCollector, type PayPalDataCollectorConfig } from "./paypal-data-collector.interfaces";
|
|
3
|
+
export declare class PayPalDataCollectorService implements IPayPalDataCollector {
|
|
4
|
+
protected eventEmitter: EventEmitter;
|
|
5
|
+
protected flowId?: string;
|
|
6
|
+
protected config?: PayPalDataCollectorConfig;
|
|
7
|
+
protected correlationId: string;
|
|
8
|
+
protected isSandbox: boolean;
|
|
9
|
+
constructor(eventEmitter: EventEmitter, flowId?: string, config?: PayPalDataCollectorConfig);
|
|
10
|
+
static fromConfig(eventEmitter: EventEmitter, flowId?: string, config?: PayPalDataCollectorConfig): PayPalDataCollectorService;
|
|
11
|
+
collectDeviceData(): Promise<CollectedDeviceData>;
|
|
12
|
+
private appendPaypalSavePaymentSourceComponent;
|
|
13
|
+
private setupCallbacks;
|
|
14
|
+
onError(): void;
|
|
15
|
+
setEnv(env: string): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=paypal-data-collector.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paypal-data-collector.service.d.ts","sourceRoot":"","sources":["../../src/paypal-data-collector/paypal-data-collector.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,KAAK,mBAAmB,EAExB,KAAK,oBAAoB,EAEzB,KAAK,yBAAyB,EAC/B,MAAM,oCAAoC,CAAC;AAE5C,qBAAa,0BAA2B,YAAW,oBAAoB;IAKnE,SAAS,CAAC,YAAY,EAAE,YAAY;IACpC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM;IACzB,SAAS,CAAC,MAAM,CAAC,EAAE,yBAAyB;IAN9C,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC;IAChC,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC;gBAGjB,YAAY,EAAE,YAAY,EAC1B,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,yBAAyB;IAG9C,MAAM,CAAC,UAAU,CACf,YAAY,EAAE,YAAY,EAC1B,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,yBAAyB;IAK7B,iBAAiB,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAUxD,OAAO,CAAC,sCAAsC;IAgC9C,OAAO,CAAC,cAAc;IAsBf,OAAO;IAMP,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAGjC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export { PayPalSavePaymentSourceWidget } from './paypal-save-payment-source';
|
|
2
|
+
/**
|
|
3
|
+
* Interface of data used for PayPal configuration. For further information refer to [the documentation](https://developer.paypal.com/sdk/js/reference/#style).
|
|
4
|
+
* @interface PayPalSavePaymentSourceWidgetConfig
|
|
5
|
+
*
|
|
6
|
+
* @type {object}
|
|
7
|
+
* @param {'vertical'|'horizontal'} [style.layout] Used for indicating the PayPal Button layout.
|
|
8
|
+
* @param {'blue'|'gold'|'silver'|'black'|'white'} [style.color] Used for indicating the main color of the PayPal Button.
|
|
9
|
+
* @param {'rect'|'sharp'|'pill'} [style.shape] Used for indicating the shape of the PayPal Button.
|
|
10
|
+
* @param {'paypal'|'checkout'|'buynow'|'pay'} [style.label] Used for indicating the label of the PayPal Button.
|
|
11
|
+
* @param {boolean} [style.disableMaxWidth] Used for indicating if the max width will be disabled.
|
|
12
|
+
* @param {boolean} [style.disableMaxHeight] Used for indicating the max height will be disabled.
|
|
13
|
+
* @param {number} [style.height] Used for indicating the height of the PayPal Button, if disableMaxHeight is true.
|
|
14
|
+
* @param {number} [style.borderRadius] Used for indicating the border radius of the PayPal Button.
|
|
15
|
+
* @param {boolean} [style.tagline] Used for indicating the tagline of the PayPal Button.
|
|
16
|
+
* @param {number} [message.amount] Used for indicating an amount before the payment.
|
|
17
|
+
* @param {'center'|'left'|'right'} [message.align] Used for indicating the align of the message.
|
|
18
|
+
* @param {'black'|'white'} [message.color] Used for indicating the color of the message.
|
|
19
|
+
* @param {'top'|'bottom'} [message.position] Used for indicating the position of the message.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Interface of possible error codes inside onError event data.
|
|
23
|
+
* @interface ErrorCodes
|
|
24
|
+
*
|
|
25
|
+
* @type {object}
|
|
26
|
+
* @param {string} [unavailable] Error code when an error occurs loading the widget.
|
|
27
|
+
* @param {string} [onPaypalVaultSetupTokenError] Error code when an error occrus on PayPal side.
|
|
28
|
+
* @param {string} [onGetIdTokenError] Error code when trying to get ID token from PayPal.
|
|
29
|
+
* @param {string} [onGetWalletConfigError] Error code when trying to get wallet config from Paydock.
|
|
30
|
+
* @param {string} [onGetSetupTokenError] Error code when trying to get the setup token from PayPal.
|
|
31
|
+
* @param {string} [onOneTimeTokenError] Error code when trying to get the one time token from Paydock.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Interface for IOnSuccessEventData
|
|
35
|
+
* @interface IOnSuccessEventData
|
|
36
|
+
*
|
|
37
|
+
* @type {object}
|
|
38
|
+
* @param {EVENTS} event - Event Name is 'ON_SUCCESS'
|
|
39
|
+
* @param {object} data Data object
|
|
40
|
+
* @param {string} data.token One Time Token to be exchanged for a Paydock Customer.
|
|
41
|
+
* @param {string} [data.email] Paypal account customer email if retrieved from Paypal servers.
|
|
42
|
+
**/
|
|
43
|
+
/**
|
|
44
|
+
* Interface for IOnErrorEventData
|
|
45
|
+
* @interface IOnErrorEventData
|
|
46
|
+
*
|
|
47
|
+
* @type {object}
|
|
48
|
+
* @param {EVENTS} event - Event Name is 'ON_ERROR'
|
|
49
|
+
* @param {object} data Error data object
|
|
50
|
+
* @param {ErrorCodes} data.error_code Error code. One of ErrorCodes.
|
|
51
|
+
* @param {string} [data.details] Error details.
|
|
52
|
+
* @param {string} [data.message] Error message.
|
|
53
|
+
**/
|
|
54
|
+
/**
|
|
55
|
+
* Interface for IOnCancelEventData
|
|
56
|
+
* @interface IOnCancelEventData
|
|
57
|
+
*
|
|
58
|
+
* @type {object}
|
|
59
|
+
* @param {EVENTS} event - Event Name is 'ON_CANCEL'
|
|
60
|
+
**/
|
|
61
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/paypal-save-payment-source/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAE7E;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;;;;;;GAWG;AAEH;;;;;;;;;IASI;AAEJ;;;;;;;;;;IAUI;AAEJ;;;;;;IAMI"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Container } from '../components/container';
|
|
2
|
+
import { EventEmitter } from '../helper/event-emitter';
|
|
3
|
+
import { type IOnCancelEventData, type IOnErrorEventData, type IOnSuccessEventData, type IPayPalSavePaymentSourceWidget, type PayPalSavePaymentSourceWidgetConfig } from './paypal-save-payment-source.interfaces';
|
|
4
|
+
/**
|
|
5
|
+
* PayPal Save Payment Source Widget constructor
|
|
6
|
+
*
|
|
7
|
+
* @param {string} selector - Selector of html element. Container for PayPal Save Payment Source Widget.
|
|
8
|
+
* @param {string} publicKey - PayDock users public key.
|
|
9
|
+
* @param {string} gatewayId - PayDock's PayPal gatewayId.
|
|
10
|
+
* @param {PayPalSavePaymentSourceWidgetConfig} config - Extra configuration for the widget, like styles.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* var payPalSavePaymentSourceWidget = new PayPalSavePaymentSourceWidget('#paypalButton', 'public_key', 'gateway_id');
|
|
14
|
+
*/
|
|
15
|
+
declare class PayPalSavePaymentSourceWidget {
|
|
16
|
+
protected container: Container;
|
|
17
|
+
protected service: IPayPalSavePaymentSourceWidget;
|
|
18
|
+
protected eventEmitter: EventEmitter;
|
|
19
|
+
/** @constructs */ constructor(selector: string, publicKey: string, gatewayId: string, config?: PayPalSavePaymentSourceWidgetConfig);
|
|
20
|
+
/**
|
|
21
|
+
* The final method after configuring the PayPalSavePaymentSource Widget to
|
|
22
|
+
* start the load process.
|
|
23
|
+
*/
|
|
24
|
+
load(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Current method can change environment. By default environment = sandbox.
|
|
27
|
+
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* payPalSavePaymentSourceWidget.setEnv('production');
|
|
31
|
+
* @param {string} env - sandbox, production
|
|
32
|
+
* @param {string} [alias] - Own domain alias
|
|
33
|
+
*/
|
|
34
|
+
setEnv(env: string, alias?: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* Callback for onSuccess method.
|
|
37
|
+
*
|
|
38
|
+
* @callback OnSuccessCallback
|
|
39
|
+
* @param {IOnSuccessEventData} data
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* If the setup token was successfully approved and a OTT was generated, the function passed as parameter will be called.
|
|
43
|
+
* Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* payPalSavePaymentSourceWidget.onSuccess((eventData) => console.log('One time token and email obtained successfully'));
|
|
47
|
+
*
|
|
48
|
+
* @param {OnSuccessCallback} [callback] - Function to be called when the result is successful.
|
|
49
|
+
*/
|
|
50
|
+
onSuccess(callback?: (data: IOnSuccessEventData) => void): () => void;
|
|
51
|
+
/**
|
|
52
|
+
* Callback for onError method.
|
|
53
|
+
*
|
|
54
|
+
* @callback OnErrorCallback
|
|
55
|
+
* @param {IOnErrorEventData} data
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* If in the process for obtaining the setup token fails, the function passed as parameter will be called.
|
|
59
|
+
* Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* payPalSavePaymentSourceWidget.onError((eventData) => console.log('Some error occurred'));
|
|
63
|
+
*
|
|
64
|
+
* @param {OnErrorCallback} [callback] - Function to be called when there is an error in the flow.
|
|
65
|
+
*/
|
|
66
|
+
onError(callback?: (data: IOnErrorEventData) => void): () => void;
|
|
67
|
+
/**
|
|
68
|
+
* Callback for onCancel method.
|
|
69
|
+
*
|
|
70
|
+
* @callback OnCancelCallback
|
|
71
|
+
* @param {IOnCancelEventData} data
|
|
72
|
+
*/
|
|
73
|
+
/**
|
|
74
|
+
* If in the process for obtaining the setup token was cancelled, the function passed as parameter will be called.
|
|
75
|
+
* Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* payPalSavePaymentSourceWidget.onCancel(() => console.log('Operation cancelled'));
|
|
79
|
+
*
|
|
80
|
+
* @param {OnCancelCallback} [callback] - Function to be called when the operation is cancelled.
|
|
81
|
+
*/
|
|
82
|
+
onCancel(callback?: (data?: IOnCancelEventData) => void): () => void;
|
|
83
|
+
}
|
|
84
|
+
export { PayPalSavePaymentSourceWidget };
|
|
85
|
+
//# sourceMappingURL=paypal-save-payment-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paypal-save-payment-source.d.ts","sourceRoot":"","sources":["../../src/paypal-save-payment-source/paypal-save-payment-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,EACnC,KAAK,mCAAmC,EACzC,MAAM,yCAAyC,CAAC;AAGjD;;;;;;;;;;GAUG;AACH,cAAM,6BAA6B;IACjC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;IAC/B,SAAS,CAAC,OAAO,EAAE,8BAA8B,CAAC;IAClD,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAErC,kBAAkB,aAEhB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,mCAAmC;IAY9C;;;OAGG;IACI,IAAI;IASX;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IAIzC;;;;;OAKG;IACH;;;;;;;;OAQG;IACI,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI;IAI/D;;;;;OAKG;IACH;;;;;;;;OAQG;IACI,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI;IAI3D;;;;;OAKG;IACH;;;;;;;;OAQG;IACI,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,KAAK,IAAI;CAG/D;AAED,OAAO,EAAE,6BAA6B,EAAE,CAAC"}
|