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

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 (105) hide show
  1. package/README.md +145 -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/PaymentInlineContainer/index.js +1 -0
  5. package/lib/commonjs/core/PaymentInlineContainer/index.js.map +1 -1
  6. package/lib/commonjs/types/base.js.map +1 -1
  7. package/lib/commonjs/ui/components/CardForm/index.js +19 -5
  8. package/lib/commonjs/ui/components/CardForm/index.js.map +1 -1
  9. package/lib/commonjs/ui/components/Input/CardCVVInput.js +13 -7
  10. package/lib/commonjs/ui/components/Input/CardCVVInput.js.map +1 -1
  11. package/lib/commonjs/ui/components/Input/CardExpirationDateInput.js +10 -3
  12. package/lib/commonjs/ui/components/Input/CardExpirationDateInput.js.map +1 -1
  13. package/lib/commonjs/ui/components/Input/CardExpirationMonthInput.js +13 -7
  14. package/lib/commonjs/ui/components/Input/CardExpirationMonthInput.js.map +1 -1
  15. package/lib/commonjs/ui/components/Input/CardExpirationYearInput.js +13 -7
  16. package/lib/commonjs/ui/components/Input/CardExpirationYearInput.js.map +1 -1
  17. package/lib/commonjs/ui/components/Input/CardHolderInput.js +13 -7
  18. package/lib/commonjs/ui/components/Input/CardHolderInput.js.map +1 -1
  19. package/lib/commonjs/ui/components/Input/CardNumberInput.js +13 -7
  20. package/lib/commonjs/ui/components/Input/CardNumberInput.js.map +1 -1
  21. package/lib/commonjs/ui/features/TonderEnrollment/index.js +2 -1
  22. package/lib/commonjs/ui/features/TonderEnrollment/index.js.map +1 -1
  23. package/lib/commonjs/ui/features/TonderPayment/index.js +2 -1
  24. package/lib/commonjs/ui/features/TonderPayment/index.js.map +1 -1
  25. package/lib/module/core/BaseEnrollment/index.js +1 -0
  26. package/lib/module/core/BaseEnrollment/index.js.map +1 -1
  27. package/lib/module/core/PaymentInlineContainer/index.js +1 -0
  28. package/lib/module/core/PaymentInlineContainer/index.js.map +1 -1
  29. package/lib/module/types/base.js.map +1 -1
  30. package/lib/module/ui/components/CardForm/index.js +19 -5
  31. package/lib/module/ui/components/CardForm/index.js.map +1 -1
  32. package/lib/module/ui/components/Input/CardCVVInput.js +13 -7
  33. package/lib/module/ui/components/Input/CardCVVInput.js.map +1 -1
  34. package/lib/module/ui/components/Input/CardExpirationDateInput.js +10 -3
  35. package/lib/module/ui/components/Input/CardExpirationDateInput.js.map +1 -1
  36. package/lib/module/ui/components/Input/CardExpirationMonthInput.js +13 -7
  37. package/lib/module/ui/components/Input/CardExpirationMonthInput.js.map +1 -1
  38. package/lib/module/ui/components/Input/CardExpirationYearInput.js +13 -7
  39. package/lib/module/ui/components/Input/CardExpirationYearInput.js.map +1 -1
  40. package/lib/module/ui/components/Input/CardHolderInput.js +13 -7
  41. package/lib/module/ui/components/Input/CardHolderInput.js.map +1 -1
  42. package/lib/module/ui/components/Input/CardNumberInput.js +13 -7
  43. package/lib/module/ui/components/Input/CardNumberInput.js.map +1 -1
  44. package/lib/module/ui/features/TonderEnrollment/index.js +2 -1
  45. package/lib/module/ui/features/TonderEnrollment/index.js.map +1 -1
  46. package/lib/module/ui/features/TonderPayment/index.js +2 -1
  47. package/lib/module/ui/features/TonderPayment/index.js.map +1 -1
  48. package/lib/typescript/commonjs/src/core/BaseEnrollment/index.d.ts.map +1 -1
  49. package/lib/typescript/commonjs/src/core/PaymentInlineContainer/index.d.ts.map +1 -1
  50. package/lib/typescript/commonjs/src/types/base.d.ts +3 -1
  51. package/lib/typescript/commonjs/src/types/base.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/src/types/enrollment.d.ts +3 -1
  53. package/lib/typescript/commonjs/src/types/enrollment.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/src/types/inlineCheckout.d.ts +3 -1
  55. package/lib/typescript/commonjs/src/types/inlineCheckout.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/src/types/input.d.ts +30 -1
  57. package/lib/typescript/commonjs/src/types/input.d.ts.map +1 -1
  58. package/lib/typescript/commonjs/src/ui/components/CardForm/index.d.ts +2 -1
  59. package/lib/typescript/commonjs/src/ui/components/CardForm/index.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/src/ui/components/Input/CardCVVInput.d.ts.map +1 -1
  61. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationDateInput.d.ts +1 -7
  62. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationDateInput.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationMonthInput.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationYearInput.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/src/ui/components/Input/CardHolderInput.d.ts.map +1 -1
  66. package/lib/typescript/commonjs/src/ui/components/Input/CardNumberInput.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/src/ui/features/TonderEnrollment/index.d.ts.map +1 -1
  68. package/lib/typescript/commonjs/src/ui/features/TonderPayment/index.d.ts.map +1 -1
  69. package/lib/typescript/module/src/core/BaseEnrollment/index.d.ts.map +1 -1
  70. package/lib/typescript/module/src/core/PaymentInlineContainer/index.d.ts.map +1 -1
  71. package/lib/typescript/module/src/types/base.d.ts +3 -1
  72. package/lib/typescript/module/src/types/base.d.ts.map +1 -1
  73. package/lib/typescript/module/src/types/enrollment.d.ts +3 -1
  74. package/lib/typescript/module/src/types/enrollment.d.ts.map +1 -1
  75. package/lib/typescript/module/src/types/inlineCheckout.d.ts +3 -1
  76. package/lib/typescript/module/src/types/inlineCheckout.d.ts.map +1 -1
  77. package/lib/typescript/module/src/types/input.d.ts +30 -1
  78. package/lib/typescript/module/src/types/input.d.ts.map +1 -1
  79. package/lib/typescript/module/src/ui/components/CardForm/index.d.ts +2 -1
  80. package/lib/typescript/module/src/ui/components/CardForm/index.d.ts.map +1 -1
  81. package/lib/typescript/module/src/ui/components/Input/CardCVVInput.d.ts.map +1 -1
  82. package/lib/typescript/module/src/ui/components/Input/CardExpirationDateInput.d.ts +1 -7
  83. package/lib/typescript/module/src/ui/components/Input/CardExpirationDateInput.d.ts.map +1 -1
  84. package/lib/typescript/module/src/ui/components/Input/CardExpirationMonthInput.d.ts.map +1 -1
  85. package/lib/typescript/module/src/ui/components/Input/CardExpirationYearInput.d.ts.map +1 -1
  86. package/lib/typescript/module/src/ui/components/Input/CardHolderInput.d.ts.map +1 -1
  87. package/lib/typescript/module/src/ui/components/Input/CardNumberInput.d.ts.map +1 -1
  88. package/lib/typescript/module/src/ui/features/TonderEnrollment/index.d.ts.map +1 -1
  89. package/lib/typescript/module/src/ui/features/TonderPayment/index.d.ts.map +1 -1
  90. package/package.json +1 -1
  91. package/src/core/BaseEnrollment/index.ts +1 -0
  92. package/src/core/PaymentInlineContainer/index.ts +1 -0
  93. package/src/types/base.ts +3 -0
  94. package/src/types/enrollment.ts +3 -1
  95. package/src/types/inlineCheckout.ts +3 -0
  96. package/src/types/input.ts +33 -1
  97. package/src/ui/components/CardForm/index.tsx +16 -0
  98. package/src/ui/components/Input/CardCVVInput.tsx +11 -4
  99. package/src/ui/components/Input/CardExpirationDateInput.tsx +8 -7
  100. package/src/ui/components/Input/CardExpirationMonthInput.tsx +11 -4
  101. package/src/ui/components/Input/CardExpirationYearInput.tsx +11 -4
  102. package/src/ui/components/Input/CardHolderInput.tsx +11 -4
  103. package/src/ui/components/Input/CardNumberInput.tsx +11 -4
  104. package/src/ui/features/TonderEnrollment/index.tsx +1 -0
  105. package/src/ui/features/TonderPayment/index.tsx +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../../src/types/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC"}
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../../src/types/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AACD,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE;QACP,WAAW,CAAC,EAAE,YAAY,CAAC;QAC3B,UAAU,CAAC,EAAE,YAAY,CAAC;KAC3B,CAAC;CACH;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC7C;AAED,MAAM,WAAW,eAAe;IAC9B,gBAAgB,CAAC,EAAE,YAAY,CAAC;IAChC,gBAAgB,CAAC,EAAE,YAAY,CAAC;IAChC,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B;AAED,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { ICardFormStyles, IFormLabels, IFormPlaceholder } from '../../../types';
2
+ import type { ICardFormEvents, ICardFormStyles, IFormLabels, IFormPlaceholder } from '../../../types';
3
3
  interface NewCardFormProps {
4
4
  showSaveOption?: boolean;
5
5
  saveCard: boolean;
@@ -7,6 +7,7 @@ interface NewCardFormProps {
7
7
  labels?: IFormLabels;
8
8
  placeholders?: IFormPlaceholder;
9
9
  style?: ICardFormStyles;
10
+ events?: ICardFormEvents;
10
11
  }
11
12
  export declare const NewCardForm: React.FC<NewCardFormProps>;
12
13
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/CardForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAOxB,UAAU,gBAAgB;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAgDlD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/CardForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,WAAW,EACX,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAOxB,UAAU,gBAAgB;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA8DlD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CardCVVInput.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/Input/CardCVVInput.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAiBjD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAwE7C,CAAC"}
1
+ {"version":3,"file":"CardCVVInput.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/Input/CardCVVInput.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAiBjD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA+E7C,CAAC"}
@@ -1,10 +1,4 @@
1
1
  import React from 'react';
2
- import type { IElementStyle } from '../../../types';
3
- export interface InputExpiryDateProps {
4
- label?: string;
5
- yearPlaceholder?: string;
6
- monthPlaceholder?: string;
7
- style?: IElementStyle;
8
- }
2
+ import type { InputExpiryDateProps } from '../../../types';
9
3
  export declare const CardExpirationDateInput: React.FC<InputExpiryDateProps>;
10
4
  //# sourceMappingURL=CardExpirationDateInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardExpirationDateInput.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/Input/CardExpirationDateInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAepD,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AACD,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAwDlE,CAAC"}
1
+ {"version":3,"file":"CardExpirationDateInput.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/Input/CardExpirationDateInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA+DlE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CardExpirationMonthInput.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/Input/CardExpirationMonthInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAoBjD,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAwEzD,CAAC"}
1
+ {"version":3,"file":"CardExpirationMonthInput.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/Input/CardExpirationMonthInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAoBjD,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA+EzD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CardExpirationYearInput.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/Input/CardExpirationYearInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAkBjD,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAwExD,CAAC"}
1
+ {"version":3,"file":"CardExpirationYearInput.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/Input/CardExpirationYearInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAkBjD,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA+ExD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CardHolderInput.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/Input/CardHolderInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAmBjD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAuEhD,CAAC"}
1
+ {"version":3,"file":"CardHolderInput.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/Input/CardHolderInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAmBjD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA8EhD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CardNumberInput.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/Input/CardNumberInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAkBjD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAuEhD,CAAC"}
1
+ {"version":3,"file":"CardNumberInput.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/Input/CardNumberInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAkBjD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA8EhD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/features/TonderEnrollment/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,WAAW,sBAAsB;CAAG;AAC1C,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAiGtD,CAAC;AAqCF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/features/TonderEnrollment/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,WAAW,sBAAsB;CAAG;AAC1C,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAkGtD,CAAC;AAqCF,eAAe,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/features/TonderPayment/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAexC,MAAM,WAAW,mBAAmB;CAAG;AACvC,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA6LhD,CAAC;AAwCF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/features/TonderPayment/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAexC,MAAM,WAAW,mBAAmB;CAAG;AACvC,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA8LhD,CAAC;AAwCF,eAAe,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tonder.io/rn-sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.5-beta.DEV1404.160516b",
4
4
  "description": "Tonder react native sdk",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -35,6 +35,7 @@ class BaseEnrollment extends BaseSDK {
35
35
  ...data,
36
36
  isCreated: false,
37
37
  isCreating: true,
38
+ events: data.events || {},
38
39
  customization: {
39
40
  ...this.#defaultCustomization,
40
41
  ...(data.customization || {}),
@@ -84,6 +84,7 @@ class PaymentInlineContainer implements IPaymentInlineContainer {
84
84
  paymentMethods: [],
85
85
  cards: [],
86
86
  },
87
+ events: data.events || {},
87
88
  isCreating: true,
88
89
  isCreated: false,
89
90
  });
package/src/types/base.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type {
2
+ ICardFormEvents,
2
3
  IEnrollment,
3
4
  IEnrollmentOptions,
4
5
  IEnrollmentState,
@@ -74,3 +75,5 @@ export type SDKStateInstance<T extends SDKType> = T extends SDKType.INLINE
74
75
  : T extends SDKType.ENROLLMENT
75
76
  ? IEnrollmentState
76
77
  : never;
78
+
79
+ export interface IEvents extends ICardFormEvents {}
@@ -1,4 +1,4 @@
1
- import type { IBaseCreateOptions, IBaseResponse, SDKOptions } from './base';
1
+ import type { IBaseCreateOptions, IBaseResponse, IEvents, SDKOptions } from './base';
2
2
  import type { IBaseEnrollmentState } from './baseEnrollment';
3
3
  import { SDKType } from './base';
4
4
  import type { ISaveCardResponse } from './card';
@@ -10,6 +10,7 @@ export interface IEnrollmentOptions extends IBaseCreateOptions {
10
10
  customer?: ICustomer;
11
11
  customization?: IEnrollmentCustomizationOptions;
12
12
  callbacks?: IEnrollmentCallbacks;
13
+ events?: IEvents;
13
14
  }
14
15
 
15
16
  export interface IEnrollmentCallbacks {
@@ -30,6 +31,7 @@ export interface IEnrollmentCustomizationOptions {
30
31
  export interface IEnrollmentState extends IBaseEnrollmentState {
31
32
  customization?: IEnrollmentCustomizationOptions;
32
33
  callbacks?: IEnrollmentCallbacks;
34
+ events?: IEvents;
33
35
  message: string;
34
36
  }
35
37
  export interface IEnrollment {
@@ -11,6 +11,7 @@ import type {
11
11
  IBaseProcessPaymentRequest,
12
12
  IBaseCallback,
13
13
  IBaseResponse,
14
+ IEvents,
14
15
  } from '.';
15
16
  import { SDKType } from './base';
16
17
  import TonderError from '../shared/utils/errors';
@@ -19,6 +20,7 @@ export interface IInlineCheckoutOptions extends IBaseCreateOptions {
19
20
  paymentData: IBaseProcessPaymentRequest;
20
21
  customization?: IInlineCustomizationOptions;
21
22
  callbacks?: IInlineCallbacks;
23
+ events?: IEvents;
22
24
  returnURL?: string;
23
25
  }
24
26
 
@@ -30,6 +32,7 @@ export interface IInlineCheckoutState
30
32
  };
31
33
  customization?: IInlineCustomizationOptions;
32
34
  callbacks?: IInlineCallbacks;
35
+ events?: IEvents;
33
36
  message: string;
34
37
  customerCards: ICustomerCardsResponse;
35
38
  payment_methods: IPaymentMethod[];
@@ -4,7 +4,39 @@ import type {
4
4
  } from 'skf-rnad';
5
5
  import type { StylesBaseVariant } from './common';
6
6
 
7
- export interface InputProps {
7
+ export interface IEventSecureInput {
8
+ elementType: string;
9
+ isEmpty: boolean;
10
+ isFocused: boolean;
11
+ isValid: boolean;
12
+ value: string;
13
+ }
14
+ export interface InputExpiryDateProps {
15
+ label?: string;
16
+ yearPlaceholder?: string;
17
+ monthPlaceholder?: string;
18
+ style?: IElementStyle;
19
+ events?: {
20
+ monthEvents?: IInputEvents;
21
+ yearEvents?: IInputEvents;
22
+ };
23
+ }
24
+
25
+ export interface IInputEvents {
26
+ onChange?: (event: IEventSecureInput) => void;
27
+ onFocus?: (event: IEventSecureInput) => void;
28
+ onBlur?: (event: IEventSecureInput) => void;
29
+ }
30
+
31
+ export interface ICardFormEvents {
32
+ cardHolderEvents?: IInputEvents;
33
+ cardNumberEvents?: IInputEvents;
34
+ cvvEvents?: IInputEvents;
35
+ monthEvents?: IInputEvents;
36
+ yearEvents?: IInputEvents;
37
+ }
38
+
39
+ export interface InputProps extends IInputEvents {
8
40
  label?: string;
9
41
  placeholder?: string;
10
42
  style?: IElementStyle;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { View, StyleSheet } from 'react-native';
3
3
  import type {
4
+ ICardFormEvents,
4
5
  ICardFormStyles,
5
6
  IFormLabels,
6
7
  IFormPlaceholder,
@@ -18,6 +19,7 @@ interface NewCardFormProps {
18
19
  labels?: IFormLabels;
19
20
  placeholders?: IFormPlaceholder;
20
21
  style?: ICardFormStyles;
22
+ events?: ICardFormEvents;
21
23
  }
22
24
 
23
25
  export const NewCardForm: React.FC<NewCardFormProps> = ({
@@ -27,6 +29,7 @@ export const NewCardForm: React.FC<NewCardFormProps> = ({
27
29
  style,
28
30
  labels,
29
31
  placeholders,
32
+ events,
30
33
  }) => {
31
34
  return (
32
35
  <View style={{ ...styles.container, ...(style?.base || {}) }}>
@@ -34,11 +37,17 @@ export const NewCardForm: React.FC<NewCardFormProps> = ({
34
37
  style={style}
35
38
  label={labels?.name}
36
39
  placeholder={placeholders?.name}
40
+ onBlur={events?.cardHolderEvents?.onBlur}
41
+ onChange={events?.cardHolderEvents?.onChange}
42
+ onFocus={events?.cardHolderEvents?.onFocus}
37
43
  />
38
44
  <CardNumberInput
39
45
  style={style}
40
46
  label={labels?.cardNumber}
41
47
  placeholder={placeholders?.cardNumber}
48
+ onBlur={events?.cardNumberEvents?.onBlur}
49
+ onChange={events?.cardNumberEvents?.onChange}
50
+ onFocus={events?.cardNumberEvents?.onFocus}
42
51
  />
43
52
  <View style={styles.expirationRow}>
44
53
  <CardExpirationDateInput
@@ -46,11 +55,18 @@ export const NewCardForm: React.FC<NewCardFormProps> = ({
46
55
  label={labels?.expiryDate}
47
56
  yearPlaceholder={placeholders?.expiryYear}
48
57
  monthPlaceholder={placeholders?.expiryMonth}
58
+ events={{
59
+ monthEvents: events?.monthEvents,
60
+ yearEvents: events?.yearEvents,
61
+ }}
49
62
  />
50
63
  <CardCVVInput
51
64
  style={style}
52
65
  label={labels?.cvv}
53
66
  placeholder={placeholders?.cvv}
67
+ onBlur={events?.cvvEvents?.onBlur}
68
+ onChange={events?.cvvEvents?.onChange}
69
+ onFocus={events?.cvvEvents?.onFocus}
54
70
  />
55
71
  </View>
56
72
 
@@ -22,6 +22,9 @@ export const CardCVVInput: React.FC<InputProps> = ({
22
22
  placeholder = DEFAULT_SKYFLOW_PLACEHOLDERS.cvvPlaceholder,
23
23
  label = DEFAULT_SKYFLOW_lABELS.cvvLabel,
24
24
  style,
25
+ onFocus,
26
+ onBlur,
27
+ onChange,
25
28
  }) => {
26
29
  const [errorText, setErrorText] = useState('');
27
30
  const { state } = useTonderContext();
@@ -71,12 +74,16 @@ export const CardCVVInput: 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
  />
@@ -1,6 +1,5 @@
1
1
  // @ts-nocheck
2
2
  import React from 'react';
3
- import type { IElementStyle } from '../../../types';
4
3
  import {
5
4
  DEFAULT_SKYFLOW_lABELS,
6
5
  DEFAULT_SKYFLOW_PLACEHOLDERS,
@@ -14,18 +13,14 @@ import {
14
13
  import { DEFAULT_INPUT_CONTAINER_STYLES } from '../../styles/payment';
15
14
  import { CardExpirationMonthInput } from './CardExpirationMonthInput';
16
15
  import { CardExpirationYearInput } from './CardExpirationYearInput';
16
+ import type { InputExpiryDateProps } from '../../../types';
17
17
 
18
- export interface InputExpiryDateProps {
19
- label?: string;
20
- yearPlaceholder?: string;
21
- monthPlaceholder?: string;
22
- style?: IElementStyle;
23
- }
24
18
  export const CardExpirationDateInput: React.FC<InputExpiryDateProps> = ({
25
19
  yearPlaceholder = DEFAULT_SKYFLOW_PLACEHOLDERS.expiryYearPlaceholder,
26
20
  monthPlaceholder = DEFAULT_SKYFLOW_PLACEHOLDERS.expiryMonthPlaceholder,
27
21
  label = DEFAULT_SKYFLOW_lABELS.expiryDateLabel,
28
22
  style,
23
+ events,
29
24
  }) => {
30
25
  return (
31
26
  <View style={styles.container}>
@@ -55,6 +50,9 @@ export const CardExpirationDateInput: React.FC<InputExpiryDateProps> = ({
55
50
  },
56
51
  } as StyleProp<TextStyle>),
57
52
  }}
53
+ onBlur={events?.monthEvents?.onBlur}
54
+ onChange={events?.monthEvents?.onChange}
55
+ onFocus={events?.monthEvents?.onFocus}
58
56
  />
59
57
  <CardExpirationYearInput
60
58
  label={''}
@@ -73,6 +71,9 @@ export const CardExpirationDateInput: React.FC<InputExpiryDateProps> = ({
73
71
  },
74
72
  } as StyleProp<TextStyle>),
75
73
  }}
74
+ onBlur={events?.yearEvents?.onBlur}
75
+ onChange={events?.yearEvents?.onChange}
76
+ onFocus={events?.yearEvents?.onFocus}
76
77
  />
77
78
  </View>
78
79
  </View>
@@ -24,6 +24,9 @@ export const CardExpirationMonthInput: React.FC<InputProps> = ({
24
24
  placeholder = DEFAULT_SKYFLOW_PLACEHOLDERS.expiryMonthPlaceholder,
25
25
  label = DEFAULT_SKYFLOW_lABELS.expiryMonthLabel,
26
26
  style,
27
+ onFocus,
28
+ onBlur,
29
+ onChange,
27
30
  }) => {
28
31
  const { state } = useTonderContext();
29
32
  const [errorText, setErrorText] = useState('');
@@ -74,12 +77,16 @@ export const CardExpirationMonthInput: React.FC<InputProps> = ({
74
77
  }
75
78
  : {}),
76
79
  }}
77
- onChange={() => {
80
+ onChange={(event) => {
78
81
  setErrorText('');
82
+ if (onChange) onChange(event);
79
83
  }}
80
- // onFocus={props.onFocus}
81
- onBlur={(e) => {
82
- setErrorText(getErrorField(e, label));
84
+ onFocus={(event) => {
85
+ if (onFocus) onFocus(event);
86
+ }}
87
+ onBlur={(event) => {
88
+ setErrorText(getErrorField(event, label));
89
+ if (onBlur) onBlur(event);
83
90
  }}
84
91
  // onReady={props.onReady}
85
92
  />
@@ -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 && (