@tonder.io/rn-sdk 0.1.0-beta.DEV1355.1 → 0.1.0-beta.DEV1355.3

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.
Files changed (122) hide show
  1. package/README.md +1302 -13
  2. package/lib/commonjs/core/3DSHandler.js +5 -3
  3. package/lib/commonjs/core/3DSHandler.js.map +1 -1
  4. package/lib/commonjs/core/BaseCheckout/index.js +6 -3
  5. package/lib/commonjs/core/BaseCheckout/index.js.map +1 -1
  6. package/lib/commonjs/core/PaymentInlineContainer/index.js +1 -1
  7. package/lib/commonjs/core/PaymentInlineContainer/index.js.map +1 -1
  8. package/lib/commonjs/core/PaymentLiteContainer/index.js +1 -1
  9. package/lib/commonjs/core/PaymentLiteContainer/index.js.map +1 -1
  10. package/lib/commonjs/core/Tonder/index.js +1 -3
  11. package/lib/commonjs/core/Tonder/index.js.map +1 -1
  12. package/lib/commonjs/services/CardService.js +5 -4
  13. package/lib/commonjs/services/CardService.js.map +1 -1
  14. package/lib/commonjs/types/base.js.map +1 -1
  15. package/lib/commonjs/ui/components/Input/CardCVVInput.js +2 -1
  16. package/lib/commonjs/ui/components/Input/CardCVVInput.js.map +1 -1
  17. package/lib/commonjs/ui/components/Input/CardExpirationMonthInput.js +2 -1
  18. package/lib/commonjs/ui/components/Input/CardExpirationMonthInput.js.map +1 -1
  19. package/lib/commonjs/ui/components/Input/CardExpirationYearInput.js +2 -1
  20. package/lib/commonjs/ui/components/Input/CardExpirationYearInput.js.map +1 -1
  21. package/lib/commonjs/ui/components/Input/CardHolderInput.js +2 -1
  22. package/lib/commonjs/ui/components/Input/CardHolderInput.js.map +1 -1
  23. package/lib/commonjs/ui/components/Input/CardNumberInput.js +2 -1
  24. package/lib/commonjs/ui/components/Input/CardNumberInput.js.map +1 -1
  25. package/lib/commonjs/ui/providers/TonderProvider/uiWrapper.js +2 -1
  26. package/lib/commonjs/ui/providers/TonderProvider/uiWrapper.js.map +1 -1
  27. package/lib/module/core/3DSHandler.js +5 -3
  28. package/lib/module/core/3DSHandler.js.map +1 -1
  29. package/lib/module/core/BaseCheckout/index.js +7 -4
  30. package/lib/module/core/BaseCheckout/index.js.map +1 -1
  31. package/lib/module/core/PaymentInlineContainer/index.js +1 -1
  32. package/lib/module/core/PaymentInlineContainer/index.js.map +1 -1
  33. package/lib/module/core/PaymentLiteContainer/index.js +1 -1
  34. package/lib/module/core/PaymentLiteContainer/index.js.map +1 -1
  35. package/lib/module/core/Tonder/index.js +1 -3
  36. package/lib/module/core/Tonder/index.js.map +1 -1
  37. package/lib/module/services/CardService.js +5 -4
  38. package/lib/module/services/CardService.js.map +1 -1
  39. package/lib/module/types/base.js.map +1 -1
  40. package/lib/module/ui/components/Input/CardCVVInput.js +2 -1
  41. package/lib/module/ui/components/Input/CardCVVInput.js.map +1 -1
  42. package/lib/module/ui/components/Input/CardExpirationMonthInput.js +2 -1
  43. package/lib/module/ui/components/Input/CardExpirationMonthInput.js.map +1 -1
  44. package/lib/module/ui/components/Input/CardExpirationYearInput.js +2 -1
  45. package/lib/module/ui/components/Input/CardExpirationYearInput.js.map +1 -1
  46. package/lib/module/ui/components/Input/CardHolderInput.js +2 -1
  47. package/lib/module/ui/components/Input/CardHolderInput.js.map +1 -1
  48. package/lib/module/ui/components/Input/CardNumberInput.js +2 -1
  49. package/lib/module/ui/components/Input/CardNumberInput.js.map +1 -1
  50. package/lib/module/ui/providers/TonderProvider/uiWrapper.js +2 -1
  51. package/lib/module/ui/providers/TonderProvider/uiWrapper.js.map +1 -1
  52. package/lib/typescript/commonjs/src/core/3DSHandler.d.ts +1 -1
  53. package/lib/typescript/commonjs/src/core/3DSHandler.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/src/core/BaseCheckout/index.d.ts +3 -2
  55. package/lib/typescript/commonjs/src/core/BaseCheckout/index.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/src/core/Tonder/index.d.ts.map +1 -1
  57. package/lib/typescript/commonjs/src/services/CardService.d.ts.map +1 -1
  58. package/lib/typescript/commonjs/src/types/base.d.ts +0 -1
  59. package/lib/typescript/commonjs/src/types/base.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/src/types/baseCheckout.d.ts +2 -3
  61. package/lib/typescript/commonjs/src/types/baseCheckout.d.ts.map +1 -1
  62. package/lib/typescript/commonjs/src/types/inlineCheckout.d.ts +1 -2
  63. package/lib/typescript/commonjs/src/types/inlineCheckout.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/src/types/liteCheckout.d.ts +0 -1
  65. package/lib/typescript/commonjs/src/types/liteCheckout.d.ts.map +1 -1
  66. package/lib/typescript/commonjs/src/types/threeDSHandler.d.ts +1 -1
  67. package/lib/typescript/commonjs/src/types/threeDSHandler.d.ts.map +1 -1
  68. package/lib/typescript/commonjs/src/ui/components/Input/CardCVVInput.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationMonthInput.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationYearInput.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/src/ui/components/Input/CardHolderInput.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/src/ui/components/Input/CardNumberInput.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/src/ui/providers/TonderProvider/uiWrapper.d.ts.map +1 -1
  74. package/lib/typescript/module/src/core/3DSHandler.d.ts +1 -1
  75. package/lib/typescript/module/src/core/3DSHandler.d.ts.map +1 -1
  76. package/lib/typescript/module/src/core/BaseCheckout/index.d.ts +3 -2
  77. package/lib/typescript/module/src/core/BaseCheckout/index.d.ts.map +1 -1
  78. package/lib/typescript/module/src/core/Tonder/index.d.ts.map +1 -1
  79. package/lib/typescript/module/src/services/CardService.d.ts.map +1 -1
  80. package/lib/typescript/module/src/types/base.d.ts +0 -1
  81. package/lib/typescript/module/src/types/base.d.ts.map +1 -1
  82. package/lib/typescript/module/src/types/baseCheckout.d.ts +2 -3
  83. package/lib/typescript/module/src/types/baseCheckout.d.ts.map +1 -1
  84. package/lib/typescript/module/src/types/inlineCheckout.d.ts +1 -2
  85. package/lib/typescript/module/src/types/inlineCheckout.d.ts.map +1 -1
  86. package/lib/typescript/module/src/types/liteCheckout.d.ts +0 -1
  87. package/lib/typescript/module/src/types/liteCheckout.d.ts.map +1 -1
  88. package/lib/typescript/module/src/types/threeDSHandler.d.ts +1 -1
  89. package/lib/typescript/module/src/types/threeDSHandler.d.ts.map +1 -1
  90. package/lib/typescript/module/src/ui/components/Input/CardCVVInput.d.ts.map +1 -1
  91. package/lib/typescript/module/src/ui/components/Input/CardExpirationMonthInput.d.ts.map +1 -1
  92. package/lib/typescript/module/src/ui/components/Input/CardExpirationYearInput.d.ts.map +1 -1
  93. package/lib/typescript/module/src/ui/components/Input/CardHolderInput.d.ts.map +1 -1
  94. package/lib/typescript/module/src/ui/components/Input/CardNumberInput.d.ts.map +1 -1
  95. package/lib/typescript/module/src/ui/providers/TonderProvider/uiWrapper.d.ts.map +1 -1
  96. package/package.json +1 -4
  97. package/src/core/3DSHandler.ts +8 -2
  98. package/src/core/BaseCheckout/index.ts +39 -25
  99. package/src/core/PaymentInlineContainer/index.ts +1 -1
  100. package/src/core/PaymentLiteContainer/index.ts +1 -1
  101. package/src/core/Tonder/index.ts +0 -4
  102. package/src/services/CardService.ts +5 -4
  103. package/src/types/base.ts +0 -1
  104. package/src/types/baseCheckout.ts +2 -1
  105. package/src/types/inlineCheckout.ts +1 -2
  106. package/src/types/liteCheckout.ts +0 -1
  107. package/src/types/threeDSHandler.ts +1 -0
  108. package/src/ui/components/Input/CardCVVInput.tsx +2 -1
  109. package/src/ui/components/Input/CardExpirationMonthInput.tsx +2 -1
  110. package/src/ui/components/Input/CardExpirationYearInput.tsx +2 -1
  111. package/src/ui/components/Input/CardHolderInput.tsx +2 -1
  112. package/src/ui/components/Input/CardNumberInput.tsx +2 -1
  113. package/src/ui/providers/TonderProvider/uiWrapper.ts +8 -1
  114. package/lib/commonjs/hooks/useTonder/index-old.js +0 -37
  115. package/lib/commonjs/hooks/useTonder/index-old.js.map +0 -1
  116. package/lib/module/hooks/useTonder/index-old.js +0 -37
  117. package/lib/module/hooks/useTonder/index-old.js.map +0 -1
  118. package/lib/typescript/commonjs/src/hooks/useTonder/index-old.d.ts +0 -1
  119. package/lib/typescript/commonjs/src/hooks/useTonder/index-old.d.ts.map +0 -1
  120. package/lib/typescript/module/src/hooks/useTonder/index-old.d.ts +0 -1
  121. package/lib/typescript/module/src/hooks/useTonder/index-old.d.ts.map +0 -1
  122. package/src/hooks/useTonder/index-old.ts +0 -35
@@ -16,7 +16,6 @@ import { SDKType } from '@tonder.io/rn-sdk';
16
16
  import TonderError from '@shared/utils/errors';
17
17
 
18
18
  export interface IInlineCheckoutOptions extends IBaseCreateOptions {
19
- tdsIframeId?: string;
20
19
  paymentData: IBaseProcessPaymentRequest;
21
20
  customization?: IInlineCustomizationOptions;
22
21
  callbacks?: IInlineCallbacks;
@@ -56,7 +55,7 @@ export interface IInlineCustomizationOptions {
56
55
  }
57
56
  export interface IInlineCallbacks extends IBaseCallback {
58
57
  beforeDeleteCard?: () => Promise<void>;
59
- onFinishDeleteCard?: (id: string) => Promise<void>;
58
+ onFinishDeleteCard?: (response: IBaseResponse<string>) => Promise<void>;
60
59
  }
61
60
  export interface IPaymentInlineContainer {
62
61
  /**
@@ -16,7 +16,6 @@ import TonderError from '@shared/utils/errors';
16
16
 
17
17
  export interface ILiteCheckoutOptions extends IBaseCreateOptions {
18
18
  paymentData: IProcessPaymentRequest;
19
- tdsIframeId?: string;
20
19
  customization?: ILiteCustomizationOptions;
21
20
  callbacks?: ILiteCallbacks;
22
21
  returnURL?: string;
@@ -5,6 +5,7 @@ export interface IThreeDSHandler {
5
5
  verifyTransaction(): Promise<ITransaction>;
6
6
  handle3DS(
7
7
  payload: ICheckoutResponse,
8
+ returnURL: string,
8
9
  onFinish: (response: ITransaction | TonderError) => Promise<void>
9
10
  ): void;
10
11
  }
@@ -30,9 +30,10 @@ export const CardCVVInput: React.FC<InputProps> = ({
30
30
  {state?.skyflowContainer && state?.isCreated && !state?.isCreating && (
31
31
  <View
32
32
  style={{
33
+ ...DEFAULT_INPUT_CONTAINER_STYLES.base,
33
34
  ...(style?.inputStyles?.container
34
35
  ? { ...style.inputStyles.container }
35
- : DEFAULT_INPUT_CONTAINER_STYLES.base),
36
+ : {}),
36
37
  }}
37
38
  >
38
39
  <CvvElement
@@ -29,9 +29,10 @@ export const CardExpirationMonthInput: React.FC<InputProps> = ({
29
29
  {state?.skyflowContainer && state?.isCreated && !state?.isCreating && (
30
30
  <View
31
31
  style={{
32
+ ...DEFAULT_INPUT_CONTAINER_STYLES.base,
32
33
  ...(style?.inputStyles?.container
33
34
  ? { ...style.inputStyles.container }
34
- : DEFAULT_INPUT_CONTAINER_STYLES.base),
35
+ : {}),
35
36
  }}
36
37
  >
37
38
  <ExpirationMonthElement
@@ -30,9 +30,10 @@ export const CardExpirationYearInput: React.FC<InputProps> = ({
30
30
  {state?.skyflowContainer && state?.isCreated && !state?.isCreating && (
31
31
  <View
32
32
  style={{
33
+ ...DEFAULT_INPUT_CONTAINER_STYLES.base,
33
34
  ...(style?.inputStyles?.container
34
35
  ? { ...style.inputStyles.container }
35
- : DEFAULT_INPUT_CONTAINER_STYLES.base),
36
+ : {}),
36
37
  }}
37
38
  >
38
39
  <ExpirationYearElement
@@ -31,9 +31,10 @@ export const CardHolderInput: React.FC<InputProps> = ({
31
31
  {state?.skyflowContainer && state?.isCreated && !state?.isCreating && (
32
32
  <View
33
33
  style={{
34
+ ...DEFAULT_INPUT_CONTAINER_STYLES.base,
34
35
  ...(style?.inputStyles?.container
35
36
  ? { ...style.inputStyles.container }
36
- : DEFAULT_INPUT_CONTAINER_STYLES.base),
37
+ : {}),
37
38
  }}
38
39
  >
39
40
  <CardHolderNameElement
@@ -30,9 +30,10 @@ export const CardNumberInput: React.FC<InputProps> = ({
30
30
  {state?.skyflowContainer && state?.isCreated && !state?.isCreating && (
31
31
  <View
32
32
  style={{
33
+ ...DEFAULT_INPUT_CONTAINER_STYLES.base,
33
34
  ...(style?.inputStyles?.container
34
35
  ? { ...style.inputStyles.container }
35
- : DEFAULT_INPUT_CONTAINER_STYLES.base),
36
+ : {}),
36
37
  }}
37
38
  >
38
39
  <CardNumberElement
@@ -31,7 +31,9 @@ const uiWrapper = (tonder: Tonder): IUIWrapper => ({
31
31
  tonder.updateUIState({
32
32
  cards: tonder
33
33
  .getState()
34
- .uiData.cards.filter((card: any) => card.id !== cardId),
34
+ .uiData.cards.filter(
35
+ (card: any) => card.fields.skyflow_id !== cardId
36
+ ),
35
37
  });
36
38
  await executeCallback({
37
39
  callbacks,
@@ -39,6 +41,11 @@ const uiWrapper = (tonder: Tonder): IUIWrapper => ({
39
41
  data: { response: MESSAGES_EN.REMOVE_CARD },
40
42
  });
41
43
  } catch (error) {
44
+ console.log(
45
+ '[uiWrapper | removeCustomerCard | ERROR',
46
+ error,
47
+ error?.details
48
+ );
42
49
  await executeCallback({
43
50
  callbacks,
44
51
  callback: 'onFinishDeleteCard',
@@ -1,37 +0,0 @@
1
- // import { useCallback, useContext } from 'react';
2
- // import { TonderContext } from '@ui/providers/TonderProvider';
3
- // import type { SDKMethodsInstance, SDKType } from '@types';
4
- // import { TonderError } from '@shared/utils/errors';
5
- // import { ServiceManager } from '@infrastructure/ServiceManager';
6
- //
7
- // export interface IUseTonder<T extends SDKType> {
8
- // methods: SDKMethodsInstance<T>;
9
- // error: TonderError | Error | null;
10
- // isCreated: boolean;
11
- // create: any;
12
- // }
13
- //
14
- // export function useTonder<T extends SDKType>(): IUseTonder<T> {
15
- // const context = useContext(TonderContext);
16
- // const { sdk, config } = context;
17
- //
18
- // const service = new ServiceManager(config!);
19
- //
20
- // const methods = useCallback(() => {
21
- // const allowedMethods = sdk?.getAllowedMethods() || {};
22
- // return {
23
- // ...allowedMethods,
24
- // getSecureToken: (secretApiKey: string, signal?: AbortSignal) =>
25
- // service.token.getSecureToken(secretApiKey, signal),
26
- // };
27
- // }, [sdk, service.token]);
28
- //
29
- // return {
30
- // methods: methods(),
31
- // error: context?.sdkState?.error || null,
32
- // isCreated: context?.sdkState?.isCreated,
33
- // isProcessing: context?.sdkState?.isProcessing,
34
- // } as IUseTonder<T>;
35
- // }
36
- "use strict";
37
- //# sourceMappingURL=index-old.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["hooks/useTonder/index-old.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA","ignoreList":[]}
@@ -1,37 +0,0 @@
1
- // import { useCallback, useContext } from 'react';
2
- // import { TonderContext } from '@ui/providers/TonderProvider';
3
- // import type { SDKMethodsInstance, SDKType } from '@types';
4
- // import { TonderError } from '@shared/utils/errors';
5
- // import { ServiceManager } from '@infrastructure/ServiceManager';
6
- //
7
- // export interface IUseTonder<T extends SDKType> {
8
- // methods: SDKMethodsInstance<T>;
9
- // error: TonderError | Error | null;
10
- // isCreated: boolean;
11
- // create: any;
12
- // }
13
- //
14
- // export function useTonder<T extends SDKType>(): IUseTonder<T> {
15
- // const context = useContext(TonderContext);
16
- // const { sdk, config } = context;
17
- //
18
- // const service = new ServiceManager(config!);
19
- //
20
- // const methods = useCallback(() => {
21
- // const allowedMethods = sdk?.getAllowedMethods() || {};
22
- // return {
23
- // ...allowedMethods,
24
- // getSecureToken: (secretApiKey: string, signal?: AbortSignal) =>
25
- // service.token.getSecureToken(secretApiKey, signal),
26
- // };
27
- // }, [sdk, service.token]);
28
- //
29
- // return {
30
- // methods: methods(),
31
- // error: context?.sdkState?.error || null,
32
- // isCreated: context?.sdkState?.isCreated,
33
- // isProcessing: context?.sdkState?.isProcessing,
34
- // } as IUseTonder<T>;
35
- // }
36
- "use strict";
37
- //# sourceMappingURL=index-old.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["hooks/useTonder/index-old.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index-old.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-old.d.ts","sourceRoot":"","sources":["../../../../../../src/hooks/useTonder/index-old.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index-old.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-old.d.ts","sourceRoot":"","sources":["../../../../../../src/hooks/useTonder/index-old.ts"],"names":[],"mappings":""}
@@ -1,35 +0,0 @@
1
- // import { useCallback, useContext } from 'react';
2
- // import { TonderContext } from '@ui/providers/TonderProvider';
3
- // import type { SDKMethodsInstance, SDKType } from '@types';
4
- // import { TonderError } from '@shared/utils/errors';
5
- // import { ServiceManager } from '@infrastructure/ServiceManager';
6
- //
7
- // export interface IUseTonder<T extends SDKType> {
8
- // methods: SDKMethodsInstance<T>;
9
- // error: TonderError | Error | null;
10
- // isCreated: boolean;
11
- // create: any;
12
- // }
13
- //
14
- // export function useTonder<T extends SDKType>(): IUseTonder<T> {
15
- // const context = useContext(TonderContext);
16
- // const { sdk, config } = context;
17
- //
18
- // const service = new ServiceManager(config!);
19
- //
20
- // const methods = useCallback(() => {
21
- // const allowedMethods = sdk?.getAllowedMethods() || {};
22
- // return {
23
- // ...allowedMethods,
24
- // getSecureToken: (secretApiKey: string, signal?: AbortSignal) =>
25
- // service.token.getSecureToken(secretApiKey, signal),
26
- // };
27
- // }, [sdk, service.token]);
28
- //
29
- // return {
30
- // methods: methods(),
31
- // error: context?.sdkState?.error || null,
32
- // isCreated: context?.sdkState?.isCreated,
33
- // isProcessing: context?.sdkState?.isProcessing,
34
- // } as IUseTonder<T>;
35
- // }