@yuno-payments/sdk-web-types 5.4.2 → 5.6.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 CHANGED
@@ -473,8 +473,34 @@ type CookieConfig = {
473
473
  };
474
474
  type CookiesConfig = Record<CookieKey, CookieConfig>;
475
475
  type InitializeOptions = {
476
- cookies: CookiesConfig | undefined;
476
+ cookies?: CookiesConfig;
477
477
  sdkType?: string;
478
+ /**
479
+ * Whitelabel override for every Yuno-hosted runtime URL the SDK reads
480
+ * from its environment (REST, payment/enrollment WebSockets, 3DS
481
+ * challenge/setup/event-origin, the SDK web bundle base, the card form,
482
+ * and the secure-field iframes). Path/query/hash/scheme of each URL are
483
+ * preserved; only the host (and ws↔wss) is swapped. The merchant-side
484
+ * gateway must therefore route every Yuno path under this single host.
485
+ *
486
+ * If `assetUrl` is unset, this also drives the lazy-chunk public path.
487
+ *
488
+ * @example 'https://payments.merchant.example.com'
489
+ */
490
+ apiUrl?: string;
491
+ /**
492
+ * Override for the lazy-chunk CDN base. When set, the SDK loads its lazy
493
+ * chunks from `${assetUrl}/v${MAJOR.MINOR}/`. Falls back to `apiUrl` when
494
+ * unset, so a merchant serving both backend and bundle from the same
495
+ * origin only needs `apiUrl`.
496
+ *
497
+ * The merchant CDN must mirror the `/v<MAJOR.MINOR>/` directory layout and
498
+ * serve the chunks with permissive CORS. If the value already ends with a
499
+ * `/v<x.y>` (or `/v<x.y.z>`) segment, it is used as-is.
500
+ *
501
+ * @example 'https://cdn.merchant.example.com/sdk'
502
+ */
503
+ assetUrl?: string;
478
504
  };
479
505
 
480
506
  type Status = 'FAIL' | 'REJECT' | 'SUCCEEDED' | 'PROCESSING' | 'READY';
@@ -758,10 +784,18 @@ declare namespace ExternalButtonsNameSpace {
758
784
  borderRadius?: number;
759
785
  locale?: string;
760
786
  };
787
+ type RevolutPayButtonConfig = {
788
+ variant?: 'dark' | 'light' | 'light-outlined';
789
+ size?: 'large' | 'small';
790
+ radius?: 'none' | 'small' | 'large' | 'round';
791
+ action?: 'pay' | 'buy' | 'donate' | 'subscribe';
792
+ locale?: string;
793
+ };
761
794
  type ExternalButtonsConfig = {
762
795
  googlePay?: GooglePayButtonConfig;
763
796
  applePay?: ApplePayButtonConfig;
764
797
  paypal?: PayPalButtonConfig;
798
+ revolutPay?: RevolutPayButtonConfig;
765
799
  };
766
800
  }
767
801
 
@@ -852,7 +886,7 @@ type ExternalProviderId = {
852
886
  provider_id: string;
853
887
  session_id: string;
854
888
  };
855
- interface YunoConfig {
889
+ interface SdkPaymentsConfig {
856
890
  publicApiKey: string;
857
891
  checkoutSession: string;
858
892
  customerSession: string;
@@ -880,19 +914,29 @@ interface YunoConfig {
880
914
  isDynamicViewEnabled?: boolean;
881
915
  showOnlyThesePaymentMethods?: string[];
882
916
  showPayButton?: boolean;
883
- yunoCreatePayment: (oneTimeToken: string, tokenWithInformation: OneTimeToken) => void;
884
- yunoPaymentMethodSelected?: (arg: {
917
+ createPayment?: (oneTimeToken: string, tokenWithInformation: OneTimeToken) => void;
918
+ /** @deprecated Since SDK v1.9.0. Use `createPayment` instead. Kept for backwards compatibility; will be removed in a future major version. */
919
+ yunoCreatePayment?: SdkPaymentsConfig["createPayment"];
920
+ paymentMethodSelected?: (arg: {
885
921
  type: string;
886
922
  name: string;
887
923
  }) => void;
888
- yunoPaymentResult?: (status: Status, subStatus?: string) => void;
889
- yunoError?: (message: string, data?: any) => void;
924
+ /** @deprecated Since SDK v1.9.0. Use `paymentMethodSelected` instead. Kept for backwards compatibility; will be removed in a future major version. */
925
+ yunoPaymentMethodSelected?: SdkPaymentsConfig["paymentMethodSelected"];
926
+ paymentResult?: (status: Status, subStatus?: string) => void;
927
+ /** @deprecated Since SDK v1.9.0. Use `paymentResult` instead. Kept for backwards compatibility; will be removed in a future major version. */
928
+ yunoPaymentResult?: SdkPaymentsConfig["paymentResult"];
929
+ error?: (message: string, data?: any) => void;
930
+ /** @deprecated Since SDK v1.9.0. Use `error` instead. Kept for backwards compatibility; will be removed in a future major version. */
931
+ yunoError?: SdkPaymentsConfig["error"];
890
932
  onRendered?(): void;
891
933
  onOneTimeTokenCreationStart?(): void;
892
- yunoEnrollmentStatus?(params: {
934
+ enrollmentStatus?(params: {
893
935
  status: EnrollmentStatus;
894
936
  vaultedToken?: string;
895
937
  }): void;
938
+ /** @deprecated Since SDK v1.9.0. Use `enrollmentStatus` instead. Kept for backwards compatibility; will be removed in a future major version. */
939
+ yunoEnrollmentStatus?: SdkPaymentsConfig["enrollmentStatus"];
896
940
  /**
897
941
  * @deprecated
898
942
  */
@@ -908,13 +952,19 @@ interface YunoConfig {
908
952
  };
909
953
  externalButtons?: ExternalButtonsNameSpace.ExternalButtonsConfig;
910
954
  }
911
- type StartCheckoutArgs = Omit<YunoConfig, "yunoEnrollmentStatus" | "customerSession" | "publicApiKey" | "card"> & {
955
+ /**
956
+ * @deprecated Since SDK v1.9.0. Use `SdkPaymentsConfig` instead. Kept for
957
+ * backwards compatibility; will be removed in a future major version.
958
+ */
959
+ interface YunoConfig extends SdkPaymentsConfig {
960
+ }
961
+ type StartCheckoutArgs = Omit<SdkPaymentsConfig, "enrollmentStatus" | "yunoEnrollmentStatus" | "customerSession" | "publicApiKey" | "card"> & {
912
962
  card?: CardConfig & {
913
963
  onChange?(args: OnChangeArgs): void;
914
964
  };
915
965
  };
916
- type MountEnrollmentLiteArgs = Pick<YunoConfig, "language" | "countryCode" | "renderMode" | "yunoEnrollmentStatus" | "yunoError" | "showLoading" | "onRendered" | "onOneTimeTokenCreationStart" | "onLoading" | "customerSession" | "showPaymentStatus">;
917
- type mountFraudArgs = Pick<YunoConfig, "yunoCreatePayment" | "yunoError" | "language" | "checkoutSession">;
966
+ type MountEnrollmentLiteArgs = Pick<SdkPaymentsConfig, "language" | "countryCode" | "renderMode" | "enrollmentStatus" | "yunoEnrollmentStatus" | "error" | "yunoError" | "showLoading" | "onRendered" | "onOneTimeTokenCreationStart" | "onLoading" | "customerSession" | "showPaymentStatus">;
967
+ type mountFraudArgs = Pick<SdkPaymentsConfig, "createPayment" | "yunoCreatePayment" | "error" | "yunoError" | "language" | "checkoutSession">;
918
968
  interface MountCheckoutLiteArgs {
919
969
  paymentMethodType: string;
920
970
  vaultedToken?: string;
@@ -937,8 +987,12 @@ interface MountStatusPaymentArgs {
937
987
  checkoutSession: string;
938
988
  language: Language;
939
989
  countryCode: string;
940
- yunoPaymentResult?: YunoConfig["yunoPaymentResult"];
941
- yunoError?: YunoConfig["yunoError"];
990
+ paymentResult?: SdkPaymentsConfig["paymentResult"];
991
+ /** @deprecated Since SDK v1.9.0. Use `paymentResult` instead. */
992
+ yunoPaymentResult?: SdkPaymentsConfig["paymentResult"];
993
+ error?: SdkPaymentsConfig["error"];
994
+ /** @deprecated Since SDK v1.9.0. Use `error` instead. */
995
+ yunoError?: SdkPaymentsConfig["error"];
942
996
  }
943
997
  type ContinuePaymentResponse = {
944
998
  action: "REDIRECT_URL";
@@ -955,7 +1009,7 @@ type ContinuePaymentArgs = {
955
1009
  */
956
1010
  showPaymentStatus?: boolean;
957
1011
  };
958
- type StartSeamlessCheckoutArgs = Omit<StartCheckoutArgs, "yunoCreatePayment">;
1012
+ type StartSeamlessCheckoutArgs = Omit<StartCheckoutArgs, "createPayment" | "yunoCreatePayment">;
959
1013
  type ShowLoaderOptions = {
960
1014
  onRendered?: () => void;
961
1015
  language?: string;
@@ -966,7 +1020,7 @@ type ExternalButton = {
966
1020
  checkoutSession?: string;
967
1021
  };
968
1022
  type MountSeamlessExternalButtonsArgs = ExternalButton[];
969
- interface YunoInstance extends ExternalButtonsNameSpace.ExternalButtonMethods {
1023
+ interface SdkPaymentsInstance extends ExternalButtonsNameSpace.ExternalButtonMethods {
970
1024
  startCheckout(args: StartCheckoutArgs): Promise<void>;
971
1025
  startSeamlessCheckout(args: StartSeamlessCheckoutArgs): Promise<void>;
972
1026
  mountCheckout(): Promise<void>;
@@ -994,8 +1048,20 @@ interface YunoInstance extends ExternalButtonsNameSpace.ExternalButtonMethods {
994
1048
  clickToPay: C2PHeadless.ClickToPayFn;
995
1049
  clearApiCache(): Promise<void>;
996
1050
  }
997
- interface Yuno {
998
- initialize(publicApiKey: string, applicationSession?: string, options?: InitializeOptions): Promise<YunoInstance>;
1051
+ /**
1052
+ * @deprecated Since SDK v1.9.0. Use `SdkPaymentsInstance` instead. Kept for
1053
+ * backwards compatibility; will be removed in a future major version.
1054
+ */
1055
+ interface YunoInstance extends SdkPaymentsInstance {
1056
+ }
1057
+ interface SdkPayments {
1058
+ initialize(publicApiKey: string, applicationSession?: string, options?: InitializeOptions): Promise<SdkPaymentsInstance>;
1059
+ }
1060
+ /**
1061
+ * @deprecated Since SDK v1.9.0. Use `SdkPayments` instead. Kept for backwards
1062
+ * compatibility with existing integrations (`window.Yuno`); will be removed in a future major version.
1063
+ */
1064
+ interface Yuno extends SdkPayments {
999
1065
  }
1000
1066
 
1001
1067
  declare const Yuno: Yuno;
package/dist/index.d.ts CHANGED
@@ -473,8 +473,34 @@ type CookieConfig = {
473
473
  };
474
474
  type CookiesConfig = Record<CookieKey, CookieConfig>;
475
475
  type InitializeOptions = {
476
- cookies: CookiesConfig | undefined;
476
+ cookies?: CookiesConfig;
477
477
  sdkType?: string;
478
+ /**
479
+ * Whitelabel override for every Yuno-hosted runtime URL the SDK reads
480
+ * from its environment (REST, payment/enrollment WebSockets, 3DS
481
+ * challenge/setup/event-origin, the SDK web bundle base, the card form,
482
+ * and the secure-field iframes). Path/query/hash/scheme of each URL are
483
+ * preserved; only the host (and ws↔wss) is swapped. The merchant-side
484
+ * gateway must therefore route every Yuno path under this single host.
485
+ *
486
+ * If `assetUrl` is unset, this also drives the lazy-chunk public path.
487
+ *
488
+ * @example 'https://payments.merchant.example.com'
489
+ */
490
+ apiUrl?: string;
491
+ /**
492
+ * Override for the lazy-chunk CDN base. When set, the SDK loads its lazy
493
+ * chunks from `${assetUrl}/v${MAJOR.MINOR}/`. Falls back to `apiUrl` when
494
+ * unset, so a merchant serving both backend and bundle from the same
495
+ * origin only needs `apiUrl`.
496
+ *
497
+ * The merchant CDN must mirror the `/v<MAJOR.MINOR>/` directory layout and
498
+ * serve the chunks with permissive CORS. If the value already ends with a
499
+ * `/v<x.y>` (or `/v<x.y.z>`) segment, it is used as-is.
500
+ *
501
+ * @example 'https://cdn.merchant.example.com/sdk'
502
+ */
503
+ assetUrl?: string;
478
504
  };
479
505
 
480
506
  type Status = 'FAIL' | 'REJECT' | 'SUCCEEDED' | 'PROCESSING' | 'READY';
@@ -758,10 +784,18 @@ declare namespace ExternalButtonsNameSpace {
758
784
  borderRadius?: number;
759
785
  locale?: string;
760
786
  };
787
+ type RevolutPayButtonConfig = {
788
+ variant?: 'dark' | 'light' | 'light-outlined';
789
+ size?: 'large' | 'small';
790
+ radius?: 'none' | 'small' | 'large' | 'round';
791
+ action?: 'pay' | 'buy' | 'donate' | 'subscribe';
792
+ locale?: string;
793
+ };
761
794
  type ExternalButtonsConfig = {
762
795
  googlePay?: GooglePayButtonConfig;
763
796
  applePay?: ApplePayButtonConfig;
764
797
  paypal?: PayPalButtonConfig;
798
+ revolutPay?: RevolutPayButtonConfig;
765
799
  };
766
800
  }
767
801
 
@@ -852,7 +886,7 @@ type ExternalProviderId = {
852
886
  provider_id: string;
853
887
  session_id: string;
854
888
  };
855
- interface YunoConfig {
889
+ interface SdkPaymentsConfig {
856
890
  publicApiKey: string;
857
891
  checkoutSession: string;
858
892
  customerSession: string;
@@ -880,19 +914,29 @@ interface YunoConfig {
880
914
  isDynamicViewEnabled?: boolean;
881
915
  showOnlyThesePaymentMethods?: string[];
882
916
  showPayButton?: boolean;
883
- yunoCreatePayment: (oneTimeToken: string, tokenWithInformation: OneTimeToken) => void;
884
- yunoPaymentMethodSelected?: (arg: {
917
+ createPayment?: (oneTimeToken: string, tokenWithInformation: OneTimeToken) => void;
918
+ /** @deprecated Since SDK v1.9.0. Use `createPayment` instead. Kept for backwards compatibility; will be removed in a future major version. */
919
+ yunoCreatePayment?: SdkPaymentsConfig["createPayment"];
920
+ paymentMethodSelected?: (arg: {
885
921
  type: string;
886
922
  name: string;
887
923
  }) => void;
888
- yunoPaymentResult?: (status: Status, subStatus?: string) => void;
889
- yunoError?: (message: string, data?: any) => void;
924
+ /** @deprecated Since SDK v1.9.0. Use `paymentMethodSelected` instead. Kept for backwards compatibility; will be removed in a future major version. */
925
+ yunoPaymentMethodSelected?: SdkPaymentsConfig["paymentMethodSelected"];
926
+ paymentResult?: (status: Status, subStatus?: string) => void;
927
+ /** @deprecated Since SDK v1.9.0. Use `paymentResult` instead. Kept for backwards compatibility; will be removed in a future major version. */
928
+ yunoPaymentResult?: SdkPaymentsConfig["paymentResult"];
929
+ error?: (message: string, data?: any) => void;
930
+ /** @deprecated Since SDK v1.9.0. Use `error` instead. Kept for backwards compatibility; will be removed in a future major version. */
931
+ yunoError?: SdkPaymentsConfig["error"];
890
932
  onRendered?(): void;
891
933
  onOneTimeTokenCreationStart?(): void;
892
- yunoEnrollmentStatus?(params: {
934
+ enrollmentStatus?(params: {
893
935
  status: EnrollmentStatus;
894
936
  vaultedToken?: string;
895
937
  }): void;
938
+ /** @deprecated Since SDK v1.9.0. Use `enrollmentStatus` instead. Kept for backwards compatibility; will be removed in a future major version. */
939
+ yunoEnrollmentStatus?: SdkPaymentsConfig["enrollmentStatus"];
896
940
  /**
897
941
  * @deprecated
898
942
  */
@@ -908,13 +952,19 @@ interface YunoConfig {
908
952
  };
909
953
  externalButtons?: ExternalButtonsNameSpace.ExternalButtonsConfig;
910
954
  }
911
- type StartCheckoutArgs = Omit<YunoConfig, "yunoEnrollmentStatus" | "customerSession" | "publicApiKey" | "card"> & {
955
+ /**
956
+ * @deprecated Since SDK v1.9.0. Use `SdkPaymentsConfig` instead. Kept for
957
+ * backwards compatibility; will be removed in a future major version.
958
+ */
959
+ interface YunoConfig extends SdkPaymentsConfig {
960
+ }
961
+ type StartCheckoutArgs = Omit<SdkPaymentsConfig, "enrollmentStatus" | "yunoEnrollmentStatus" | "customerSession" | "publicApiKey" | "card"> & {
912
962
  card?: CardConfig & {
913
963
  onChange?(args: OnChangeArgs): void;
914
964
  };
915
965
  };
916
- type MountEnrollmentLiteArgs = Pick<YunoConfig, "language" | "countryCode" | "renderMode" | "yunoEnrollmentStatus" | "yunoError" | "showLoading" | "onRendered" | "onOneTimeTokenCreationStart" | "onLoading" | "customerSession" | "showPaymentStatus">;
917
- type mountFraudArgs = Pick<YunoConfig, "yunoCreatePayment" | "yunoError" | "language" | "checkoutSession">;
966
+ type MountEnrollmentLiteArgs = Pick<SdkPaymentsConfig, "language" | "countryCode" | "renderMode" | "enrollmentStatus" | "yunoEnrollmentStatus" | "error" | "yunoError" | "showLoading" | "onRendered" | "onOneTimeTokenCreationStart" | "onLoading" | "customerSession" | "showPaymentStatus">;
967
+ type mountFraudArgs = Pick<SdkPaymentsConfig, "createPayment" | "yunoCreatePayment" | "error" | "yunoError" | "language" | "checkoutSession">;
918
968
  interface MountCheckoutLiteArgs {
919
969
  paymentMethodType: string;
920
970
  vaultedToken?: string;
@@ -937,8 +987,12 @@ interface MountStatusPaymentArgs {
937
987
  checkoutSession: string;
938
988
  language: Language;
939
989
  countryCode: string;
940
- yunoPaymentResult?: YunoConfig["yunoPaymentResult"];
941
- yunoError?: YunoConfig["yunoError"];
990
+ paymentResult?: SdkPaymentsConfig["paymentResult"];
991
+ /** @deprecated Since SDK v1.9.0. Use `paymentResult` instead. */
992
+ yunoPaymentResult?: SdkPaymentsConfig["paymentResult"];
993
+ error?: SdkPaymentsConfig["error"];
994
+ /** @deprecated Since SDK v1.9.0. Use `error` instead. */
995
+ yunoError?: SdkPaymentsConfig["error"];
942
996
  }
943
997
  type ContinuePaymentResponse = {
944
998
  action: "REDIRECT_URL";
@@ -955,7 +1009,7 @@ type ContinuePaymentArgs = {
955
1009
  */
956
1010
  showPaymentStatus?: boolean;
957
1011
  };
958
- type StartSeamlessCheckoutArgs = Omit<StartCheckoutArgs, "yunoCreatePayment">;
1012
+ type StartSeamlessCheckoutArgs = Omit<StartCheckoutArgs, "createPayment" | "yunoCreatePayment">;
959
1013
  type ShowLoaderOptions = {
960
1014
  onRendered?: () => void;
961
1015
  language?: string;
@@ -966,7 +1020,7 @@ type ExternalButton = {
966
1020
  checkoutSession?: string;
967
1021
  };
968
1022
  type MountSeamlessExternalButtonsArgs = ExternalButton[];
969
- interface YunoInstance extends ExternalButtonsNameSpace.ExternalButtonMethods {
1023
+ interface SdkPaymentsInstance extends ExternalButtonsNameSpace.ExternalButtonMethods {
970
1024
  startCheckout(args: StartCheckoutArgs): Promise<void>;
971
1025
  startSeamlessCheckout(args: StartSeamlessCheckoutArgs): Promise<void>;
972
1026
  mountCheckout(): Promise<void>;
@@ -994,8 +1048,20 @@ interface YunoInstance extends ExternalButtonsNameSpace.ExternalButtonMethods {
994
1048
  clickToPay: C2PHeadless.ClickToPayFn;
995
1049
  clearApiCache(): Promise<void>;
996
1050
  }
997
- interface Yuno {
998
- initialize(publicApiKey: string, applicationSession?: string, options?: InitializeOptions): Promise<YunoInstance>;
1051
+ /**
1052
+ * @deprecated Since SDK v1.9.0. Use `SdkPaymentsInstance` instead. Kept for
1053
+ * backwards compatibility; will be removed in a future major version.
1054
+ */
1055
+ interface YunoInstance extends SdkPaymentsInstance {
1056
+ }
1057
+ interface SdkPayments {
1058
+ initialize(publicApiKey: string, applicationSession?: string, options?: InitializeOptions): Promise<SdkPaymentsInstance>;
1059
+ }
1060
+ /**
1061
+ * @deprecated Since SDK v1.9.0. Use `SdkPayments` instead. Kept for backwards
1062
+ * compatibility with existing integrations (`window.Yuno`); will be removed in a future major version.
1063
+ */
1064
+ interface Yuno extends SdkPayments {
999
1065
  }
1000
1066
 
1001
- 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 SecureFieldInstance, type SecureFieldsArgs, type StartCheckoutArgs, type StartSeamlessCheckoutArgs, type TextsCustom, type Yuno, type YunoConfig, type YunoInstance, type mountFraudArgs };
1067
+ 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuno-payments/sdk-web-types",
3
- "version": "5.4.2",
3
+ "version": "5.6.0",
4
4
  "types": "dist/index.d.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {