@yuno-payments/sdk-web-types 5.4.1 → 5.5.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';
@@ -852,7 +878,7 @@ type ExternalProviderId = {
852
878
  provider_id: string;
853
879
  session_id: string;
854
880
  };
855
- interface YunoConfig {
881
+ interface SdkPaymentsConfig {
856
882
  publicApiKey: string;
857
883
  checkoutSession: string;
858
884
  customerSession: string;
@@ -880,19 +906,29 @@ interface YunoConfig {
880
906
  isDynamicViewEnabled?: boolean;
881
907
  showOnlyThesePaymentMethods?: string[];
882
908
  showPayButton?: boolean;
883
- yunoCreatePayment: (oneTimeToken: string, tokenWithInformation: OneTimeToken) => void;
884
- yunoPaymentMethodSelected?: (arg: {
909
+ createPayment?: (oneTimeToken: string, tokenWithInformation: OneTimeToken) => void;
910
+ /** @deprecated Since SDK v1.9.0. Use `createPayment` instead. Kept for backwards compatibility; will be removed in a future major version. */
911
+ yunoCreatePayment?: SdkPaymentsConfig["createPayment"];
912
+ paymentMethodSelected?: (arg: {
885
913
  type: string;
886
914
  name: string;
887
915
  }) => void;
888
- yunoPaymentResult?: (status: Status) => void;
889
- yunoError?: (message: string, data?: any) => void;
916
+ /** @deprecated Since SDK v1.9.0. Use `paymentMethodSelected` instead. Kept for backwards compatibility; will be removed in a future major version. */
917
+ yunoPaymentMethodSelected?: SdkPaymentsConfig["paymentMethodSelected"];
918
+ paymentResult?: (status: Status, subStatus?: string) => void;
919
+ /** @deprecated Since SDK v1.9.0. Use `paymentResult` instead. Kept for backwards compatibility; will be removed in a future major version. */
920
+ yunoPaymentResult?: SdkPaymentsConfig["paymentResult"];
921
+ error?: (message: string, data?: any) => void;
922
+ /** @deprecated Since SDK v1.9.0. Use `error` instead. Kept for backwards compatibility; will be removed in a future major version. */
923
+ yunoError?: SdkPaymentsConfig["error"];
890
924
  onRendered?(): void;
891
925
  onOneTimeTokenCreationStart?(): void;
892
- yunoEnrollmentStatus?(params: {
926
+ enrollmentStatus?(params: {
893
927
  status: EnrollmentStatus;
894
928
  vaultedToken?: string;
895
929
  }): void;
930
+ /** @deprecated Since SDK v1.9.0. Use `enrollmentStatus` instead. Kept for backwards compatibility; will be removed in a future major version. */
931
+ yunoEnrollmentStatus?: SdkPaymentsConfig["enrollmentStatus"];
896
932
  /**
897
933
  * @deprecated
898
934
  */
@@ -908,13 +944,19 @@ interface YunoConfig {
908
944
  };
909
945
  externalButtons?: ExternalButtonsNameSpace.ExternalButtonsConfig;
910
946
  }
911
- type StartCheckoutArgs = Omit<YunoConfig, "yunoEnrollmentStatus" | "customerSession" | "publicApiKey" | "card"> & {
947
+ /**
948
+ * @deprecated Since SDK v1.9.0. Use `SdkPaymentsConfig` instead. Kept for
949
+ * backwards compatibility; will be removed in a future major version.
950
+ */
951
+ interface YunoConfig extends SdkPaymentsConfig {
952
+ }
953
+ type StartCheckoutArgs = Omit<SdkPaymentsConfig, "enrollmentStatus" | "yunoEnrollmentStatus" | "customerSession" | "publicApiKey" | "card"> & {
912
954
  card?: CardConfig & {
913
955
  onChange?(args: OnChangeArgs): void;
914
956
  };
915
957
  };
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">;
958
+ type MountEnrollmentLiteArgs = Pick<SdkPaymentsConfig, "language" | "countryCode" | "renderMode" | "enrollmentStatus" | "yunoEnrollmentStatus" | "error" | "yunoError" | "showLoading" | "onRendered" | "onOneTimeTokenCreationStart" | "onLoading" | "customerSession" | "showPaymentStatus">;
959
+ type mountFraudArgs = Pick<SdkPaymentsConfig, "createPayment" | "yunoCreatePayment" | "error" | "yunoError" | "language" | "checkoutSession">;
918
960
  interface MountCheckoutLiteArgs {
919
961
  paymentMethodType: string;
920
962
  vaultedToken?: string;
@@ -937,8 +979,12 @@ interface MountStatusPaymentArgs {
937
979
  checkoutSession: string;
938
980
  language: Language;
939
981
  countryCode: string;
940
- yunoPaymentResult?: YunoConfig["yunoPaymentResult"];
941
- yunoError?: YunoConfig["yunoError"];
982
+ paymentResult?: SdkPaymentsConfig["paymentResult"];
983
+ /** @deprecated Since SDK v1.9.0. Use `paymentResult` instead. */
984
+ yunoPaymentResult?: SdkPaymentsConfig["paymentResult"];
985
+ error?: SdkPaymentsConfig["error"];
986
+ /** @deprecated Since SDK v1.9.0. Use `error` instead. */
987
+ yunoError?: SdkPaymentsConfig["error"];
942
988
  }
943
989
  type ContinuePaymentResponse = {
944
990
  action: "REDIRECT_URL";
@@ -955,7 +1001,7 @@ type ContinuePaymentArgs = {
955
1001
  */
956
1002
  showPaymentStatus?: boolean;
957
1003
  };
958
- type StartSeamlessCheckoutArgs = Omit<StartCheckoutArgs, "yunoCreatePayment">;
1004
+ type StartSeamlessCheckoutArgs = Omit<StartCheckoutArgs, "createPayment" | "yunoCreatePayment">;
959
1005
  type ShowLoaderOptions = {
960
1006
  onRendered?: () => void;
961
1007
  language?: string;
@@ -966,7 +1012,7 @@ type ExternalButton = {
966
1012
  checkoutSession?: string;
967
1013
  };
968
1014
  type MountSeamlessExternalButtonsArgs = ExternalButton[];
969
- interface YunoInstance extends ExternalButtonsNameSpace.ExternalButtonMethods {
1015
+ interface SdkPaymentsInstance extends ExternalButtonsNameSpace.ExternalButtonMethods {
970
1016
  startCheckout(args: StartCheckoutArgs): Promise<void>;
971
1017
  startSeamlessCheckout(args: StartSeamlessCheckoutArgs): Promise<void>;
972
1018
  mountCheckout(): Promise<void>;
@@ -994,8 +1040,20 @@ interface YunoInstance extends ExternalButtonsNameSpace.ExternalButtonMethods {
994
1040
  clickToPay: C2PHeadless.ClickToPayFn;
995
1041
  clearApiCache(): Promise<void>;
996
1042
  }
997
- interface Yuno {
998
- initialize(publicApiKey: string, applicationSession?: string, options?: InitializeOptions): Promise<YunoInstance>;
1043
+ /**
1044
+ * @deprecated Since SDK v1.9.0. Use `SdkPaymentsInstance` instead. Kept for
1045
+ * backwards compatibility; will be removed in a future major version.
1046
+ */
1047
+ interface YunoInstance extends SdkPaymentsInstance {
1048
+ }
1049
+ interface SdkPayments {
1050
+ initialize(publicApiKey: string, applicationSession?: string, options?: InitializeOptions): Promise<SdkPaymentsInstance>;
1051
+ }
1052
+ /**
1053
+ * @deprecated Since SDK v1.9.0. Use `SdkPayments` instead. Kept for backwards
1054
+ * compatibility with existing integrations (`window.Yuno`); will be removed in a future major version.
1055
+ */
1056
+ interface Yuno extends SdkPayments {
999
1057
  }
1000
1058
 
1001
1059
  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';
@@ -852,7 +878,7 @@ type ExternalProviderId = {
852
878
  provider_id: string;
853
879
  session_id: string;
854
880
  };
855
- interface YunoConfig {
881
+ interface SdkPaymentsConfig {
856
882
  publicApiKey: string;
857
883
  checkoutSession: string;
858
884
  customerSession: string;
@@ -880,19 +906,29 @@ interface YunoConfig {
880
906
  isDynamicViewEnabled?: boolean;
881
907
  showOnlyThesePaymentMethods?: string[];
882
908
  showPayButton?: boolean;
883
- yunoCreatePayment: (oneTimeToken: string, tokenWithInformation: OneTimeToken) => void;
884
- yunoPaymentMethodSelected?: (arg: {
909
+ createPayment?: (oneTimeToken: string, tokenWithInformation: OneTimeToken) => void;
910
+ /** @deprecated Since SDK v1.9.0. Use `createPayment` instead. Kept for backwards compatibility; will be removed in a future major version. */
911
+ yunoCreatePayment?: SdkPaymentsConfig["createPayment"];
912
+ paymentMethodSelected?: (arg: {
885
913
  type: string;
886
914
  name: string;
887
915
  }) => void;
888
- yunoPaymentResult?: (status: Status) => void;
889
- yunoError?: (message: string, data?: any) => void;
916
+ /** @deprecated Since SDK v1.9.0. Use `paymentMethodSelected` instead. Kept for backwards compatibility; will be removed in a future major version. */
917
+ yunoPaymentMethodSelected?: SdkPaymentsConfig["paymentMethodSelected"];
918
+ paymentResult?: (status: Status, subStatus?: string) => void;
919
+ /** @deprecated Since SDK v1.9.0. Use `paymentResult` instead. Kept for backwards compatibility; will be removed in a future major version. */
920
+ yunoPaymentResult?: SdkPaymentsConfig["paymentResult"];
921
+ error?: (message: string, data?: any) => void;
922
+ /** @deprecated Since SDK v1.9.0. Use `error` instead. Kept for backwards compatibility; will be removed in a future major version. */
923
+ yunoError?: SdkPaymentsConfig["error"];
890
924
  onRendered?(): void;
891
925
  onOneTimeTokenCreationStart?(): void;
892
- yunoEnrollmentStatus?(params: {
926
+ enrollmentStatus?(params: {
893
927
  status: EnrollmentStatus;
894
928
  vaultedToken?: string;
895
929
  }): void;
930
+ /** @deprecated Since SDK v1.9.0. Use `enrollmentStatus` instead. Kept for backwards compatibility; will be removed in a future major version. */
931
+ yunoEnrollmentStatus?: SdkPaymentsConfig["enrollmentStatus"];
896
932
  /**
897
933
  * @deprecated
898
934
  */
@@ -908,13 +944,19 @@ interface YunoConfig {
908
944
  };
909
945
  externalButtons?: ExternalButtonsNameSpace.ExternalButtonsConfig;
910
946
  }
911
- type StartCheckoutArgs = Omit<YunoConfig, "yunoEnrollmentStatus" | "customerSession" | "publicApiKey" | "card"> & {
947
+ /**
948
+ * @deprecated Since SDK v1.9.0. Use `SdkPaymentsConfig` instead. Kept for
949
+ * backwards compatibility; will be removed in a future major version.
950
+ */
951
+ interface YunoConfig extends SdkPaymentsConfig {
952
+ }
953
+ type StartCheckoutArgs = Omit<SdkPaymentsConfig, "enrollmentStatus" | "yunoEnrollmentStatus" | "customerSession" | "publicApiKey" | "card"> & {
912
954
  card?: CardConfig & {
913
955
  onChange?(args: OnChangeArgs): void;
914
956
  };
915
957
  };
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">;
958
+ type MountEnrollmentLiteArgs = Pick<SdkPaymentsConfig, "language" | "countryCode" | "renderMode" | "enrollmentStatus" | "yunoEnrollmentStatus" | "error" | "yunoError" | "showLoading" | "onRendered" | "onOneTimeTokenCreationStart" | "onLoading" | "customerSession" | "showPaymentStatus">;
959
+ type mountFraudArgs = Pick<SdkPaymentsConfig, "createPayment" | "yunoCreatePayment" | "error" | "yunoError" | "language" | "checkoutSession">;
918
960
  interface MountCheckoutLiteArgs {
919
961
  paymentMethodType: string;
920
962
  vaultedToken?: string;
@@ -937,8 +979,12 @@ interface MountStatusPaymentArgs {
937
979
  checkoutSession: string;
938
980
  language: Language;
939
981
  countryCode: string;
940
- yunoPaymentResult?: YunoConfig["yunoPaymentResult"];
941
- yunoError?: YunoConfig["yunoError"];
982
+ paymentResult?: SdkPaymentsConfig["paymentResult"];
983
+ /** @deprecated Since SDK v1.9.0. Use `paymentResult` instead. */
984
+ yunoPaymentResult?: SdkPaymentsConfig["paymentResult"];
985
+ error?: SdkPaymentsConfig["error"];
986
+ /** @deprecated Since SDK v1.9.0. Use `error` instead. */
987
+ yunoError?: SdkPaymentsConfig["error"];
942
988
  }
943
989
  type ContinuePaymentResponse = {
944
990
  action: "REDIRECT_URL";
@@ -955,7 +1001,7 @@ type ContinuePaymentArgs = {
955
1001
  */
956
1002
  showPaymentStatus?: boolean;
957
1003
  };
958
- type StartSeamlessCheckoutArgs = Omit<StartCheckoutArgs, "yunoCreatePayment">;
1004
+ type StartSeamlessCheckoutArgs = Omit<StartCheckoutArgs, "createPayment" | "yunoCreatePayment">;
959
1005
  type ShowLoaderOptions = {
960
1006
  onRendered?: () => void;
961
1007
  language?: string;
@@ -966,7 +1012,7 @@ type ExternalButton = {
966
1012
  checkoutSession?: string;
967
1013
  };
968
1014
  type MountSeamlessExternalButtonsArgs = ExternalButton[];
969
- interface YunoInstance extends ExternalButtonsNameSpace.ExternalButtonMethods {
1015
+ interface SdkPaymentsInstance extends ExternalButtonsNameSpace.ExternalButtonMethods {
970
1016
  startCheckout(args: StartCheckoutArgs): Promise<void>;
971
1017
  startSeamlessCheckout(args: StartSeamlessCheckoutArgs): Promise<void>;
972
1018
  mountCheckout(): Promise<void>;
@@ -994,8 +1040,20 @@ interface YunoInstance extends ExternalButtonsNameSpace.ExternalButtonMethods {
994
1040
  clickToPay: C2PHeadless.ClickToPayFn;
995
1041
  clearApiCache(): Promise<void>;
996
1042
  }
997
- interface Yuno {
998
- initialize(publicApiKey: string, applicationSession?: string, options?: InitializeOptions): Promise<YunoInstance>;
1043
+ /**
1044
+ * @deprecated Since SDK v1.9.0. Use `SdkPaymentsInstance` instead. Kept for
1045
+ * backwards compatibility; will be removed in a future major version.
1046
+ */
1047
+ interface YunoInstance extends SdkPaymentsInstance {
1048
+ }
1049
+ interface SdkPayments {
1050
+ initialize(publicApiKey: string, applicationSession?: string, options?: InitializeOptions): Promise<SdkPaymentsInstance>;
1051
+ }
1052
+ /**
1053
+ * @deprecated Since SDK v1.9.0. Use `SdkPayments` instead. Kept for backwards
1054
+ * compatibility with existing integrations (`window.Yuno`); will be removed in a future major version.
1055
+ */
1056
+ interface Yuno extends SdkPayments {
999
1057
  }
1000
1058
 
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 };
1059
+ 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.1",
3
+ "version": "5.5.0",
4
4
  "types": "dist/index.d.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {