react-native-tpay 1.3.6 → 1.3.8

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 (243) hide show
  1. package/README.md +2 -0
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/tpay/util/JsonUtil.kt +5 -0
  4. package/ios/Source/Configuration/TransactionConfiguration.swift +11 -11
  5. package/ios/Source/Model/Domain/BankPayment.swift +1 -1
  6. package/ios/Source/Model/Domain/BlikPayment.swift +1 -1
  7. package/ios/Source/Model/Domain/CardPayment.swift +1 -1
  8. package/ios/Source/Model/Domain/DigitalWalletPayment.swift +1 -1
  9. package/ios/Source/Model/Domain/PayPoPayment.swift +1 -1
  10. package/ios/Source/TpaySDK.swift +15 -3
  11. package/lib/commonjs/NativeTpay.js +9 -0
  12. package/lib/commonjs/NativeTpay.js.map +1 -0
  13. package/lib/commonjs/component/tpay_button.js +10 -7
  14. package/lib/commonjs/component/tpay_button.js.map +1 -1
  15. package/lib/commonjs/index.js.map +1 -1
  16. package/lib/commonjs/model/language/language.js.map +1 -1
  17. package/lib/commonjs/model/language/languages.js.map +1 -1
  18. package/lib/commonjs/model/language/localized_string.js.map +1 -1
  19. package/lib/commonjs/model/merchant/apple_pay_configuration.js.map +1 -1
  20. package/lib/commonjs/model/merchant/certificate_configuration.js.map +1 -1
  21. package/lib/commonjs/model/merchant/google_pay_configuration.js.map +1 -1
  22. package/lib/commonjs/model/merchant/merchant.js.map +1 -1
  23. package/lib/commonjs/model/merchant/merchant_authorization.js.map +1 -1
  24. package/lib/commonjs/model/merchant/merchant_details.js.map +1 -1
  25. package/lib/commonjs/model/merchant/tpay_environment.js.map +1 -1
  26. package/lib/commonjs/model/merchant/wallet_configuration.js.map +1 -1
  27. package/lib/commonjs/model/payer/address.js.map +1 -1
  28. package/lib/commonjs/model/payer/payer.js.map +1 -1
  29. package/lib/commonjs/model/payer/payer_context.js.map +1 -1
  30. package/lib/commonjs/model/payment_channel/payment_channel.js.map +1 -1
  31. package/lib/commonjs/model/payment_channel/payment_constraint.js.map +1 -1
  32. package/lib/commonjs/model/payment_channel/payment_group.js.map +1 -1
  33. package/lib/commonjs/model/payment_method/automatic_payment_methods.js.map +1 -1
  34. package/lib/commonjs/model/payment_method/blik_alias.js.map +1 -1
  35. package/lib/commonjs/model/payment_method/credit_card_brand.js.map +1 -1
  36. package/lib/commonjs/model/payment_method/digital_wallet.js.map +1 -1
  37. package/lib/commonjs/model/payment_method/installment_payment.js.map +1 -1
  38. package/lib/commonjs/model/payment_method/payment_method.js.map +1 -1
  39. package/lib/commonjs/model/payment_method/payment_methods.js.map +1 -1
  40. package/lib/commonjs/model/payment_method/tokenized_card.js.map +1 -1
  41. package/lib/commonjs/model/result/google_pay_configure_result.js +4 -1
  42. package/lib/commonjs/model/result/google_pay_configure_result.js.map +1 -1
  43. package/lib/commonjs/model/result/google_pay_open_result.js +10 -3
  44. package/lib/commonjs/model/result/google_pay_open_result.js.map +1 -1
  45. package/lib/commonjs/model/result/payment_channels_result.js +2 -0
  46. package/lib/commonjs/model/result/payment_channels_result.js.map +1 -1
  47. package/lib/commonjs/model/result/result.js +17 -4
  48. package/lib/commonjs/model/result/result.js.map +1 -1
  49. package/lib/commonjs/model/result/screenless_result.js +7 -0
  50. package/lib/commonjs/model/result/screenless_result.js.map +1 -1
  51. package/lib/commonjs/model/screenless/ambiguous_alias.js.map +1 -1
  52. package/lib/commonjs/model/screenless/ambiguous_blik_payment.js.map +1 -1
  53. package/lib/commonjs/model/screenless/apple_pay_payment.js.map +1 -1
  54. package/lib/commonjs/model/screenless/blik_payment.js.map +1 -1
  55. package/lib/commonjs/model/screenless/callbacks.js.map +1 -1
  56. package/lib/commonjs/model/screenless/credit_card.js.map +1 -1
  57. package/lib/commonjs/model/screenless/credit_card_config.js.map +1 -1
  58. package/lib/commonjs/model/screenless/credit_card_payment.js.map +1 -1
  59. package/lib/commonjs/model/screenless/expiration_date.js.map +1 -1
  60. package/lib/commonjs/model/screenless/frequency.js.map +1 -1
  61. package/lib/commonjs/model/screenless/google_pay_environment.js.map +1 -1
  62. package/lib/commonjs/model/screenless/google_pay_payment.js.map +1 -1
  63. package/lib/commonjs/model/screenless/google_pay_utils_configuration.js.map +1 -1
  64. package/lib/commonjs/model/screenless/notifications.js.map +1 -1
  65. package/lib/commonjs/model/screenless/pay_po_payment.js.map +1 -1
  66. package/lib/commonjs/model/screenless/payment_details.js.map +1 -1
  67. package/lib/commonjs/model/screenless/raty_pekao_payment.js.map +1 -1
  68. package/lib/commonjs/model/screenless/recursive.js.map +1 -1
  69. package/lib/commonjs/model/screenless/redirects.js.map +1 -1
  70. package/lib/commonjs/model/screenless/screenless_payment.js.map +1 -1
  71. package/lib/commonjs/model/screenless/transfer_payment.js.map +1 -1
  72. package/lib/commonjs/model/tokenization/tokenization.js.map +1 -1
  73. package/lib/commonjs/model/tpay_configuration.js.map +1 -1
  74. package/lib/commonjs/model/transaction/single_transaction.js +3 -2
  75. package/lib/commonjs/model/transaction/single_transaction.js.map +1 -1
  76. package/lib/commonjs/model/transaction/token_payment.js +3 -2
  77. package/lib/commonjs/model/transaction/token_payment.js.map +1 -1
  78. package/lib/commonjs/model/transaction/transaction.js +3 -1
  79. package/lib/commonjs/model/transaction/transaction.js.map +1 -1
  80. package/lib/commonjs/package.json +1 -0
  81. package/lib/commonjs/util/google_pay_configuration_util.js.map +1 -1
  82. package/lib/commonjs/util/google_pay_open_util.js.map +1 -1
  83. package/lib/commonjs/util/payment_channels_util.js.map +1 -1
  84. package/lib/commonjs/util/result_util.js.map +1 -1
  85. package/lib/commonjs/util/screenless_result_util.js.map +1 -1
  86. package/lib/module/NativeTpay.js +5 -0
  87. package/lib/module/NativeTpay.js.map +1 -0
  88. package/lib/module/component/tpay_button.js +12 -7
  89. package/lib/module/component/tpay_button.js.map +1 -1
  90. package/lib/module/index.js +2 -0
  91. package/lib/module/index.js.map +1 -1
  92. package/lib/module/model/language/language.js +2 -0
  93. package/lib/module/model/language/language.js.map +1 -1
  94. package/lib/module/model/language/languages.js +2 -0
  95. package/lib/module/model/language/languages.js.map +1 -1
  96. package/lib/module/model/language/localized_string.js +2 -0
  97. package/lib/module/model/language/localized_string.js.map +1 -1
  98. package/lib/module/model/merchant/apple_pay_configuration.js +2 -0
  99. package/lib/module/model/merchant/apple_pay_configuration.js.map +1 -1
  100. package/lib/module/model/merchant/certificate_configuration.js +2 -0
  101. package/lib/module/model/merchant/certificate_configuration.js.map +1 -1
  102. package/lib/module/model/merchant/google_pay_configuration.js +2 -0
  103. package/lib/module/model/merchant/google_pay_configuration.js.map +1 -1
  104. package/lib/module/model/merchant/merchant.js +2 -0
  105. package/lib/module/model/merchant/merchant.js.map +1 -1
  106. package/lib/module/model/merchant/merchant_authorization.js +2 -0
  107. package/lib/module/model/merchant/merchant_authorization.js.map +1 -1
  108. package/lib/module/model/merchant/merchant_details.js +2 -0
  109. package/lib/module/model/merchant/merchant_details.js.map +1 -1
  110. package/lib/module/model/merchant/tpay_environment.js +2 -0
  111. package/lib/module/model/merchant/tpay_environment.js.map +1 -1
  112. package/lib/module/model/merchant/wallet_configuration.js +2 -0
  113. package/lib/module/model/merchant/wallet_configuration.js.map +1 -1
  114. package/lib/module/model/payer/address.js +2 -0
  115. package/lib/module/model/payer/address.js.map +1 -1
  116. package/lib/module/model/payer/payer.js +2 -0
  117. package/lib/module/model/payer/payer.js.map +1 -1
  118. package/lib/module/model/payer/payer_context.js +2 -0
  119. package/lib/module/model/payer/payer_context.js.map +1 -1
  120. package/lib/module/model/payment_channel/payment_channel.js +2 -0
  121. package/lib/module/model/payment_channel/payment_channel.js.map +1 -1
  122. package/lib/module/model/payment_channel/payment_constraint.js +2 -0
  123. package/lib/module/model/payment_channel/payment_constraint.js.map +1 -1
  124. package/lib/module/model/payment_channel/payment_group.js +2 -0
  125. package/lib/module/model/payment_channel/payment_group.js.map +1 -1
  126. package/lib/module/model/payment_method/automatic_payment_methods.js +2 -0
  127. package/lib/module/model/payment_method/automatic_payment_methods.js.map +1 -1
  128. package/lib/module/model/payment_method/blik_alias.js +2 -0
  129. package/lib/module/model/payment_method/blik_alias.js.map +1 -1
  130. package/lib/module/model/payment_method/credit_card_brand.js +2 -0
  131. package/lib/module/model/payment_method/credit_card_brand.js.map +1 -1
  132. package/lib/module/model/payment_method/digital_wallet.js +2 -0
  133. package/lib/module/model/payment_method/digital_wallet.js.map +1 -1
  134. package/lib/module/model/payment_method/installment_payment.js +2 -0
  135. package/lib/module/model/payment_method/installment_payment.js.map +1 -1
  136. package/lib/module/model/payment_method/payment_method.js +2 -0
  137. package/lib/module/model/payment_method/payment_method.js.map +1 -1
  138. package/lib/module/model/payment_method/payment_methods.js +2 -0
  139. package/lib/module/model/payment_method/payment_methods.js.map +1 -1
  140. package/lib/module/model/payment_method/tokenized_card.js +2 -0
  141. package/lib/module/model/payment_method/tokenized_card.js.map +1 -1
  142. package/lib/module/model/result/google_pay_configure_result.js +6 -1
  143. package/lib/module/model/result/google_pay_configure_result.js.map +1 -1
  144. package/lib/module/model/result/google_pay_open_result.js +12 -3
  145. package/lib/module/model/result/google_pay_open_result.js.map +1 -1
  146. package/lib/module/model/result/payment_channels_result.js +4 -0
  147. package/lib/module/model/result/payment_channels_result.js.map +1 -1
  148. package/lib/module/model/result/result.js +19 -4
  149. package/lib/module/model/result/result.js.map +1 -1
  150. package/lib/module/model/result/screenless_result.js +9 -0
  151. package/lib/module/model/result/screenless_result.js.map +1 -1
  152. package/lib/module/model/screenless/ambiguous_alias.js +2 -0
  153. package/lib/module/model/screenless/ambiguous_alias.js.map +1 -1
  154. package/lib/module/model/screenless/ambiguous_blik_payment.js +2 -0
  155. package/lib/module/model/screenless/ambiguous_blik_payment.js.map +1 -1
  156. package/lib/module/model/screenless/apple_pay_payment.js +2 -0
  157. package/lib/module/model/screenless/apple_pay_payment.js.map +1 -1
  158. package/lib/module/model/screenless/blik_payment.js +2 -0
  159. package/lib/module/model/screenless/blik_payment.js.map +1 -1
  160. package/lib/module/model/screenless/callbacks.js +2 -0
  161. package/lib/module/model/screenless/callbacks.js.map +1 -1
  162. package/lib/module/model/screenless/credit_card.js +2 -0
  163. package/lib/module/model/screenless/credit_card.js.map +1 -1
  164. package/lib/module/model/screenless/credit_card_config.js +2 -0
  165. package/lib/module/model/screenless/credit_card_config.js.map +1 -1
  166. package/lib/module/model/screenless/credit_card_payment.js +2 -0
  167. package/lib/module/model/screenless/credit_card_payment.js.map +1 -1
  168. package/lib/module/model/screenless/expiration_date.js +2 -0
  169. package/lib/module/model/screenless/expiration_date.js.map +1 -1
  170. package/lib/module/model/screenless/frequency.js +2 -0
  171. package/lib/module/model/screenless/frequency.js.map +1 -1
  172. package/lib/module/model/screenless/google_pay_environment.js +2 -0
  173. package/lib/module/model/screenless/google_pay_environment.js.map +1 -1
  174. package/lib/module/model/screenless/google_pay_payment.js +2 -0
  175. package/lib/module/model/screenless/google_pay_payment.js.map +1 -1
  176. package/lib/module/model/screenless/google_pay_utils_configuration.js +2 -0
  177. package/lib/module/model/screenless/google_pay_utils_configuration.js.map +1 -1
  178. package/lib/module/model/screenless/notifications.js +2 -0
  179. package/lib/module/model/screenless/notifications.js.map +1 -1
  180. package/lib/module/model/screenless/pay_po_payment.js +2 -0
  181. package/lib/module/model/screenless/pay_po_payment.js.map +1 -1
  182. package/lib/module/model/screenless/payment_details.js +2 -0
  183. package/lib/module/model/screenless/payment_details.js.map +1 -1
  184. package/lib/module/model/screenless/raty_pekao_payment.js +2 -0
  185. package/lib/module/model/screenless/raty_pekao_payment.js.map +1 -1
  186. package/lib/module/model/screenless/recursive.js +2 -0
  187. package/lib/module/model/screenless/recursive.js.map +1 -1
  188. package/lib/module/model/screenless/redirects.js +2 -0
  189. package/lib/module/model/screenless/redirects.js.map +1 -1
  190. package/lib/module/model/screenless/screenless_payment.js +2 -0
  191. package/lib/module/model/screenless/screenless_payment.js.map +1 -1
  192. package/lib/module/model/screenless/transfer_payment.js +2 -0
  193. package/lib/module/model/screenless/transfer_payment.js.map +1 -1
  194. package/lib/module/model/tokenization/tokenization.js +2 -0
  195. package/lib/module/model/tokenization/tokenization.js.map +1 -1
  196. package/lib/module/model/tpay_configuration.js +2 -0
  197. package/lib/module/model/tpay_configuration.js.map +1 -1
  198. package/lib/module/model/transaction/single_transaction.js +5 -2
  199. package/lib/module/model/transaction/single_transaction.js.map +1 -1
  200. package/lib/module/model/transaction/token_payment.js +5 -2
  201. package/lib/module/model/transaction/token_payment.js.map +1 -1
  202. package/lib/module/model/transaction/transaction.js +5 -1
  203. package/lib/module/model/transaction/transaction.js.map +1 -1
  204. package/lib/module/util/google_pay_configuration_util.js +2 -0
  205. package/lib/module/util/google_pay_configuration_util.js.map +1 -1
  206. package/lib/module/util/google_pay_open_util.js +2 -0
  207. package/lib/module/util/google_pay_open_util.js.map +1 -1
  208. package/lib/module/util/payment_channels_util.js +2 -0
  209. package/lib/module/util/payment_channels_util.js.map +1 -1
  210. package/lib/module/util/result_util.js +2 -0
  211. package/lib/module/util/result_util.js.map +1 -1
  212. package/lib/module/util/screenless_result_util.js +2 -0
  213. package/lib/module/util/screenless_result_util.js.map +1 -1
  214. package/lib/typescript/src/NativeTpay.d.ts +22 -0
  215. package/lib/typescript/src/NativeTpay.d.ts.map +1 -0
  216. package/lib/typescript/src/component/tpay_button.d.ts +1 -2
  217. package/lib/typescript/src/component/tpay_button.d.ts.map +1 -1
  218. package/lib/typescript/src/model/result/google_pay_configure_result.d.ts +11 -1
  219. package/lib/typescript/src/model/result/google_pay_configure_result.d.ts.map +1 -1
  220. package/lib/typescript/src/model/result/google_pay_open_result.d.ts +25 -1
  221. package/lib/typescript/src/model/result/google_pay_open_result.d.ts.map +1 -1
  222. package/lib/typescript/src/model/result/payment_channels_result.d.ts +15 -1
  223. package/lib/typescript/src/model/result/payment_channels_result.d.ts.map +1 -1
  224. package/lib/typescript/src/model/result/result.d.ts +26 -1
  225. package/lib/typescript/src/model/result/result.d.ts.map +1 -1
  226. package/lib/typescript/src/model/result/screenless_result.d.ts +32 -1
  227. package/lib/typescript/src/model/result/screenless_result.d.ts.map +1 -1
  228. package/lib/typescript/src/model/transaction/single_transaction.d.ts +2 -1
  229. package/lib/typescript/src/model/transaction/single_transaction.d.ts.map +1 -1
  230. package/lib/typescript/src/model/transaction/token_payment.d.ts +2 -1
  231. package/lib/typescript/src/model/transaction/token_payment.d.ts.map +1 -1
  232. package/lib/typescript/src/model/transaction/transaction.d.ts +3 -1
  233. package/lib/typescript/src/model/transaction/transaction.d.ts.map +1 -1
  234. package/package.json +34 -26
  235. package/src/NativeTpay.ts +33 -0
  236. package/src/model/result/google_pay_configure_result.ts +15 -2
  237. package/src/model/result/google_pay_open_result.ts +36 -4
  238. package/src/model/result/payment_channels_result.ts +18 -1
  239. package/src/model/result/result.ts +38 -5
  240. package/src/model/result/screenless_result.ts +38 -1
  241. package/src/model/transaction/single_transaction.ts +3 -1
  242. package/src/model/transaction/token_payment.ts +3 -1
  243. package/src/model/transaction/transaction.ts +4 -0
@@ -1,32 +1,61 @@
1
1
  /**
2
2
  * Indicates a result of Tpay UI module action
3
3
  */
4
- export class Result {}
4
+ export abstract class Result {
5
+ /**
6
+ * Type identifier for the result
7
+ */
8
+ abstract readonly type: string;
9
+
10
+ /**
11
+ * Optional error message or additional information
12
+ */
13
+ message?: string;
14
+
15
+ /**
16
+ * Transaction ID when applicable
17
+ */
18
+ transactionId?: string | null;
19
+
20
+ /**
21
+ * Payment URL for continuation (used in screenless payments)
22
+ */
23
+ paymentUrl?: string;
24
+ }
5
25
 
6
26
  /**
7
27
  * Indicates that credit card tokenization was successful and module was closed
8
28
  */
9
- export class TokenizationCompleted extends Result {}
29
+ export class TokenizationCompleted extends Result {
30
+ readonly type = 'tokenizationCompleted';
31
+ }
10
32
 
11
33
  /**
12
34
  * Indicates that credit card tokenization failed and module was closed
13
35
  */
14
- export class TokenizationFailure extends Result {}
36
+ export class TokenizationFailure extends Result {
37
+ readonly type = 'tokenizationFailure';
38
+ }
15
39
 
16
40
  /**
17
41
  * Indicates that configuration was successful
18
42
  */
19
- export class ConfigurationSuccess extends Result {}
43
+ export class ConfigurationSuccess extends Result {
44
+ readonly type = 'configurationSuccess';
45
+ }
20
46
 
21
47
  /**
22
48
  * Indicates that user closed the module without making a payment/tokenization
23
49
  */
24
- export class ModuleClosed extends Result {}
50
+ export class ModuleClosed extends Result {
51
+ readonly type = 'moduleClosed';
52
+ }
25
53
 
26
54
  /**
27
55
  * Indicates that some data passed to module is invalid
28
56
  */
29
57
  export class ValidationError extends Result {
58
+ readonly type = 'validationError';
30
59
  /**
31
60
  * Validation error message
32
61
  */
@@ -42,6 +71,7 @@ export class ValidationError extends Result {
42
71
  * Indicates that payment was successfully created
43
72
  */
44
73
  export class PaymentCreated extends Result {
74
+ readonly type = 'paymentCreated';
45
75
  /**
46
76
  * Transaction id of the created transaction
47
77
  */
@@ -57,6 +87,7 @@ export class PaymentCreated extends Result {
57
87
  * Indicates that payment was successful and module was closed
58
88
  */
59
89
  export class PaymentCompleted extends Result {
90
+ readonly type = 'paymentCompleted';
60
91
  /**
61
92
  * Transaction id of the completed transaction
62
93
  */
@@ -72,6 +103,7 @@ export class PaymentCompleted extends Result {
72
103
  * Indicates that payment failed and module was closed
73
104
  */
74
105
  export class PaymentCancelled extends Result {
106
+ readonly type = 'paymentCancelled';
75
107
  /**
76
108
  * If exists, id of the transaction
77
109
  */
@@ -87,6 +119,7 @@ export class PaymentCancelled extends Result {
87
119
  * Indicates a module error
88
120
  */
89
121
  export class MethodCallError extends Result {
122
+ readonly type = 'methodCallError';
90
123
  /**
91
124
  * Error message
92
125
  */
@@ -3,12 +3,43 @@ import { AmbiguousAlias } from 'react-native-tpay';
3
3
  /**
4
4
  * Indicates a result of screenless action
5
5
  */
6
- export class ScreenlessResult {}
6
+ export abstract class ScreenlessResult {
7
+ /**
8
+ * Type identifier for the result
9
+ */
10
+ abstract readonly type: string;
11
+
12
+ /**
13
+ * Optional error message or additional information
14
+ */
15
+ message?: string;
16
+
17
+ /**
18
+ * Transaction ID when applicable
19
+ */
20
+ transactionId?: string;
21
+
22
+ /**
23
+ * Payment URL for continuation when applicable
24
+ */
25
+ paymentUrl?: string | null;
26
+
27
+ /**
28
+ * Error message when applicable
29
+ */
30
+ error?: string | null;
31
+
32
+ /**
33
+ * Ambiguous aliases for BLIK payments when applicable
34
+ */
35
+ aliases?: Array<AmbiguousAlias>;
36
+ }
7
37
 
8
38
  /**
9
39
  * Indicates that some data passed to payment is invalid
10
40
  */
11
41
  export class ScreenlessValidationError extends ScreenlessResult {
42
+ readonly type = 'validationError';
12
43
  /**
13
44
  * Validation error message
14
45
  */
@@ -24,6 +55,7 @@ export class ScreenlessValidationError extends ScreenlessResult {
24
55
  * Indicates a module error
25
56
  */
26
57
  export class ScreenlessMethodCallError extends ScreenlessResult {
58
+ readonly type = 'methodCallError';
27
59
  /**
28
60
  * Error message
29
61
  */
@@ -39,6 +71,7 @@ export class ScreenlessMethodCallError extends ScreenlessResult {
39
71
  * Indicates that payment was completed successfully
40
72
  */
41
73
  export class ScreenlessPaid extends ScreenlessResult {
74
+ readonly type = 'paid';
42
75
  /**
43
76
  * Transaction id of the completed transaction
44
77
  */
@@ -59,6 +92,7 @@ export class ScreenlessPaid extends ScreenlessResult {
59
92
  * payment status via transactionId.
60
93
  */
61
94
  export class ScreenlessPaymentCreated extends ScreenlessResult {
95
+ readonly type = 'paymentCreated';
62
96
  /**
63
97
  * Transaction id of the created transaction
64
98
  */
@@ -82,6 +116,7 @@ export class ScreenlessPaymentCreated extends ScreenlessResult {
82
116
  * - BLIK code or BLIK alias
83
117
  */
84
118
  export class ScreenlessConfiguredPaymentFailed extends ScreenlessResult {
119
+ readonly type = 'configuredPaymentFailed';
85
120
  /**
86
121
  * Transaction id of the created transaction
87
122
  */
@@ -105,6 +140,7 @@ export class ScreenlessConfiguredPaymentFailed extends ScreenlessResult {
105
140
  * continue the payment.
106
141
  */
107
142
  export class ScreenlessBlikAmbiguousAlias extends ScreenlessResult {
143
+ readonly type = 'ambiguousAlias';
108
144
  /**
109
145
  * Transaction id of the created transaction
110
146
  */
@@ -126,6 +162,7 @@ export class ScreenlessBlikAmbiguousAlias extends ScreenlessResult {
126
162
  * Indicates that payment was not created because of an error
127
163
  */
128
164
  export class ScreenlessPaymentError extends ScreenlessResult {
165
+ readonly type = 'error';
129
166
  /**
130
167
  * Optional error message
131
168
  */
@@ -12,15 +12,17 @@ export class SingleTransaction extends Transaction {
12
12
  * @param payerContext - information about payer and automatic payment methods
13
13
  * @param amount - amount of money payer has to pay
14
14
  * @param description - description of payment shown to payer
15
+ * @param hiddenDescription - description of payment shown to merchant
15
16
  * @param notifications - payment notification url and email
16
17
  */
17
18
  constructor(
18
19
  payerContext: PayerContext,
19
20
  amount: number,
20
21
  description: string,
22
+ hiddenDescription: string | null,
21
23
  notifications: Notifications | null
22
24
  ) {
23
- super(amount, description, notifications);
25
+ super(amount, description, hiddenDescription, notifications);
24
26
  this.payerContext = payerContext;
25
27
  }
26
28
  }
@@ -14,6 +14,7 @@ export class TokenPayment extends Transaction {
14
14
  * @param payer - payer information
15
15
  * @param amount - amount of money payer has to pay
16
16
  * @param description - description of payment shown to payer
17
+ * @param hiddenDescription - description of payment shown to merchant
17
18
  * @param notifications - payment notification url and email
18
19
  */
19
20
  constructor(
@@ -21,9 +22,10 @@ export class TokenPayment extends Transaction {
21
22
  payer: Payer,
22
23
  amount: number,
23
24
  description: string,
25
+ hiddenDescription: string | null,
24
26
  notifications: Notifications | null
25
27
  ) {
26
- super(amount, description, notifications);
28
+ super(amount, description, hiddenDescription, notifications);
27
29
  this.cardToken = cardToken;
28
30
  this.payer = payer;
29
31
  }
@@ -6,20 +6,24 @@ import type { Notifications } from "../screenless/notifications";
6
6
  export class Transaction {
7
7
  amount: number;
8
8
  description: string;
9
+ hiddenDescription: string | null;
9
10
  notifications: Notifications | null;
10
11
 
11
12
  /**
12
13
  * @param amount - amount of money payer has to pay
13
14
  * @param description - description of payment shown to payer
15
+ * @param hiddenDescription - description of payment shown to merchant
14
16
  * @param notifications - payment notification url and email
15
17
  */
16
18
  constructor(
17
19
  amount: number,
18
20
  description: string,
21
+ hiddenDescription: string | null,
19
22
  notifications: Notifications | null
20
23
  ) {
21
24
  this.amount = amount;
22
25
  this.description = description;
26
+ this.hiddenDescription = hiddenDescription;
23
27
  this.notifications = notifications;
24
28
  }
25
29
  }