@tonder.io/rn-sdk 0.1.4 → 0.1.5-beta.DEV1404.b71a839

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 (121) hide show
  1. package/README.md +148 -12
  2. package/lib/commonjs/core/BaseEnrollment/index.js +1 -0
  3. package/lib/commonjs/core/BaseEnrollment/index.js.map +1 -1
  4. package/lib/commonjs/core/BaseSDK/index.js +1 -1
  5. package/lib/commonjs/core/BaseSDK/index.js.map +1 -1
  6. package/lib/commonjs/core/PaymentInlineContainer/index.js +1 -0
  7. package/lib/commonjs/core/PaymentInlineContainer/index.js.map +1 -1
  8. package/lib/commonjs/services/SkyflowService.js +3 -2
  9. package/lib/commonjs/services/SkyflowService.js.map +1 -1
  10. package/lib/commonjs/types/base.js.map +1 -1
  11. package/lib/commonjs/ui/components/CardForm/index.js +19 -5
  12. package/lib/commonjs/ui/components/CardForm/index.js.map +1 -1
  13. package/lib/commonjs/ui/components/Input/CardCVVInput.js +13 -7
  14. package/lib/commonjs/ui/components/Input/CardCVVInput.js.map +1 -1
  15. package/lib/commonjs/ui/components/Input/CardExpirationDateInput.js +10 -3
  16. package/lib/commonjs/ui/components/Input/CardExpirationDateInput.js.map +1 -1
  17. package/lib/commonjs/ui/components/Input/CardExpirationMonthInput.js +13 -7
  18. package/lib/commonjs/ui/components/Input/CardExpirationMonthInput.js.map +1 -1
  19. package/lib/commonjs/ui/components/Input/CardExpirationYearInput.js +13 -7
  20. package/lib/commonjs/ui/components/Input/CardExpirationYearInput.js.map +1 -1
  21. package/lib/commonjs/ui/components/Input/CardHolderInput.js +13 -7
  22. package/lib/commonjs/ui/components/Input/CardHolderInput.js.map +1 -1
  23. package/lib/commonjs/ui/components/Input/CardNumberInput.js +13 -7
  24. package/lib/commonjs/ui/components/Input/CardNumberInput.js.map +1 -1
  25. package/lib/commonjs/ui/features/TonderEnrollment/index.js +2 -1
  26. package/lib/commonjs/ui/features/TonderEnrollment/index.js.map +1 -1
  27. package/lib/commonjs/ui/features/TonderPayment/index.js +2 -1
  28. package/lib/commonjs/ui/features/TonderPayment/index.js.map +1 -1
  29. package/lib/module/core/BaseEnrollment/index.js +1 -0
  30. package/lib/module/core/BaseEnrollment/index.js.map +1 -1
  31. package/lib/module/core/BaseSDK/index.js +1 -1
  32. package/lib/module/core/BaseSDK/index.js.map +1 -1
  33. package/lib/module/core/PaymentInlineContainer/index.js +1 -0
  34. package/lib/module/core/PaymentInlineContainer/index.js.map +1 -1
  35. package/lib/module/services/SkyflowService.js +3 -2
  36. package/lib/module/services/SkyflowService.js.map +1 -1
  37. package/lib/module/types/base.js.map +1 -1
  38. package/lib/module/ui/components/CardForm/index.js +19 -5
  39. package/lib/module/ui/components/CardForm/index.js.map +1 -1
  40. package/lib/module/ui/components/Input/CardCVVInput.js +13 -7
  41. package/lib/module/ui/components/Input/CardCVVInput.js.map +1 -1
  42. package/lib/module/ui/components/Input/CardExpirationDateInput.js +10 -3
  43. package/lib/module/ui/components/Input/CardExpirationDateInput.js.map +1 -1
  44. package/lib/module/ui/components/Input/CardExpirationMonthInput.js +13 -7
  45. package/lib/module/ui/components/Input/CardExpirationMonthInput.js.map +1 -1
  46. package/lib/module/ui/components/Input/CardExpirationYearInput.js +13 -7
  47. package/lib/module/ui/components/Input/CardExpirationYearInput.js.map +1 -1
  48. package/lib/module/ui/components/Input/CardHolderInput.js +13 -7
  49. package/lib/module/ui/components/Input/CardHolderInput.js.map +1 -1
  50. package/lib/module/ui/components/Input/CardNumberInput.js +13 -7
  51. package/lib/module/ui/components/Input/CardNumberInput.js.map +1 -1
  52. package/lib/module/ui/features/TonderEnrollment/index.js +2 -1
  53. package/lib/module/ui/features/TonderEnrollment/index.js.map +1 -1
  54. package/lib/module/ui/features/TonderPayment/index.js +2 -1
  55. package/lib/module/ui/features/TonderPayment/index.js.map +1 -1
  56. package/lib/typescript/commonjs/src/core/BaseEnrollment/index.d.ts.map +1 -1
  57. package/lib/typescript/commonjs/src/core/BaseSDK/index.d.ts.map +1 -1
  58. package/lib/typescript/commonjs/src/core/PaymentInlineContainer/index.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/src/services/SkyflowService.d.ts +2 -1
  60. package/lib/typescript/commonjs/src/services/SkyflowService.d.ts.map +1 -1
  61. package/lib/typescript/commonjs/src/types/base.d.ts +3 -1
  62. package/lib/typescript/commonjs/src/types/base.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/src/types/enrollment.d.ts +3 -1
  64. package/lib/typescript/commonjs/src/types/enrollment.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/src/types/inlineCheckout.d.ts +3 -1
  66. package/lib/typescript/commonjs/src/types/inlineCheckout.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/src/types/input.d.ts +30 -1
  68. package/lib/typescript/commonjs/src/types/input.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/src/ui/components/CardForm/index.d.ts +2 -1
  70. package/lib/typescript/commonjs/src/ui/components/CardForm/index.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/src/ui/components/Input/CardCVVInput.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationDateInput.d.ts +1 -7
  73. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationDateInput.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationMonthInput.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationYearInput.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/src/ui/components/Input/CardHolderInput.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/src/ui/components/Input/CardNumberInput.d.ts.map +1 -1
  78. package/lib/typescript/commonjs/src/ui/features/TonderEnrollment/index.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/src/ui/features/TonderPayment/index.d.ts.map +1 -1
  80. package/lib/typescript/module/src/core/BaseEnrollment/index.d.ts.map +1 -1
  81. package/lib/typescript/module/src/core/BaseSDK/index.d.ts.map +1 -1
  82. package/lib/typescript/module/src/core/PaymentInlineContainer/index.d.ts.map +1 -1
  83. package/lib/typescript/module/src/services/SkyflowService.d.ts +2 -1
  84. package/lib/typescript/module/src/services/SkyflowService.d.ts.map +1 -1
  85. package/lib/typescript/module/src/types/base.d.ts +3 -1
  86. package/lib/typescript/module/src/types/base.d.ts.map +1 -1
  87. package/lib/typescript/module/src/types/enrollment.d.ts +3 -1
  88. package/lib/typescript/module/src/types/enrollment.d.ts.map +1 -1
  89. package/lib/typescript/module/src/types/inlineCheckout.d.ts +3 -1
  90. package/lib/typescript/module/src/types/inlineCheckout.d.ts.map +1 -1
  91. package/lib/typescript/module/src/types/input.d.ts +30 -1
  92. package/lib/typescript/module/src/types/input.d.ts.map +1 -1
  93. package/lib/typescript/module/src/ui/components/CardForm/index.d.ts +2 -1
  94. package/lib/typescript/module/src/ui/components/CardForm/index.d.ts.map +1 -1
  95. package/lib/typescript/module/src/ui/components/Input/CardCVVInput.d.ts.map +1 -1
  96. package/lib/typescript/module/src/ui/components/Input/CardExpirationDateInput.d.ts +1 -7
  97. package/lib/typescript/module/src/ui/components/Input/CardExpirationDateInput.d.ts.map +1 -1
  98. package/lib/typescript/module/src/ui/components/Input/CardExpirationMonthInput.d.ts.map +1 -1
  99. package/lib/typescript/module/src/ui/components/Input/CardExpirationYearInput.d.ts.map +1 -1
  100. package/lib/typescript/module/src/ui/components/Input/CardHolderInput.d.ts.map +1 -1
  101. package/lib/typescript/module/src/ui/components/Input/CardNumberInput.d.ts.map +1 -1
  102. package/lib/typescript/module/src/ui/features/TonderEnrollment/index.d.ts.map +1 -1
  103. package/lib/typescript/module/src/ui/features/TonderPayment/index.d.ts.map +1 -1
  104. package/package.json +1 -1
  105. package/src/core/BaseEnrollment/index.ts +1 -0
  106. package/src/core/BaseSDK/index.ts +4 -1
  107. package/src/core/PaymentInlineContainer/index.ts +1 -0
  108. package/src/services/SkyflowService.ts +6 -2
  109. package/src/types/base.ts +3 -0
  110. package/src/types/enrollment.ts +3 -1
  111. package/src/types/inlineCheckout.ts +3 -0
  112. package/src/types/input.ts +33 -1
  113. package/src/ui/components/CardForm/index.tsx +16 -0
  114. package/src/ui/components/Input/CardCVVInput.tsx +11 -4
  115. package/src/ui/components/Input/CardExpirationDateInput.tsx +8 -7
  116. package/src/ui/components/Input/CardExpirationMonthInput.tsx +11 -4
  117. package/src/ui/components/Input/CardExpirationYearInput.tsx +11 -4
  118. package/src/ui/components/Input/CardHolderInput.tsx +11 -4
  119. package/src/ui/components/Input/CardNumberInput.tsx +11 -4
  120. package/src/ui/features/TonderEnrollment/index.tsx +1 -0
  121. package/src/ui/features/TonderPayment/index.tsx +1 -0
@@ -22,6 +22,9 @@ export const CardExpirationYearInput: React.FC<InputProps> = ({
22
22
  placeholder = DEFAULT_SKYFLOW_PLACEHOLDERS.expiryYearPlaceholder,
23
23
  label = DEFAULT_SKYFLOW_lABELS.expiryYearLabel,
24
24
  style,
25
+ onFocus,
26
+ onBlur,
27
+ onChange,
25
28
  }) => {
26
29
  const { state } = useTonderContext();
27
30
  const [errorText, setErrorText] = useState('');
@@ -72,12 +75,16 @@ export const CardExpirationYearInput: React.FC<InputProps> = ({
72
75
  }
73
76
  : {}),
74
77
  }}
75
- onChange={() => {
78
+ onChange={(event) => {
76
79
  setErrorText('');
80
+ if (onChange) onChange(event);
77
81
  }}
78
- // onFocus={props.onFocus}
79
- onBlur={(e) => {
80
- setErrorText(getErrorField(e, label));
82
+ onFocus={(event) => {
83
+ if (onFocus) onFocus(event);
84
+ }}
85
+ onBlur={(event) => {
86
+ setErrorText(getErrorField(event, label));
87
+ if (onBlur) onBlur(event);
81
88
  }}
82
89
  // onReady={props.onReady}
83
90
  />
@@ -23,6 +23,9 @@ export const CardHolderInput: React.FC<InputProps> = ({
23
23
  placeholder = DEFAULT_SKYFLOW_PLACEHOLDERS.namePlaceholder,
24
24
  label = DEFAULT_SKYFLOW_lABELS.nameLabel,
25
25
  style,
26
+ onFocus,
27
+ onBlur,
28
+ onChange,
26
29
  }) => {
27
30
  const { state } = useTonderContext();
28
31
 
@@ -72,12 +75,16 @@ export const CardHolderInput: React.FC<InputProps> = ({
72
75
  }
73
76
  : {}),
74
77
  }}
75
- onChange={() => {
78
+ onChange={(event) => {
76
79
  setErrorText('');
80
+ if (onChange) onChange(event);
77
81
  }}
78
- // onFocus={props.onFocus}
79
- onBlur={(e) => {
80
- setErrorText(getErrorField(e, label));
82
+ onFocus={(event) => {
83
+ if (onFocus) onFocus(event);
84
+ }}
85
+ onBlur={(event) => {
86
+ setErrorText(getErrorField(event, label));
87
+ if (onBlur) onBlur(event);
81
88
  }}
82
89
  // onReady={props.onReady}
83
90
  />
@@ -22,6 +22,9 @@ export const CardNumberInput: React.FC<InputProps> = ({
22
22
  placeholder = DEFAULT_SKYFLOW_PLACEHOLDERS.cardPlaceholder,
23
23
  label = DEFAULT_SKYFLOW_lABELS.cardLabel,
24
24
  style,
25
+ onFocus,
26
+ onBlur,
27
+ onChange,
25
28
  }) => {
26
29
  const { state } = useTonderContext();
27
30
  const [errorText, setErrorText] = useState('');
@@ -71,12 +74,16 @@ export const CardNumberInput: React.FC<InputProps> = ({
71
74
  }
72
75
  : {}),
73
76
  }}
74
- onChange={() => {
77
+ onChange={(event) => {
75
78
  setErrorText('');
79
+ if (onChange) onChange(event);
76
80
  }}
77
- // onFocus={props.onFocus}
78
- onBlur={(e) => {
79
- setErrorText(getErrorField(e, label));
81
+ onFocus={(event) => {
82
+ if (onFocus) onFocus(event);
83
+ }}
84
+ onBlur={(event) => {
85
+ setErrorText(getErrorField(event, label));
86
+ if (onBlur) onBlur(event);
80
87
  }}
81
88
  // onReady={props.onReady}
82
89
  />
@@ -47,6 +47,7 @@ const TonderEnrollment: React.FC<ITonderEnrollmentProps> = () => {
47
47
  style={state?.customization?.styles?.cardForm}
48
48
  labels={state?.customization?.labels}
49
49
  placeholders={state?.customization?.placeholders}
50
+ events={state?.events}
50
51
  />
51
52
  )}
52
53
  {state?.customization?.showMessages &&
@@ -133,6 +133,7 @@ const TonderPayment: React.FC<ITonderPaymentProps> = () => {
133
133
  style={state?.customization?.styles?.cardForm}
134
134
  labels={state?.customization?.labels}
135
135
  placeholders={state?.customization?.placeholders}
136
+ events={state?.events}
136
137
  />
137
138
  )}
138
139
  {state?.customization?.paymentMethods?.show && (