@yuno-payments/sdk-web-types 5.7.1-CORECM-17780.1 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/global.d.ts +63 -19
- package/dist/index.d.ts +64 -20
- package/package.json +2 -2
package/dist/global.d.ts
CHANGED
|
@@ -746,6 +746,59 @@ interface SecureFields {
|
|
|
746
746
|
}
|
|
747
747
|
|
|
748
748
|
declare namespace ExternalButtonsNameSpace {
|
|
749
|
+
type PaypalBraintreeButtonStyleConfig = {
|
|
750
|
+
type?: 'pay' | 'checkout' | 'buynow' | 'subscribe';
|
|
751
|
+
color?: 'gold' | 'blue' | 'white';
|
|
752
|
+
borderRadius?: number;
|
|
753
|
+
height?: number;
|
|
754
|
+
width?: number;
|
|
755
|
+
};
|
|
756
|
+
type ShippingAddressOverride = {
|
|
757
|
+
line1: string;
|
|
758
|
+
line2?: string;
|
|
759
|
+
city: string;
|
|
760
|
+
state: string;
|
|
761
|
+
postalCode: string;
|
|
762
|
+
countryCode: string;
|
|
763
|
+
phone?: string;
|
|
764
|
+
recipientName?: string;
|
|
765
|
+
recipientEmail?: string;
|
|
766
|
+
};
|
|
767
|
+
type GetShippingAddressOverride = () => ShippingAddressOverride | undefined;
|
|
768
|
+
type ShippingAddress = {
|
|
769
|
+
city: string;
|
|
770
|
+
state: string;
|
|
771
|
+
postalCode: string;
|
|
772
|
+
countryCode: string;
|
|
773
|
+
};
|
|
774
|
+
type OnShippingAddressChangeArgs = {
|
|
775
|
+
shippingAddress: ShippingAddress;
|
|
776
|
+
paypalOrderId: string;
|
|
777
|
+
};
|
|
778
|
+
type AmountBreakdown = {
|
|
779
|
+
itemTotal: string;
|
|
780
|
+
shipping?: string;
|
|
781
|
+
tax?: string;
|
|
782
|
+
};
|
|
783
|
+
type ShippingAddressUpdatePrice = {
|
|
784
|
+
action: 'UPDATE_PRICE';
|
|
785
|
+
amount: string;
|
|
786
|
+
breakdown?: AmountBreakdown;
|
|
787
|
+
};
|
|
788
|
+
type ShippingAddressAccept = {
|
|
789
|
+
action: 'ACCEPT';
|
|
790
|
+
};
|
|
791
|
+
type ShippingAddressReject = {
|
|
792
|
+
action: 'REJECT';
|
|
793
|
+
reason?: 'COUNTRY' | 'STATE' | 'POSTAL_CODE' | 'ADDRESS';
|
|
794
|
+
};
|
|
795
|
+
type ShippingAddressChangeResult = ShippingAddressUpdatePrice | ShippingAddressAccept | ShippingAddressReject;
|
|
796
|
+
type OnShippingAddressChange = (args: OnShippingAddressChangeArgs) => Promise<ShippingAddressChangeResult>;
|
|
797
|
+
type PaypalBraintreeButtonConfig = {
|
|
798
|
+
style?: PaypalBraintreeButtonStyleConfig;
|
|
799
|
+
shippingAddressOverride?: GetShippingAddressOverride;
|
|
800
|
+
onShippingAddressChange?: OnShippingAddressChange;
|
|
801
|
+
};
|
|
749
802
|
type ExternalButton = {
|
|
750
803
|
elementSelector: string;
|
|
751
804
|
paymentMethodType: string;
|
|
@@ -796,6 +849,7 @@ declare namespace ExternalButtonsNameSpace {
|
|
|
796
849
|
applePay?: ApplePayButtonConfig;
|
|
797
850
|
paypal?: PayPalButtonConfig;
|
|
798
851
|
revolutPay?: RevolutPayButtonConfig;
|
|
852
|
+
paypalBraintree?: PaypalBraintreeButtonConfig;
|
|
799
853
|
};
|
|
800
854
|
}
|
|
801
855
|
|
|
@@ -995,31 +1049,21 @@ interface MountStatusPaymentArgs {
|
|
|
995
1049
|
yunoError?: SdkPaymentsConfig["error"];
|
|
996
1050
|
}
|
|
997
1051
|
type ContinuePaymentResponse = {
|
|
998
|
-
/**
|
|
999
|
-
* Redirect handed back to the integrator (`open_external_browser`):
|
|
1000
|
-
* the SDK does NOT navigate in this case.
|
|
1001
|
-
*/
|
|
1002
|
-
action: "REDIRECT_URL";
|
|
1003
1052
|
type: string;
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1053
|
+
action: string;
|
|
1054
|
+
redirect_url?: {
|
|
1055
|
+
init_url?: string;
|
|
1056
|
+
success_url?: string;
|
|
1057
|
+
error_url?: string;
|
|
1008
1058
|
};
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
* In-page navigation redirect: the SDK navigates (window.location or
|
|
1012
|
-
* form POST) right after resolving. Integrators can keep their own
|
|
1013
|
-
* loader visible until the navigation commits.
|
|
1014
|
-
*/
|
|
1015
|
-
action: "REDIRECT_URL" | "THREE_D_SECURE_REDIRECT_URL";
|
|
1016
|
-
type: string;
|
|
1017
|
-
} | null;
|
|
1059
|
+
};
|
|
1060
|
+
type OnActionExecuted = (result: ContinuePaymentResponse) => void;
|
|
1018
1061
|
type ContinuePaymentArgs = {
|
|
1019
1062
|
/**
|
|
1020
1063
|
* @default true
|
|
1021
1064
|
*/
|
|
1022
1065
|
showPaymentStatus?: boolean;
|
|
1066
|
+
onActionExecuted?: OnActionExecuted;
|
|
1023
1067
|
};
|
|
1024
1068
|
type StartSeamlessCheckoutArgs = Omit<StartCheckoutArgs, "createPayment" | "yunoCreatePayment">;
|
|
1025
1069
|
type ShowLoaderOptions = {
|
|
@@ -1045,7 +1089,7 @@ interface SdkPaymentsInstance extends ExternalButtonsNameSpace.ExternalButtonMet
|
|
|
1045
1089
|
updateCheckoutSession(checkout: string): Promise<void>;
|
|
1046
1090
|
submitOneTimeTokenForm(): Promise<void>;
|
|
1047
1091
|
startPayment(): Promise<void>;
|
|
1048
|
-
continuePayment(args?: ContinuePaymentArgs): Promise<ContinuePaymentResponse>;
|
|
1092
|
+
continuePayment(args?: ContinuePaymentArgs): Promise<ContinuePaymentResponse | null>;
|
|
1049
1093
|
notifyError(): Promise<void>;
|
|
1050
1094
|
mountEnrollmentLite(args: MountEnrollmentLiteArgs): Promise<void>;
|
|
1051
1095
|
showLoader(args?: ShowLoaderOptions): Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -746,6 +746,59 @@ interface SecureFields {
|
|
|
746
746
|
}
|
|
747
747
|
|
|
748
748
|
declare namespace ExternalButtonsNameSpace {
|
|
749
|
+
type PaypalBraintreeButtonStyleConfig = {
|
|
750
|
+
type?: 'pay' | 'checkout' | 'buynow' | 'subscribe';
|
|
751
|
+
color?: 'gold' | 'blue' | 'white';
|
|
752
|
+
borderRadius?: number;
|
|
753
|
+
height?: number;
|
|
754
|
+
width?: number;
|
|
755
|
+
};
|
|
756
|
+
type ShippingAddressOverride = {
|
|
757
|
+
line1: string;
|
|
758
|
+
line2?: string;
|
|
759
|
+
city: string;
|
|
760
|
+
state: string;
|
|
761
|
+
postalCode: string;
|
|
762
|
+
countryCode: string;
|
|
763
|
+
phone?: string;
|
|
764
|
+
recipientName?: string;
|
|
765
|
+
recipientEmail?: string;
|
|
766
|
+
};
|
|
767
|
+
type GetShippingAddressOverride = () => ShippingAddressOverride | undefined;
|
|
768
|
+
type ShippingAddress = {
|
|
769
|
+
city: string;
|
|
770
|
+
state: string;
|
|
771
|
+
postalCode: string;
|
|
772
|
+
countryCode: string;
|
|
773
|
+
};
|
|
774
|
+
type OnShippingAddressChangeArgs = {
|
|
775
|
+
shippingAddress: ShippingAddress;
|
|
776
|
+
paypalOrderId: string;
|
|
777
|
+
};
|
|
778
|
+
type AmountBreakdown = {
|
|
779
|
+
itemTotal: string;
|
|
780
|
+
shipping?: string;
|
|
781
|
+
tax?: string;
|
|
782
|
+
};
|
|
783
|
+
type ShippingAddressUpdatePrice = {
|
|
784
|
+
action: 'UPDATE_PRICE';
|
|
785
|
+
amount: string;
|
|
786
|
+
breakdown?: AmountBreakdown;
|
|
787
|
+
};
|
|
788
|
+
type ShippingAddressAccept = {
|
|
789
|
+
action: 'ACCEPT';
|
|
790
|
+
};
|
|
791
|
+
type ShippingAddressReject = {
|
|
792
|
+
action: 'REJECT';
|
|
793
|
+
reason?: 'COUNTRY' | 'STATE' | 'POSTAL_CODE' | 'ADDRESS';
|
|
794
|
+
};
|
|
795
|
+
type ShippingAddressChangeResult = ShippingAddressUpdatePrice | ShippingAddressAccept | ShippingAddressReject;
|
|
796
|
+
type OnShippingAddressChange = (args: OnShippingAddressChangeArgs) => Promise<ShippingAddressChangeResult>;
|
|
797
|
+
type PaypalBraintreeButtonConfig = {
|
|
798
|
+
style?: PaypalBraintreeButtonStyleConfig;
|
|
799
|
+
shippingAddressOverride?: GetShippingAddressOverride;
|
|
800
|
+
onShippingAddressChange?: OnShippingAddressChange;
|
|
801
|
+
};
|
|
749
802
|
type ExternalButton = {
|
|
750
803
|
elementSelector: string;
|
|
751
804
|
paymentMethodType: string;
|
|
@@ -796,6 +849,7 @@ declare namespace ExternalButtonsNameSpace {
|
|
|
796
849
|
applePay?: ApplePayButtonConfig;
|
|
797
850
|
paypal?: PayPalButtonConfig;
|
|
798
851
|
revolutPay?: RevolutPayButtonConfig;
|
|
852
|
+
paypalBraintree?: PaypalBraintreeButtonConfig;
|
|
799
853
|
};
|
|
800
854
|
}
|
|
801
855
|
|
|
@@ -995,31 +1049,21 @@ interface MountStatusPaymentArgs {
|
|
|
995
1049
|
yunoError?: SdkPaymentsConfig["error"];
|
|
996
1050
|
}
|
|
997
1051
|
type ContinuePaymentResponse = {
|
|
998
|
-
/**
|
|
999
|
-
* Redirect handed back to the integrator (`open_external_browser`):
|
|
1000
|
-
* the SDK does NOT navigate in this case.
|
|
1001
|
-
*/
|
|
1002
|
-
action: "REDIRECT_URL";
|
|
1003
1052
|
type: string;
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1053
|
+
action: string;
|
|
1054
|
+
redirect_url?: {
|
|
1055
|
+
init_url?: string;
|
|
1056
|
+
success_url?: string;
|
|
1057
|
+
error_url?: string;
|
|
1008
1058
|
};
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
* In-page navigation redirect: the SDK navigates (window.location or
|
|
1012
|
-
* form POST) right after resolving. Integrators can keep their own
|
|
1013
|
-
* loader visible until the navigation commits.
|
|
1014
|
-
*/
|
|
1015
|
-
action: "REDIRECT_URL" | "THREE_D_SECURE_REDIRECT_URL";
|
|
1016
|
-
type: string;
|
|
1017
|
-
} | null;
|
|
1059
|
+
};
|
|
1060
|
+
type OnActionExecuted = (result: ContinuePaymentResponse) => void;
|
|
1018
1061
|
type ContinuePaymentArgs = {
|
|
1019
1062
|
/**
|
|
1020
1063
|
* @default true
|
|
1021
1064
|
*/
|
|
1022
1065
|
showPaymentStatus?: boolean;
|
|
1066
|
+
onActionExecuted?: OnActionExecuted;
|
|
1023
1067
|
};
|
|
1024
1068
|
type StartSeamlessCheckoutArgs = Omit<StartCheckoutArgs, "createPayment" | "yunoCreatePayment">;
|
|
1025
1069
|
type ShowLoaderOptions = {
|
|
@@ -1045,7 +1089,7 @@ interface SdkPaymentsInstance extends ExternalButtonsNameSpace.ExternalButtonMet
|
|
|
1045
1089
|
updateCheckoutSession(checkout: string): Promise<void>;
|
|
1046
1090
|
submitOneTimeTokenForm(): Promise<void>;
|
|
1047
1091
|
startPayment(): Promise<void>;
|
|
1048
|
-
continuePayment(args?: ContinuePaymentArgs): Promise<ContinuePaymentResponse>;
|
|
1092
|
+
continuePayment(args?: ContinuePaymentArgs): Promise<ContinuePaymentResponse | null>;
|
|
1049
1093
|
notifyError(): Promise<void>;
|
|
1050
1094
|
mountEnrollmentLite(args: MountEnrollmentLiteArgs): Promise<void>;
|
|
1051
1095
|
showLoader(args?: ShowLoaderOptions): Promise<void>;
|
|
@@ -1076,4 +1120,4 @@ interface SdkPayments {
|
|
|
1076
1120
|
interface Yuno extends SdkPayments {
|
|
1077
1121
|
}
|
|
1078
1122
|
|
|
1079
|
-
export { type ButtonTextCard, C2PHeadless, type CardConfig, type ContinuePaymentArgs, type ContinuePaymentResponse, type CreateArgsSF, type ExternalButton, type ExternalPaymentButtons, ExternalPaymentButtonsTypes, type ExternalProviderId, type Font, type FormElementSelector, type Language, type LoadingType, type MountCheckoutLiteArgs, type MountEnrollmentLiteArgs, type MountSeamlessCheckoutLiteArgs, type MountSeamlessExternalButtonsArgs, type MountStatusPaymentArgs, type OnChangeDataSF, type RenderMode, type SdkPayments, type SdkPaymentsConfig, type SdkPaymentsInstance, type SecureFieldInstance, type SecureFieldsArgs, type StartCheckoutArgs, type StartSeamlessCheckoutArgs, type TextsCustom, type Yuno, type YunoConfig, type YunoInstance, type mountFraudArgs };
|
|
1123
|
+
export { type ButtonTextCard, C2PHeadless, type CardConfig, type ContinuePaymentArgs, type ContinuePaymentResponse, type CreateArgsSF, type ExternalButton, type ExternalPaymentButtons, ExternalPaymentButtonsTypes, type ExternalProviderId, type Font, type FormElementSelector, type Language, type LoadingType, type MountCheckoutLiteArgs, type MountEnrollmentLiteArgs, type MountSeamlessCheckoutLiteArgs, type MountSeamlessExternalButtonsArgs, type MountStatusPaymentArgs, type OnActionExecuted, type OnChangeDataSF, type RenderMode, type SdkPayments, type SdkPaymentsConfig, type SdkPaymentsInstance, type SecureFieldInstance, type SecureFieldsArgs, type StartCheckoutArgs, type StartSeamlessCheckoutArgs, type TextsCustom, type Yuno, type YunoConfig, type YunoInstance, type mountFraudArgs };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuno-payments/sdk-web-types",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.0",
|
|
4
4
|
"types": "dist/index.d.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
"rollup-plugin-dts": "^6.1.1",
|
|
23
23
|
"typescript": "^5.2.2"
|
|
24
24
|
}
|
|
25
|
-
}
|
|
25
|
+
}
|