@unchainedshop/plugins 1.1.3 → 1.1.7

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 (332) hide show
  1. package/lib/delivery/pick-mup.d.ts +1 -0
  2. package/lib/delivery/pick-mup.js +98 -0
  3. package/lib/delivery/pick-mup.js.map +1 -0
  4. package/lib/delivery/post.d.ts +1 -0
  5. package/lib/delivery/post.js +23 -0
  6. package/lib/delivery/post.js.map +1 -0
  7. package/lib/delivery/send-message.d.ts +1 -0
  8. package/lib/delivery/send-message.js +41 -0
  9. package/lib/delivery/send-message.js.map +1 -0
  10. package/lib/delivery/stores.d.ts +1 -0
  11. package/lib/delivery/stores.js +39 -0
  12. package/lib/delivery/stores.js.map +1 -0
  13. package/lib/enrollments/licensed.d.ts +1 -0
  14. package/lib/enrollments/licensed.js +40 -0
  15. package/lib/enrollments/licensed.js.map +1 -0
  16. package/lib/files/gridfs/gridfs-adapter.js +1 -1
  17. package/lib/files/gridfs/gridfs-adapter.js.map +1 -1
  18. package/lib/files/gridfs/gridfs-webhook.js +2 -2
  19. package/lib/files/gridfs/gridfs-webhook.js.map +1 -1
  20. package/lib/files/minio/minio-webhook.js +1 -1
  21. package/lib/files/minio/minio-webhook.js.map +1 -1
  22. package/lib/filters/local-search.d.ts +3 -0
  23. package/lib/filters/local-search.js +84 -0
  24. package/lib/filters/local-search.js.map +1 -0
  25. package/lib/filters/strict-equal.d.ts +1 -0
  26. package/lib/filters/strict-equal.js +25 -0
  27. package/lib/filters/strict-equal.js.map +1 -0
  28. package/lib/payment/apple-iap/adapter.d.ts +1 -0
  29. package/lib/payment/apple-iap/adapter.js +284 -0
  30. package/lib/payment/apple-iap/adapter.js.map +1 -0
  31. package/lib/payment/apple-iap/db/AppleTransactionsCollection.d.ts +7 -0
  32. package/lib/payment/apple-iap/db/AppleTransactionsCollection.js +5 -0
  33. package/lib/payment/apple-iap/db/AppleTransactionsCollection.js.map +1 -0
  34. package/lib/payment/apple-iap/index.d.ts +2 -0
  35. package/lib/payment/apple-iap/index.js +3 -0
  36. package/lib/payment/apple-iap/index.js.map +1 -0
  37. package/lib/payment/apple-iap/module/configureAppleTransactionsModule.d.ts +9 -0
  38. package/lib/payment/apple-iap/module/configureAppleTransactionsModule.js +18 -0
  39. package/lib/payment/apple-iap/module/configureAppleTransactionsModule.js.map +1 -0
  40. package/lib/payment/bity/adapter.d.ts +1 -0
  41. package/lib/payment/bity/adapter.js +316 -0
  42. package/lib/payment/bity/adapter.js.map +1 -0
  43. package/lib/payment/bity/db/BityCredentialsCollection.d.ts +11 -0
  44. package/lib/payment/bity/db/BityCredentialsCollection.js +5 -0
  45. package/lib/payment/bity/db/BityCredentialsCollection.js.map +1 -0
  46. package/lib/payment/bity/index.d.ts +2 -0
  47. package/lib/payment/bity/index.js +3 -0
  48. package/lib/payment/bity/index.js.map +1 -0
  49. package/lib/payment/bity/module/configureBityModule.d.ts +11 -0
  50. package/lib/payment/bity/module/configureBityModule.js +33 -0
  51. package/lib/payment/bity/module/configureBityModule.js.map +1 -0
  52. package/lib/payment/braintree.d.ts +1 -0
  53. package/lib/payment/braintree.js +129 -0
  54. package/lib/payment/braintree.js.map +1 -0
  55. package/lib/payment/cryptopay.d.ts +1 -0
  56. package/lib/payment/cryptopay.js +159 -0
  57. package/lib/payment/cryptopay.js.map +1 -0
  58. package/lib/payment/datatrans-v2/api/authorize.d.ts +2 -0
  59. package/lib/payment/datatrans-v2/api/authorize.js +12 -0
  60. package/lib/payment/datatrans-v2/api/authorize.js.map +1 -0
  61. package/lib/payment/datatrans-v2/api/authorizeAuthenticated.d.ts +2 -0
  62. package/lib/payment/datatrans-v2/api/authorizeAuthenticated.js +11 -0
  63. package/lib/payment/datatrans-v2/api/authorizeAuthenticated.js.map +1 -0
  64. package/lib/payment/datatrans-v2/api/cancel.d.ts +2 -0
  65. package/lib/payment/datatrans-v2/api/cancel.js +10 -0
  66. package/lib/payment/datatrans-v2/api/cancel.js.map +1 -0
  67. package/lib/payment/datatrans-v2/api/index.d.ts +19 -0
  68. package/lib/payment/datatrans-v2/api/index.js +24 -0
  69. package/lib/payment/datatrans-v2/api/index.js.map +1 -0
  70. package/lib/payment/datatrans-v2/api/init.d.ts +2 -0
  71. package/lib/payment/datatrans-v2/api/init.js +31 -0
  72. package/lib/payment/datatrans-v2/api/init.js.map +1 -0
  73. package/lib/payment/datatrans-v2/api/makeFetcher.d.ts +2 -0
  74. package/lib/payment/datatrans-v2/api/makeFetcher.js +41 -0
  75. package/lib/payment/datatrans-v2/api/makeFetcher.js.map +1 -0
  76. package/lib/payment/datatrans-v2/api/secureFields.d.ts +2 -0
  77. package/lib/payment/datatrans-v2/api/secureFields.js +14 -0
  78. package/lib/payment/datatrans-v2/api/secureFields.js.map +1 -0
  79. package/lib/payment/datatrans-v2/api/settle.d.ts +2 -0
  80. package/lib/payment/datatrans-v2/api/settle.js +10 -0
  81. package/lib/payment/datatrans-v2/api/settle.js.map +1 -0
  82. package/lib/payment/datatrans-v2/api/status.d.ts +2 -0
  83. package/lib/payment/datatrans-v2/api/status.js +7 -0
  84. package/lib/payment/datatrans-v2/api/status.js.map +1 -0
  85. package/lib/payment/datatrans-v2/api/validate.d.ts +2 -0
  86. package/lib/payment/datatrans-v2/api/validate.js +10 -0
  87. package/lib/payment/datatrans-v2/api/validate.js.map +1 -0
  88. package/lib/payment/datatrans-v2/generateSignature.d.ts +10 -0
  89. package/lib/payment/datatrans-v2/generateSignature.js +19 -0
  90. package/lib/payment/datatrans-v2/generateSignature.js.map +1 -0
  91. package/lib/payment/datatrans-v2/getPaths.d.ts +9 -0
  92. package/lib/payment/datatrans-v2/getPaths.js +9 -0
  93. package/lib/payment/datatrans-v2/getPaths.js.map +1 -0
  94. package/lib/payment/datatrans-v2/index.d.ts +1 -0
  95. package/lib/payment/datatrans-v2/index.js +384 -0
  96. package/lib/payment/datatrans-v2/index.js.map +1 -0
  97. package/lib/payment/datatrans-v2/middleware.d.ts +1 -0
  98. package/lib/payment/datatrans-v2/middleware.js +111 -0
  99. package/lib/payment/datatrans-v2/middleware.js.map +1 -0
  100. package/lib/payment/datatrans-v2/parseRegistrationData.d.ts +11 -0
  101. package/lib/payment/datatrans-v2/parseRegistrationData.js +26 -0
  102. package/lib/payment/datatrans-v2/parseRegistrationData.js.map +1 -0
  103. package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts +7 -0
  104. package/lib/payment/datatrans-v2/roundedAmountFromOrder.js +10 -0
  105. package/lib/payment/datatrans-v2/roundedAmountFromOrder.js.map +1 -0
  106. package/lib/payment/datatrans-v2/splitProperties.d.ts +8 -0
  107. package/lib/payment/datatrans-v2/splitProperties.js +58 -0
  108. package/lib/payment/datatrans-v2/splitProperties.js.map +1 -0
  109. package/lib/payment/invoice-prepaid.d.ts +1 -0
  110. package/lib/payment/invoice-prepaid.js +30 -0
  111. package/lib/payment/invoice-prepaid.js.map +1 -0
  112. package/lib/payment/invoice.d.ts +1 -0
  113. package/lib/payment/invoice.js +27 -0
  114. package/lib/payment/invoice.js.map +1 -0
  115. package/lib/payment/paypal-checkout.d.ts +1 -0
  116. package/lib/payment/paypal-checkout.js +82 -0
  117. package/lib/payment/paypal-checkout.js.map +1 -0
  118. package/lib/payment/postfinance-checkout/api.d.ts +11 -0
  119. package/lib/payment/postfinance-checkout/api.js +109 -0
  120. package/lib/payment/postfinance-checkout/api.js.map +1 -0
  121. package/lib/payment/postfinance-checkout/index.d.ts +1 -0
  122. package/lib/payment/postfinance-checkout/index.js +186 -0
  123. package/lib/payment/postfinance-checkout/index.js.map +1 -0
  124. package/lib/payment/postfinance-checkout/middleware.d.ts +1 -0
  125. package/lib/payment/postfinance-checkout/middleware.js +42 -0
  126. package/lib/payment/postfinance-checkout/middleware.js.map +1 -0
  127. package/lib/payment/postfinance-checkout/types.d.ts +23 -0
  128. package/lib/payment/postfinance-checkout/types.js +12 -0
  129. package/lib/payment/postfinance-checkout/types.js.map +1 -0
  130. package/lib/payment/postfinance-checkout/utils.d.ts +4 -0
  131. package/lib/payment/postfinance-checkout/utils.js +20 -0
  132. package/lib/payment/postfinance-checkout/utils.js.map +1 -0
  133. package/lib/payment/stripe.d.ts +1 -0
  134. package/lib/payment/stripe.js +214 -0
  135. package/lib/payment/stripe.js.map +1 -0
  136. package/lib/payment/worldline-saferpay/index.d.ts +1 -0
  137. package/lib/payment/worldline-saferpay/index.js +112 -0
  138. package/lib/payment/worldline-saferpay/index.js.map +1 -0
  139. package/lib/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayClient.d.ts +14 -0
  140. package/lib/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayClient.js +29 -0
  141. package/lib/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayClient.js.map +1 -0
  142. package/lib/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayConnection.d.ts +9 -0
  143. package/lib/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayConnection.js +28 -0
  144. package/lib/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayConnection.js.map +1 -0
  145. package/lib/payment/worldline-saferpay/worldline-saferpay-client/index.d.ts +4 -0
  146. package/lib/payment/worldline-saferpay/worldline-saferpay-client/index.js +2 -0
  147. package/lib/payment/worldline-saferpay/worldline-saferpay-client/index.js.map +1 -0
  148. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentMethods.d.ts +1 -0
  149. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentMethods.js +2 -0
  150. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentMethods.js.map +1 -0
  151. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageAssert.d.ts +73 -0
  152. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageAssert.js +2 -0
  153. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageAssert.js.map +1 -0
  154. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageInitialize.d.ts +53 -0
  155. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageInitialize.js +2 -0
  156. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageInitialize.js.map +1 -0
  157. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Request.d.ts +13 -0
  158. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Request.js +2 -0
  159. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Request.js.map +1 -0
  160. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Response.d.ts +9 -0
  161. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Response.js +2 -0
  162. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Response.js.map +1 -0
  163. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Transaction.d.ts +5 -0
  164. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Transaction.js +2 -0
  165. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Transaction.js.map +1 -0
  166. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/TransactionCancel.d.ts +13 -0
  167. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/TransactionCancel.js +2 -0
  168. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/TransactionCancel.js.map +1 -0
  169. package/lib/pricing/delivery-swiss-tax.d.ts +15 -0
  170. package/lib/pricing/delivery-swiss-tax.js +98 -0
  171. package/lib/pricing/delivery-swiss-tax.js.map +1 -0
  172. package/lib/pricing/discount-100-off.d.ts +1 -0
  173. package/lib/pricing/discount-100-off.js +34 -0
  174. package/lib/pricing/discount-100-off.js.map +1 -0
  175. package/lib/pricing/discount-half-price-manual.d.ts +1 -0
  176. package/lib/pricing/discount-half-price-manual.js +34 -0
  177. package/lib/pricing/discount-half-price-manual.js.map +1 -0
  178. package/lib/pricing/discount-half-price.d.ts +1 -0
  179. package/lib/pricing/discount-half-price.js +37 -0
  180. package/lib/pricing/discount-half-price.js.map +1 -0
  181. package/lib/pricing/free-delivery.d.ts +2 -0
  182. package/lib/pricing/free-delivery.js +26 -0
  183. package/lib/pricing/free-delivery.js.map +1 -0
  184. package/lib/pricing/free-payment.d.ts +2 -0
  185. package/lib/pricing/free-payment.js +26 -0
  186. package/lib/pricing/free-payment.js.map +1 -0
  187. package/lib/pricing/order-delivery.d.ts +1 -0
  188. package/lib/pricing/order-delivery.js +33 -0
  189. package/lib/pricing/order-delivery.js.map +1 -0
  190. package/lib/pricing/order-discount.d.ts +1 -0
  191. package/lib/pricing/order-discount.js +110 -0
  192. package/lib/pricing/order-discount.js.map +1 -0
  193. package/lib/pricing/order-items-discount.d.ts +1 -0
  194. package/lib/pricing/order-items-discount.js +88 -0
  195. package/lib/pricing/order-items-discount.js.map +1 -0
  196. package/lib/pricing/order-items.d.ts +1 -0
  197. package/lib/pricing/order-items.js +44 -0
  198. package/lib/pricing/order-items.js.map +1 -0
  199. package/lib/pricing/order-payment.d.ts +1 -0
  200. package/lib/pricing/order-payment.js +33 -0
  201. package/lib/pricing/order-payment.js.map +1 -0
  202. package/lib/pricing/product-catalog-price.d.ts +1 -0
  203. package/lib/pricing/product-catalog-price.js +37 -0
  204. package/lib/pricing/product-catalog-price.js.map +1 -0
  205. package/lib/pricing/product-discount.d.ts +1 -0
  206. package/lib/pricing/product-discount.js +55 -0
  207. package/lib/pricing/product-discount.js.map +1 -0
  208. package/lib/pricing/product-price-ECB-interbank-exchange.d.ts +1 -0
  209. package/lib/pricing/product-price-ECB-interbank-exchange.js +90 -0
  210. package/lib/pricing/product-price-ECB-interbank-exchange.js.map +1 -0
  211. package/lib/pricing/product-price-coinbase-exchange.d.ts +1 -0
  212. package/lib/pricing/product-price-coinbase-exchange.js +60 -0
  213. package/lib/pricing/product-price-coinbase-exchange.js.map +1 -0
  214. package/lib/pricing/product-price-cryptopay.d.ts +1 -0
  215. package/lib/pricing/product-price-cryptopay.js +21 -0
  216. package/lib/pricing/product-price-cryptopay.js.map +1 -0
  217. package/lib/pricing/product-price-rateconversion.d.ts +1 -0
  218. package/lib/pricing/product-price-rateconversion.js +51 -0
  219. package/lib/pricing/product-price-rateconversion.js.map +1 -0
  220. package/lib/pricing/product-price-round.d.ts +11 -0
  221. package/lib/pricing/product-price-round.js +54 -0
  222. package/lib/pricing/product-price-round.js.map +1 -0
  223. package/lib/pricing/product-swiss-tax.d.ts +13 -0
  224. package/lib/pricing/product-swiss-tax.js +102 -0
  225. package/lib/pricing/product-swiss-tax.js.map +1 -0
  226. package/lib/pricing/utils/cache.d.ts +8 -0
  227. package/lib/pricing/utils/cache.js +28 -0
  228. package/lib/pricing/utils/cache.js.map +1 -0
  229. package/lib/quotations/manual.d.ts +1 -0
  230. package/lib/quotations/manual.js +21 -0
  231. package/lib/quotations/manual.js.map +1 -0
  232. package/lib/warehousing/google-sheets.d.ts +1 -0
  233. package/lib/warehousing/google-sheets.js +153 -0
  234. package/lib/warehousing/google-sheets.js.map +1 -0
  235. package/lib/warehousing/store.d.ts +1 -0
  236. package/lib/warehousing/store.js +33 -0
  237. package/lib/warehousing/store.js.map +1 -0
  238. package/lib/worker/BulkImportWorker.js +3 -3
  239. package/lib/worker/BulkImportWorker.js.map +1 -1
  240. package/lib/worker/GenerateOrderWorker.js +1 -1
  241. package/lib/worker/GenerateOrderWorker.js.map +1 -1
  242. package/lib/worker/ZombieKillerWorker.js.map +1 -1
  243. package/lib/worker/email.js +55 -4
  244. package/lib/worker/email.js.map +1 -1
  245. package/license +274 -0
  246. package/package.json +29 -12
  247. package/src/delivery/pick-mup.ts +119 -0
  248. package/src/delivery/post.ts +30 -0
  249. package/src/delivery/send-message.ts +54 -0
  250. package/src/delivery/stores.ts +49 -0
  251. package/src/enrollments/licensed.ts +49 -0
  252. package/src/files/gridfs/gridfs-adapter.ts +1 -1
  253. package/src/files/gridfs/gridfs-webhook.js +2 -2
  254. package/src/files/minio/minio-webhook.js +1 -1
  255. package/src/filters/local-search.ts +105 -0
  256. package/src/filters/strict-equal.ts +31 -0
  257. package/src/payment/apple-iap/adapter.ts +390 -0
  258. package/src/payment/apple-iap/db/AppleTransactionsCollection.ts +13 -0
  259. package/src/payment/apple-iap/index.ts +3 -0
  260. package/src/payment/apple-iap/module/configureAppleTransactionsModule.ts +31 -0
  261. package/src/payment/bity/adapter.ts +417 -0
  262. package/src/payment/bity/db/BityCredentialsCollection.ts +17 -0
  263. package/src/payment/bity/index.ts +3 -0
  264. package/src/payment/bity/module/configureBityModule.ts +46 -0
  265. package/src/payment/braintree.ts +147 -0
  266. package/src/payment/cryptopay.ts +195 -0
  267. package/src/payment/datatrans-v2/api/authorize.ts +17 -0
  268. package/src/payment/datatrans-v2/api/authorizeAuthenticated.ts +20 -0
  269. package/src/payment/datatrans-v2/api/cancel.ts +13 -0
  270. package/src/payment/datatrans-v2/api/index.ts +24 -0
  271. package/src/payment/datatrans-v2/api/init.ts +40 -0
  272. package/src/payment/datatrans-v2/api/makeFetcher.ts +49 -0
  273. package/src/payment/datatrans-v2/api/secureFields.ts +19 -0
  274. package/src/payment/datatrans-v2/api/settle.ts +13 -0
  275. package/src/payment/datatrans-v2/api/status.ts +8 -0
  276. package/src/payment/datatrans-v2/api/types.d.ts +378 -0
  277. package/src/payment/datatrans-v2/api/validate.ts +13 -0
  278. package/src/payment/datatrans-v2/generateSignature.ts +24 -0
  279. package/src/payment/datatrans-v2/getPaths.ts +24 -0
  280. package/src/payment/datatrans-v2/index.ts +476 -0
  281. package/src/payment/datatrans-v2/middleware.ts +147 -0
  282. package/src/payment/datatrans-v2/parseRegistrationData.ts +32 -0
  283. package/src/payment/datatrans-v2/roundedAmountFromOrder.ts +16 -0
  284. package/src/payment/datatrans-v2/splitProperties.ts +63 -0
  285. package/src/payment/invoice-prepaid.ts +40 -0
  286. package/src/payment/invoice.ts +36 -0
  287. package/src/payment/paypal-checkout.ts +107 -0
  288. package/src/payment/postfinance-checkout/api.ts +142 -0
  289. package/src/payment/postfinance-checkout/index.ts +241 -0
  290. package/src/payment/postfinance-checkout/middleware.ts +54 -0
  291. package/src/payment/postfinance-checkout/types.ts +27 -0
  292. package/src/payment/postfinance-checkout/utils.ts +35 -0
  293. package/src/payment/stripe.ts +278 -0
  294. package/src/payment/worldline-saferpay/index.ts +140 -0
  295. package/src/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayClient.ts +54 -0
  296. package/src/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayConnection.ts +36 -0
  297. package/src/payment/worldline-saferpay/worldline-saferpay-client/index.ts +8 -0
  298. package/src/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentMethods.ts +26 -0
  299. package/src/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageAssert.ts +75 -0
  300. package/src/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageInitialize.ts +55 -0
  301. package/src/payment/worldline-saferpay/worldline-saferpay-client/models/Request.ts +14 -0
  302. package/src/payment/worldline-saferpay/worldline-saferpay-client/models/Response.ts +9 -0
  303. package/src/payment/worldline-saferpay/worldline-saferpay-client/models/Transaction.ts +6 -0
  304. package/src/payment/worldline-saferpay/worldline-saferpay-client/models/TransactionCancel.ts +15 -0
  305. package/src/pricing/delivery-swiss-tax.ts +115 -0
  306. package/src/pricing/discount-100-off.ts +44 -0
  307. package/src/pricing/discount-half-price-manual.ts +43 -0
  308. package/src/pricing/discount-half-price.ts +46 -0
  309. package/src/pricing/free-delivery.ts +31 -0
  310. package/src/pricing/free-payment.ts +32 -0
  311. package/src/pricing/order-delivery.ts +45 -0
  312. package/src/pricing/order-discount.ts +158 -0
  313. package/src/pricing/order-items-discount.ts +116 -0
  314. package/src/pricing/order-items.ts +61 -0
  315. package/src/pricing/order-payment.ts +46 -0
  316. package/src/pricing/product-catalog-price.ts +56 -0
  317. package/src/pricing/product-discount.ts +69 -0
  318. package/src/pricing/product-price-ECB-interbank-exchange.ts +108 -0
  319. package/src/pricing/product-price-coinbase-exchange.ts +82 -0
  320. package/src/pricing/product-price-cryptopay.ts +25 -0
  321. package/src/pricing/product-price-rateconversion.ts +73 -0
  322. package/src/pricing/product-price-round.ts +78 -0
  323. package/src/pricing/product-swiss-tax.ts +117 -0
  324. package/src/pricing/utils/cache.js +32 -0
  325. package/src/quotations/manual.ts +27 -0
  326. package/src/warehousing/google-sheets.ts +165 -0
  327. package/src/warehousing/store.ts +47 -0
  328. package/src/worker/BulkImportWorker.ts +3 -3
  329. package/src/worker/GenerateOrderWorker.ts +1 -1
  330. package/src/worker/ZombieKillerWorker.ts +5 -5
  331. package/src/worker/email.ts +56 -4
  332. package/lib/worker/MessageWorker.d.ts +0 -10
@@ -0,0 +1,27 @@
1
+ export enum IntegrationModes { // eslint-disable-line
2
+ PaymentPage = 'PaymentPage',
3
+ Lightbox = 'Lightbox',
4
+ iFrame = 'iFrame',
5
+ }
6
+
7
+ export enum CompletionModes { // eslint-disable-line
8
+ Immediate = 'Immediate',
9
+ Deferred = 'Deferred',
10
+ }
11
+
12
+ export type SignResponse = {
13
+ transactionId: number;
14
+ location: string | null;
15
+ };
16
+
17
+ export type listenerEntityTechnicalNames = 'TransactionCompletion';
18
+
19
+ export type WebhookData = {
20
+ eventId: number;
21
+ entityId: number;
22
+ listenerEntityId: number;
23
+ listenerEntityTechnicalName: listenerEntityTechnicalNames;
24
+ spaceId: number;
25
+ webhookListenerId: number;
26
+ timestamp: string; // "YYYY-MM-DDTHH:MM:ss+0000", e.g. "2022-02-18T12:40:42+0000"
27
+ };
@@ -0,0 +1,35 @@
1
+ import { Order, OrdersModule } from '@unchainedshop/types/orders';
2
+ import { Transaction } from 'postfinancecheckout/src/models/Transaction';
3
+ import { TransactionState } from 'postfinancecheckout/src/models/TransactionState';
4
+
5
+ export const transactionIsPaid = async (
6
+ transaction: Transaction,
7
+ expectedCurrency: string,
8
+ expectedAmount: number,
9
+ ): Promise<boolean> => {
10
+ if (transaction.state === TransactionState.FULFILL) {
11
+ return (
12
+ transaction.completedAmount !== undefined &&
13
+ transaction.completedAmount.toFixed(2) === expectedAmount.toFixed(2) &&
14
+ transaction.currency === expectedCurrency
15
+ );
16
+ }
17
+ if (transaction.state === TransactionState.AUTHORIZED) {
18
+ return (
19
+ transaction.authorizationAmount !== undefined &&
20
+ transaction.authorizationAmount.toFixed(2) === expectedAmount.toFixed(2) &&
21
+ transaction.currency === expectedCurrency
22
+ );
23
+ }
24
+ return false;
25
+ };
26
+
27
+ export const orderIsPaid = async (
28
+ order: Order,
29
+ transaction: Transaction,
30
+ orderModule: OrdersModule,
31
+ ): Promise<boolean> => {
32
+ const pricing = orderModule.pricingSheet(order);
33
+ const totalAmount = pricing.total({ useNetPrice: false }).amount / 100;
34
+ return transactionIsPaid(transaction, order.currency, totalAmount);
35
+ };
@@ -0,0 +1,278 @@
1
+ import { Context } from '@unchainedshop/types/api';
2
+ import { IPaymentAdapter } from '@unchainedshop/types/payments';
3
+ import bodyParser from 'body-parser';
4
+ import { useMiddlewareWithCurrentContext } from '@unchainedshop/api';
5
+ import { PaymentAdapter, PaymentDirector, PaymentError } from '@unchainedshop/core-payment';
6
+ import { createLogger } from '@unchainedshop/logger';
7
+
8
+ const logger = createLogger('unchained:core-payment:stripe');
9
+
10
+ const {
11
+ STRIPE_SECRET,
12
+ STRIPE_ENDPOINT_SECRET,
13
+ EMAIL_WEBSITE_NAME,
14
+ STRIPE_WEBHOOK_PATH = '/graphql/stripe',
15
+ } = process.env;
16
+
17
+ /*
18
+ Test Webhooks:
19
+
20
+ brew install stripe/stripe-cli/stripe
21
+ stripe login --api-key sk_....
22
+ stripe listen --forward-to http://localhost:3000/graphql/stripe
23
+ stripe trigger payment_intent.succeeded
24
+ */
25
+
26
+ const stripe = require('stripe')(STRIPE_SECRET); // eslint-disable-line
27
+
28
+ useMiddlewareWithCurrentContext(STRIPE_WEBHOOK_PATH, bodyParser.raw({ type: 'application/json' }));
29
+
30
+ useMiddlewareWithCurrentContext(STRIPE_WEBHOOK_PATH, async (request, response) => {
31
+ const sig = request.headers['stripe-signature'];
32
+ const resolvedContext = request.unchainedContext as Context;
33
+ const { modules, services } = resolvedContext;
34
+
35
+ let event;
36
+
37
+ try {
38
+ event = stripe.webhooks.constructEvent(request.body, sig, STRIPE_ENDPOINT_SECRET);
39
+ } catch (err) {
40
+ response.writeHead(400);
41
+ response.end(`Webhook Error: ${err.message}`);
42
+ return;
43
+ }
44
+
45
+ try {
46
+ if (event.type === 'payment_intent.succeeded') {
47
+ const paymentIntent = event.data.object;
48
+ const orderPaymentId = paymentIntent.metadata?.orderPaymentId;
49
+
50
+ await modules.orders.payments.logEvent(orderPaymentId, event, resolvedContext.userId);
51
+
52
+ const orderPayment = await modules.orders.payments.findOrderPayment({
53
+ orderPaymentId,
54
+ });
55
+
56
+ const order = await modules.orders.checkout(
57
+ orderPayment.orderId,
58
+ {
59
+ transactionContext: {
60
+ paymentIntentId: paymentIntent.id,
61
+ },
62
+ paymentContext: {
63
+ paymentIntentId: paymentIntent.id,
64
+ },
65
+ },
66
+ resolvedContext,
67
+ );
68
+
69
+ logger.info(`Stripe Webhook: Unchained confirmed checkout for order ${order.orderNumber}`, {
70
+ orderId: order._id,
71
+ });
72
+ } else if (event.type === 'setup_intent.succeeded') {
73
+ const setupIntent = event.data.object;
74
+ const { paymentProviderId, userId } = setupIntent.metadata;
75
+
76
+ await services.payment.registerPaymentCredentials(
77
+ paymentProviderId,
78
+ {
79
+ transactionContext: {
80
+ setupIntentId: setupIntent.id,
81
+ },
82
+ },
83
+ resolvedContext,
84
+ );
85
+
86
+ logger.info(`Stripe Webhook: Unchained registered payment credentials for ${userId}`, {
87
+ userId,
88
+ });
89
+ } else {
90
+ response.writeHead(404);
91
+ response.end();
92
+ return;
93
+ }
94
+ } catch (err) {
95
+ response.writeHead(400);
96
+ response.end(`Webhook Error: ${err.message}`);
97
+ return;
98
+ }
99
+ // Return a 200 response to acknowledge receipt of the event
100
+ response.end(JSON.stringify({ received: true }));
101
+ });
102
+
103
+ const createRegistrationIntent = async ({ userId, name, email, paymentProviderId }, options = {}) => {
104
+ const customer = await stripe.customers.create({
105
+ metadata: {
106
+ userId,
107
+ },
108
+ name,
109
+ email,
110
+ });
111
+ const setupIntent = await stripe.setupIntents.create({
112
+ customer: customer.id,
113
+ metadata: {
114
+ userId,
115
+ paymentProviderId,
116
+ },
117
+ ...options,
118
+ });
119
+ return setupIntent;
120
+ };
121
+
122
+ const createOrderPaymentIntent = async ({ order, orderPayment, pricing }, options = {}) => {
123
+ const reference = EMAIL_WEBSITE_NAME || order._id;
124
+ const { currency, amount } = pricing.total({ useNetPrice: false });
125
+ const paymentIntent = await stripe.paymentIntents.create({
126
+ amount: Math.round(amount),
127
+ currency: currency.toLowerCase(),
128
+ description: `${reference} #${order.orderNumber}`,
129
+ statement_descriptor: order.orderNumber,
130
+ statement_descriptor_suffix: reference,
131
+ receipt_email: order.contact?.emailAddress,
132
+ setup_future_usage: 'off_session', // Verify your integration in this guide by including this parameter
133
+ metadata: {
134
+ orderPaymentId: orderPayment._id,
135
+ },
136
+ ...options,
137
+ });
138
+ return paymentIntent;
139
+ };
140
+
141
+ const Stripe: IPaymentAdapter = {
142
+ ...PaymentAdapter,
143
+
144
+ key: 'shop.unchained.payment.stripe',
145
+ label: 'Stripe',
146
+ version: '2.0',
147
+
148
+ typeSupported(type) {
149
+ return type === 'GENERIC';
150
+ },
151
+
152
+ actions: (params) => {
153
+ const { modules } = params.context;
154
+
155
+ const adapterActions = {
156
+ ...PaymentAdapter.actions(params),
157
+
158
+ // eslint-disable-next-line
159
+ configurationError() {
160
+ // eslint-disable-line
161
+ if (!STRIPE_SECRET || !STRIPE_ENDPOINT_SECRET) {
162
+ return PaymentError.INCOMPLETE_CONFIGURATION;
163
+ }
164
+ return null;
165
+ },
166
+
167
+ isActive: () => {
168
+ if (adapterActions.configurationError() === null) return true;
169
+ return false;
170
+ },
171
+
172
+ isPayLaterAllowed() {
173
+ return false;
174
+ },
175
+
176
+ validate: async ({ token }) => {
177
+ const paymentMethod = await stripe.paymentMethods.retrieve(token);
178
+ // TODO: Add further checks like expiration of cards
179
+ return !!paymentMethod;
180
+ },
181
+
182
+ register: async ({ setupIntentId }) => {
183
+ if (!setupIntentId) {
184
+ throw new Error('You have to provide a setup intent id');
185
+ }
186
+
187
+ const setupIntent = await stripe.setupIntents.retrieve(setupIntentId);
188
+
189
+ if (setupIntent.status === 'succeeded') {
190
+ return {
191
+ token: setupIntent.payment_method,
192
+ customer: setupIntent.customer,
193
+ // payment_method_options: setupIntent.payment_method_options,
194
+ payment_method_types: setupIntent.payment_method_types,
195
+ usage: setupIntent.usage,
196
+ };
197
+ }
198
+
199
+ logger.warn('Stripe Plugin: Registration declined', setupIntentId);
200
+ return null;
201
+ },
202
+
203
+ sign: async (transactionContext = {}) => {
204
+ // eslint-disable-line
205
+ const { orderPayment, paymentProviderId } = params.paymentContext;
206
+ const { userId } = params.context;
207
+
208
+ if (orderPayment) {
209
+ const order = await modules.orders.findOrder({ orderId: orderPayment.orderId });
210
+ const pricing = await modules.orders.pricingSheet(order);
211
+ const paymentIntent = await createOrderPaymentIntent(
212
+ { order, orderPayment, pricing },
213
+ transactionContext,
214
+ );
215
+ return paymentIntent.client_secret;
216
+ }
217
+
218
+ const user = await modules.users.findUserById(userId);
219
+ const email = modules.users.primaryEmail(user)?.address;
220
+ const name = user.profile.displayName || user.username || email;
221
+
222
+ const paymentIntent = await createRegistrationIntent(
223
+ { userId, name, email, paymentProviderId },
224
+ transactionContext,
225
+ );
226
+ return paymentIntent.client_secret;
227
+ },
228
+
229
+ charge: async ({ paymentIntentId, paymentCredentials }) => {
230
+ if (!paymentIntentId && !paymentCredentials) {
231
+ throw new Error('You have to provide an existing intent or a payment method');
232
+ }
233
+
234
+ const { order } = params.paymentContext;
235
+ const orderPayment = await modules.orders.payments.findOrderPayment({
236
+ orderPaymentId: order.paymentId,
237
+ });
238
+
239
+ const pricing = await modules.orders.pricingSheet(order);
240
+
241
+ const paymentIntentObject = paymentIntentId
242
+ ? await stripe.paymentIntents.retrieve(paymentIntentId)
243
+ : await createOrderPaymentIntent(
244
+ { orderPayment, order, pricing },
245
+ {
246
+ customer: paymentCredentials.meta?.customer,
247
+ confirm: true,
248
+ payment_method: paymentCredentials.token,
249
+ payment_method_types: paymentCredentials.meta?.payment_method_types, // eslint-disable-line
250
+ // payment_method_options: paymentCredentials.meta?.payment_method_options, // eslint-disable-line
251
+ },
252
+ );
253
+
254
+ const { currency, amount } = pricing.total({ useNetPrice: false });
255
+
256
+ if (
257
+ paymentIntentObject.currency !== currency.toLowerCase() ||
258
+ paymentIntentObject.amount !== Math.round(amount)
259
+ ) {
260
+ throw new Error('The price has changed since you have created the intent!');
261
+ }
262
+ if (paymentIntentObject.metadata?.orderPaymentId !== orderPayment?._id) {
263
+ throw new Error('The order payment is different from the initiating intent!');
264
+ }
265
+
266
+ if (paymentIntentObject.status === 'succeeded') {
267
+ return paymentIntentObject;
268
+ }
269
+
270
+ return false;
271
+ },
272
+ };
273
+
274
+ return adapterActions;
275
+ },
276
+ };
277
+
278
+ PaymentDirector.registerAdapter(Stripe);
@@ -0,0 +1,140 @@
1
+ import { IPaymentAdapter } from '@unchainedshop/types/payments';
2
+ import { PaymentAdapter, PaymentDirector, PaymentError } from '@unchainedshop/core-payment';
3
+ import { PaymentPageInitializeInput, SaferpayClient } from './worldline-saferpay-client';
4
+
5
+ const {
6
+ WORLDLINE_BASE_URL = 'https://test.saferpay.com/api',
7
+ WORLDLINE_CUSTOMER_ID,
8
+ WORLDLINE_USER,
9
+ WORLDLINE_PW,
10
+ WORLDLINE_SUCCESS_URL,
11
+ WORLDLINE_FAILED_URL,
12
+ } = process.env;
13
+
14
+ const WordlineSaferpay: IPaymentAdapter = {
15
+ ...PaymentAdapter,
16
+
17
+ key: 'shop.unchained.payment.worldline-saferpay',
18
+ label: 'Worldline Saferpay',
19
+ version: '1.0',
20
+
21
+ typeSupported(type) {
22
+ return type === 'GENERIC';
23
+ },
24
+
25
+ actions: (params) => {
26
+ const { modules } = params.context;
27
+
28
+ const saferpayClient = new SaferpayClient(
29
+ WORLDLINE_BASE_URL,
30
+ WORLDLINE_CUSTOMER_ID,
31
+ WORLDLINE_USER,
32
+ WORLDLINE_PW,
33
+ );
34
+
35
+ const adapter = {
36
+ ...PaymentAdapter.actions(params),
37
+
38
+ getTerminalId() {
39
+ return params.config.find((item) => item.key === 'terminalId')?.value;
40
+ },
41
+
42
+ // eslint-disable-next-line
43
+ configurationError() {
44
+ // eslint-disable-line
45
+ if (
46
+ !WORLDLINE_BASE_URL ||
47
+ !WORLDLINE_CUSTOMER_ID ||
48
+ !WORLDLINE_USER ||
49
+ !WORLDLINE_PW ||
50
+ !adapter.getTerminalId()
51
+ ) {
52
+ return PaymentError.INCOMPLETE_CONFIGURATION;
53
+ }
54
+ return null;
55
+ },
56
+
57
+ isActive() {
58
+ if (adapter.configurationError() === null) return true;
59
+ return false;
60
+ },
61
+
62
+ isPayLaterAllowed() {
63
+ return false;
64
+ },
65
+
66
+ sign: async (transactionContext: any = {}) => {
67
+ const { orderPayment } = params.paymentContext;
68
+ const order = await modules.orders.findOrder({
69
+ orderId: orderPayment.orderId,
70
+ });
71
+ const pricing = modules.orders.pricingSheet(order);
72
+ const totalAmount = pricing?.total({ useNetPrice: false }).amount;
73
+ const paymentPageInitInput: PaymentPageInitializeInput = {
74
+ RequestHeader: saferpayClient.buildRequestHeader(orderPayment._id, 0),
75
+ TerminalId: adapter.getTerminalId(),
76
+ Payment: {
77
+ Amount: {
78
+ Value: totalAmount.toString(),
79
+ CurrencyCode: order.currency,
80
+ },
81
+ OrderId: order._id,
82
+ Description: transactionContext.description || 'Bestellung',
83
+ },
84
+ ReturnUrls: {
85
+ Success: `${WORLDLINE_SUCCESS_URL}?order_id=${order._id}`,
86
+ Fail: `${WORLDLINE_FAILED_URL}?order_id=${order._id}`,
87
+ Abort: `${WORLDLINE_FAILED_URL}?order_id=${order._id}`,
88
+ },
89
+ };
90
+ const paymentPageInit = await saferpayClient.paymentPageInitialize(paymentPageInitInput);
91
+ return JSON.stringify({
92
+ location: paymentPageInit.RedirectUrl,
93
+ transactionId: paymentPageInit.Token,
94
+ });
95
+ },
96
+
97
+ charge: async ({ transactionId }: { transactionId: string }) => {
98
+ const { orderPayment } = params.paymentContext;
99
+ const order = await modules.orders.findOrder({ orderId: orderPayment.orderId });
100
+ const pricing = modules.orders.pricingSheet(order);
101
+ const totalAmount = pricing.total({ useNetPrice: false }).amount;
102
+ const paymentPageAssert = await saferpayClient.paymentPageAssert({
103
+ RequestHeader: saferpayClient.buildRequestHeader(orderPayment._id, 0),
104
+ Token: transactionId,
105
+ });
106
+ return (
107
+ !paymentPageAssert.ErrorMessage &&
108
+ paymentPageAssert.Transaction.Amount.Value === totalAmount.toString() &&
109
+ paymentPageAssert.Transaction.Amount.CurrencyCode === order.currency &&
110
+ (paymentPageAssert.Transaction.Status === 'AUTHORIZED' ||
111
+ paymentPageAssert.Transaction.Status === 'CAPTURED')
112
+ );
113
+ },
114
+
115
+ cancel: async () => {
116
+ const { orderPayment } = params.paymentContext;
117
+ if (!orderPayment) return false;
118
+ const token = orderPayment.context?.token;
119
+ if (!token) return false;
120
+ const paymentPageAssert = await saferpayClient.paymentPageAssert({
121
+ RequestHeader: saferpayClient.buildRequestHeader(orderPayment._id, 0),
122
+ Token: token,
123
+ });
124
+ const transactionId = paymentPageAssert.Transaction?.Id;
125
+ if (paymentPageAssert.Transaction.Status !== 'AUTHORIZED' || !transactionId) return false;
126
+ const transactionCancelRes = await saferpayClient.transactionCancel({
127
+ RequestHeader: saferpayClient.buildRequestHeader(orderPayment._id, 0),
128
+ TransactionReference: {
129
+ TransactionId: transactionId,
130
+ },
131
+ });
132
+ return transactionCancelRes.TransactionId === transactionId;
133
+ },
134
+ };
135
+
136
+ return adapter;
137
+ },
138
+ };
139
+
140
+ PaymentDirector.registerAdapter(WordlineSaferpay);
@@ -0,0 +1,54 @@
1
+ import { TransactionCancelInput, TransactionCancelResponse } from '../models/TransactionCancel';
2
+ import { PaymentPageAssertInput, PaymentPageAssertResponse } from '../models/PaymentPageAssert';
3
+ import {
4
+ PaymentPageInitializeInput,
5
+ PaymentPageInitializeResponse,
6
+ } from '../models/PaymentPageInitialize';
7
+ import { RequestHeader } from '../models/Request';
8
+ import { SaferpayConnection } from './SaferpayConnection';
9
+
10
+ export class SaferpayClient {
11
+ private conn: SaferpayConnection;
12
+
13
+ private customerId: string;
14
+
15
+ private specVersion: string;
16
+
17
+ public constructor(
18
+ baseUrl: string,
19
+ customerId: string,
20
+ user: string,
21
+ password: string,
22
+ specVersion?: string,
23
+ ) {
24
+ this.customerId = customerId;
25
+ this.specVersion = specVersion || '1.27';
26
+ this.conn = new SaferpayConnection(baseUrl, user, password);
27
+ }
28
+
29
+ public buildRequestHeader(requestId: string, retryIndicator: number): RequestHeader {
30
+ return {
31
+ SpecVersion: this.specVersion,
32
+ CustomerId: this.customerId,
33
+ RequestId: requestId,
34
+ RetryIndicator: retryIndicator,
35
+ };
36
+ }
37
+
38
+ public async paymentPageInitialize(
39
+ input: PaymentPageInitializeInput,
40
+ ): Promise<PaymentPageInitializeResponse> {
41
+ return this.conn.post(
42
+ '/Payment/v1/PaymentPage/Initialize',
43
+ input,
44
+ ) as Promise<PaymentPageInitializeResponse>;
45
+ }
46
+
47
+ public async paymentPageAssert(input: PaymentPageAssertInput): Promise<PaymentPageAssertResponse> {
48
+ return this.conn.post('/Payment/v1/PaymentPage/Assert', input) as Promise<PaymentPageAssertResponse>;
49
+ }
50
+
51
+ public async transactionCancel(input: TransactionCancelInput): Promise<TransactionCancelResponse> {
52
+ return this.conn.post('/Payment/v1/Transaction/Cancel', input) as Promise<TransactionCancelResponse>;
53
+ }
54
+ }
@@ -0,0 +1,36 @@
1
+ import fetch from 'node-fetch';
2
+
3
+ export class SaferpayConnection {
4
+ private baseUrl: string;
5
+
6
+ private user: string;
7
+
8
+ private password: string;
9
+
10
+ public constructor(baseUrl: string, user: string, password: string) {
11
+ this.baseUrl = baseUrl;
12
+ this.user = user;
13
+ this.password = password;
14
+ }
15
+
16
+ private buildUrl(uri: string): string {
17
+ return this.baseUrl + uri;
18
+ }
19
+
20
+ private getHeaders() {
21
+ return {
22
+ 'Content-Type': 'application/json',
23
+ Authorization: `Basic ${Buffer.from(`${this.user}:${this.password}`, 'binary').toString(
24
+ 'base64',
25
+ )}`,
26
+ };
27
+ }
28
+
29
+ public async post(uri: string, data: object): Promise<any> {
30
+ return fetch(this.buildUrl(uri), {
31
+ method: 'POST',
32
+ body: JSON.stringify(data),
33
+ headers: this.getHeaders(),
34
+ }).then((res: any) => res.json());
35
+ }
36
+ }
@@ -0,0 +1,8 @@
1
+ export { SaferpayClient } from './api/SaferpayClient';
2
+
3
+ export {
4
+ PaymentPageInitializeInput,
5
+ PaymentPageInitializeResponse,
6
+ } from './models/PaymentPageInitialize';
7
+ export { PaymentPageAssertInput, PaymentPageAssertResponse } from './models/PaymentPageAssert';
8
+ export { TransactionCancelInput, TransactionCancelResponse } from './models/TransactionCancel';
@@ -0,0 +1,26 @@
1
+ export type PaymentMethods =
2
+ | 'ALIPAY'
3
+ | 'AMEX'
4
+ | 'BANCONTACT'
5
+ | 'BONUS'
6
+ | 'DINERS'
7
+ | 'DIRECTDEBIT'
8
+ | 'EPRZELEWY'
9
+ | 'EPS'
10
+ | 'GIROPAY'
11
+ | 'IDEAL'
12
+ | 'INVOICE'
13
+ | 'JCB'
14
+ | 'KLARNA'
15
+ | 'MAESTRO'
16
+ | 'MASTERCARD'
17
+ | 'MYONE'
18
+ | 'PAYPAL'
19
+ | 'PAYDIREKT'
20
+ | 'POSTCARD'
21
+ | 'POSTFINANCE'
22
+ | 'SOFORT'
23
+ | 'TWINT'
24
+ | 'UNIONPAY'
25
+ | 'VISA'
26
+ | 'WLCRYPTOPAYMENTS';
@@ -0,0 +1,75 @@
1
+ import { Response } from './Response';
2
+ import { Request } from './Request';
3
+ import { TransactionAmount, TransactionStatus } from './Transaction';
4
+ import { PaymentMethods } from './PaymentMethods';
5
+
6
+ export interface PaymentPageAssertInput extends Request {
7
+ Token: string;
8
+ }
9
+
10
+ export interface PaymentPageAssertResponse extends Response {
11
+ Transaction: {
12
+ Type: 'PAYMENT';
13
+ Status: TransactionStatus;
14
+ Id: string;
15
+ CaptureId?: string;
16
+ Date: string;
17
+ Amount: TransactionAmount;
18
+ OrderId?: string;
19
+ AcquirerName?: string;
20
+ AcquirerReference?: string;
21
+ SixTransactionReference: string;
22
+ ApprovalCode?: string;
23
+ DirectDebit?: string;
24
+ MandateId: string;
25
+ CreditorId: string;
26
+ Invoice: {
27
+ Payee: Map<string, string>;
28
+ };
29
+ ReasonForTransfer?: string;
30
+ DueDate?: string;
31
+ IssuerReference?: Map<string, string>;
32
+ };
33
+ PaymentMeans: {
34
+ Brand: {
35
+ PaymentMethod?: PaymentMethods;
36
+ Name: string;
37
+ };
38
+ };
39
+ DisplayText: string;
40
+ Wallet?: string;
41
+ Card: {
42
+ MaskedNumber: string;
43
+ ExpYear: number;
44
+ ExpMonth: number;
45
+ HolderName?: string;
46
+ HolderSegment?: string;
47
+ CountryCode?: string;
48
+ HashValue?: string;
49
+ };
50
+ BankAccount?: Map<string, string>;
51
+ Twint?: Map<string, string>;
52
+ Paypal?: Map<string, string>;
53
+ Payer?: object;
54
+ BillingAddress?: Map<string, string>;
55
+ RegistrationResult?: {
56
+ Success: boolean;
57
+ Alias?: string;
58
+ Id: string;
59
+ Lifetime: number;
60
+ Error?: {
61
+ ErrorName?: string;
62
+ ErrorMessage?: string;
63
+ };
64
+ AuthenticationResult?: {
65
+ Result: 'OK' | 'NOT_SUPPORTED';
66
+ };
67
+ Message: string;
68
+ };
69
+ Liability?: object;
70
+ Dcc?: object;
71
+ MastercardIssuerInstallments?: object;
72
+ FraudPrevention?: {
73
+ Result?: 'APPROVED' | 'MANUAL_REVIEW';
74
+ };
75
+ }