@unchainedshop/plugins 4.6.1 → 4.7.2

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 (327) hide show
  1. package/README.md +0 -2
  2. package/lib/delivery/post/adapter.d.ts +2 -0
  3. package/lib/delivery/{post.js → post/adapter.js} +2 -3
  4. package/lib/delivery/post/index.d.ts +4 -0
  5. package/lib/delivery/post/index.js +10 -0
  6. package/lib/delivery/send-message/adapter.d.ts +2 -0
  7. package/lib/delivery/{send-message.js → send-message/adapter.js} +2 -3
  8. package/lib/delivery/send-message/index.d.ts +4 -0
  9. package/lib/delivery/send-message/index.js +10 -0
  10. package/lib/delivery/stores/adapter.d.ts +2 -0
  11. package/lib/delivery/{stores.js → stores/adapter.js} +2 -3
  12. package/lib/delivery/stores/index.d.ts +4 -0
  13. package/lib/delivery/stores/index.js +10 -0
  14. package/lib/enrollments/licensed/adapter.d.ts +6 -0
  15. package/lib/enrollments/{licensed.js → licensed/adapter.js} +2 -3
  16. package/lib/enrollments/licensed/index.d.ts +4 -0
  17. package/lib/enrollments/licensed/index.js +10 -0
  18. package/lib/events/node-event-emitter.d.ts +3 -1
  19. package/lib/events/node-event-emitter.js +3 -3
  20. package/lib/files/gridfs/adapter.d.ts +2 -2
  21. package/lib/files/gridfs/adapter.js +2 -5
  22. package/lib/files/gridfs/api.d.ts +7 -0
  23. package/lib/files/gridfs/api.js +163 -0
  24. package/lib/files/gridfs/index.d.ts +5 -4
  25. package/lib/files/gridfs/index.js +30 -3
  26. package/lib/files/minio/adapter.d.ts +4 -0
  27. package/lib/files/minio/adapter.js +160 -0
  28. package/lib/files/minio/api.d.ts +2 -0
  29. package/lib/files/minio/api.js +41 -0
  30. package/lib/files/minio/index.d.ts +4 -5
  31. package/lib/files/minio/index.js +18 -157
  32. package/lib/files/temp-upload/api.d.ts +6 -0
  33. package/lib/files/temp-upload/api.js +49 -0
  34. package/lib/files/temp-upload/index.d.ts +3 -0
  35. package/lib/files/temp-upload/index.js +15 -0
  36. package/lib/filters/local-search/adapter.d.ts +2 -0
  37. package/lib/filters/{local-search.js → local-search/adapter.js} +2 -12
  38. package/lib/filters/local-search/index.d.ts +4 -0
  39. package/lib/filters/local-search/index.js +16 -0
  40. package/lib/filters/strict-equal/adapter.d.ts +2 -0
  41. package/lib/filters/{strict-equal.js → strict-equal/adapter.js} +2 -3
  42. package/lib/filters/strict-equal/index.d.ts +4 -0
  43. package/lib/filters/strict-equal/index.js +10 -0
  44. package/lib/payment/apple-iap/adapter.d.ts +2 -1
  45. package/lib/payment/apple-iap/adapter.js +2 -3
  46. package/lib/payment/apple-iap/api.d.ts +2 -0
  47. package/lib/payment/apple-iap/{handler-fastify.js → api.js} +47 -30
  48. package/lib/payment/apple-iap/index.d.ts +6 -4
  49. package/lib/payment/apple-iap/index.js +28 -3
  50. package/lib/payment/cryptopay/adapter.d.ts +2 -0
  51. package/lib/payment/cryptopay/{plugin.js → adapter.js} +2 -4
  52. package/lib/payment/cryptopay/api.d.ts +2 -0
  53. package/lib/payment/cryptopay/api.js +23 -0
  54. package/lib/payment/cryptopay/index.d.ts +5 -4
  55. package/lib/payment/cryptopay/index.js +31 -3
  56. package/lib/payment/datatrans-v2/adapter.d.ts +2 -0
  57. package/lib/payment/datatrans-v2/adapter.js +406 -0
  58. package/lib/payment/datatrans-v2/api.d.ts +2 -0
  59. package/lib/payment/datatrans-v2/api.js +108 -0
  60. package/lib/payment/datatrans-v2/index.d.ts +4 -1
  61. package/lib/payment/datatrans-v2/index.js +17 -400
  62. package/lib/payment/invoice/adapter.d.ts +2 -0
  63. package/lib/payment/{invoice.js → invoice/adapter.js} +2 -3
  64. package/lib/payment/invoice/index.d.ts +4 -0
  65. package/lib/payment/invoice/index.js +10 -0
  66. package/lib/payment/invoice-prepaid/adapter.d.ts +2 -0
  67. package/lib/payment/{invoice-prepaid.js → invoice-prepaid/adapter.js} +2 -3
  68. package/lib/payment/invoice-prepaid/index.d.ts +4 -0
  69. package/lib/payment/invoice-prepaid/index.js +10 -0
  70. package/lib/payment/payrexx/adapter.d.ts +2 -0
  71. package/lib/payment/payrexx/adapter.js +161 -0
  72. package/lib/payment/payrexx/api.d.ts +2 -0
  73. package/lib/payment/payrexx/api.js +97 -0
  74. package/lib/payment/payrexx/index.d.ts +4 -1
  75. package/lib/payment/payrexx/index.js +19 -158
  76. package/lib/payment/postfinance-checkout/adapter.d.ts +2 -0
  77. package/lib/payment/postfinance-checkout/adapter.js +189 -0
  78. package/lib/payment/postfinance-checkout/index.d.ts +5 -0
  79. package/lib/payment/postfinance-checkout/index.js +25 -186
  80. package/lib/payment/postfinance-checkout/webhook.d.ts +2 -0
  81. package/lib/payment/postfinance-checkout/webhook.js +48 -0
  82. package/lib/payment/saferpay/adapter.js +1 -2
  83. package/lib/payment/saferpay/index.d.ts +5 -4
  84. package/lib/payment/saferpay/index.js +29 -3
  85. package/lib/payment/saferpay/webhook.d.ts +2 -0
  86. package/lib/payment/saferpay/webhook.js +64 -0
  87. package/lib/payment/stripe/adapter.d.ts +2 -0
  88. package/lib/payment/stripe/adapter.js +121 -0
  89. package/lib/payment/stripe/api.d.ts +6 -0
  90. package/lib/payment/stripe/api.js +165 -0
  91. package/lib/payment/stripe/index.d.ts +4 -1
  92. package/lib/payment/stripe/index.js +22 -116
  93. package/lib/payment/stripe/stripe.js +2 -5
  94. package/lib/presets/all.d.ts +1 -70
  95. package/lib/presets/all.js +41 -27
  96. package/lib/presets/base.d.ts +1 -25
  97. package/lib/presets/base.js +56 -25
  98. package/lib/presets/countries/ch.d.ts +1 -2
  99. package/lib/presets/countries/ch.js +7 -2
  100. package/lib/presets/crypto.d.ts +3 -7
  101. package/lib/presets/crypto.js +18 -7
  102. package/lib/pricing/{delivery-swiss-tax.d.ts → delivery-swiss-tax/adapter.d.ts} +1 -0
  103. package/lib/pricing/{delivery-swiss-tax.js → delivery-swiss-tax/adapter.js} +4 -4
  104. package/lib/pricing/delivery-swiss-tax/index.d.ts +4 -0
  105. package/lib/pricing/delivery-swiss-tax/index.js +10 -0
  106. package/lib/pricing/{discount-100-off.d.ts → discount-100-off/adapter.d.ts} +1 -0
  107. package/lib/pricing/{discount-100-off.js → discount-100-off/adapter.js} +2 -2
  108. package/lib/pricing/discount-100-off/index.d.ts +4 -0
  109. package/lib/pricing/discount-100-off/index.js +10 -0
  110. package/lib/pricing/{discount-half-price-manual.d.ts → discount-half-price-manual/adapter.d.ts} +1 -0
  111. package/lib/pricing/{discount-half-price-manual.js → discount-half-price-manual/adapter.js} +2 -2
  112. package/lib/pricing/discount-half-price-manual/index.d.ts +4 -0
  113. package/lib/pricing/discount-half-price-manual/index.js +10 -0
  114. package/lib/pricing/{free-delivery.d.ts → free-delivery/adapter.d.ts} +1 -0
  115. package/lib/pricing/{free-delivery.js → free-delivery/adapter.js} +2 -2
  116. package/lib/pricing/free-delivery/index.d.ts +4 -0
  117. package/lib/pricing/free-delivery/index.js +10 -0
  118. package/lib/pricing/{free-payment.d.ts → free-payment/adapter.d.ts} +1 -0
  119. package/lib/pricing/{free-payment.js → free-payment/adapter.js} +2 -2
  120. package/lib/pricing/free-payment/index.d.ts +4 -0
  121. package/lib/pricing/free-payment/index.js +10 -0
  122. package/lib/pricing/{order-delivery.d.ts → order-delivery/adapter.d.ts} +1 -0
  123. package/lib/pricing/{order-delivery.js → order-delivery/adapter.js} +2 -2
  124. package/lib/pricing/order-delivery/index.d.ts +4 -0
  125. package/lib/pricing/order-delivery/index.js +10 -0
  126. package/lib/pricing/{order-discount.d.ts → order-discount/adapter.d.ts} +1 -0
  127. package/lib/pricing/{order-discount.js → order-discount/adapter.js} +2 -2
  128. package/lib/pricing/order-discount/index.d.ts +4 -0
  129. package/lib/pricing/order-discount/index.js +10 -0
  130. package/lib/pricing/{order-items.d.ts → order-items/adapter.d.ts} +1 -0
  131. package/lib/pricing/{order-items.js → order-items/adapter.js} +2 -2
  132. package/lib/pricing/order-items/index.d.ts +4 -0
  133. package/lib/pricing/order-items/index.js +10 -0
  134. package/lib/pricing/{order-payment.d.ts → order-payment/adapter.d.ts} +1 -0
  135. package/lib/pricing/{order-payment.js → order-payment/adapter.js} +2 -2
  136. package/lib/pricing/order-payment/index.d.ts +4 -0
  137. package/lib/pricing/order-payment/index.js +10 -0
  138. package/lib/pricing/{product-catalog-price.d.ts → product-catalog-price/adapter.d.ts} +1 -0
  139. package/lib/pricing/{product-catalog-price.js → product-catalog-price/adapter.js} +2 -2
  140. package/lib/pricing/product-catalog-price/index.d.ts +4 -0
  141. package/lib/pricing/product-catalog-price/index.js +10 -0
  142. package/lib/pricing/{product-discount.d.ts → product-discount/adapter.d.ts} +1 -0
  143. package/lib/pricing/{product-discount.js → product-discount/adapter.js} +2 -2
  144. package/lib/pricing/product-discount/index.d.ts +4 -0
  145. package/lib/pricing/product-discount/index.js +10 -0
  146. package/lib/pricing/{product-price-rateconversion.d.ts → product-price-rateconversion/adapter.d.ts} +1 -0
  147. package/lib/pricing/{product-price-rateconversion.js → product-price-rateconversion/adapter.js} +2 -2
  148. package/lib/pricing/product-price-rateconversion/index.d.ts +4 -0
  149. package/lib/pricing/product-price-rateconversion/index.js +10 -0
  150. package/lib/pricing/{product-swiss-tax.d.ts → product-swiss-tax/adapter.d.ts} +1 -0
  151. package/lib/pricing/{product-swiss-tax.js → product-swiss-tax/adapter.js} +4 -4
  152. package/lib/pricing/product-swiss-tax/index.d.ts +4 -0
  153. package/lib/pricing/product-swiss-tax/index.js +10 -0
  154. package/lib/quotations/manual/adapter.d.ts +2 -0
  155. package/lib/quotations/{manual.js → manual/adapter.js} +2 -3
  156. package/lib/quotations/manual/index.d.ts +4 -0
  157. package/lib/quotations/manual/index.js +10 -0
  158. package/lib/warehousing/erc-metadata/api.d.ts +12 -0
  159. package/lib/warehousing/erc-metadata/api.js +43 -0
  160. package/lib/warehousing/erc-metadata/index.d.ts +3 -0
  161. package/lib/warehousing/erc-metadata/index.js +15 -0
  162. package/lib/warehousing/eth-minter/adapter.d.ts +2 -0
  163. package/lib/warehousing/{eth-minter.js → eth-minter/adapter.js} +3 -4
  164. package/lib/warehousing/eth-minter/index.d.ts +4 -0
  165. package/lib/warehousing/eth-minter/index.js +10 -0
  166. package/lib/warehousing/store/adapter.d.ts +2 -0
  167. package/lib/warehousing/{store.js → store/adapter.js} +2 -3
  168. package/lib/warehousing/store/index.d.ts +4 -0
  169. package/lib/warehousing/store/index.js +10 -0
  170. package/lib/worker/budgetsms/adapter.d.ts +22 -0
  171. package/lib/worker/{budgetsms.js → budgetsms/adapter.js} +3 -3
  172. package/lib/worker/budgetsms/index.d.ts +4 -0
  173. package/lib/worker/budgetsms/index.js +10 -0
  174. package/lib/worker/bulk-export/adapter.d.ts +3 -0
  175. package/lib/worker/{bulk-export.js → bulk-export/adapter.js} +3 -3
  176. package/lib/worker/bulk-export/index.d.ts +4 -0
  177. package/lib/worker/bulk-export/index.js +10 -0
  178. package/lib/worker/{bulk-import.d.ts → bulk-import/adapter.d.ts} +1 -0
  179. package/lib/worker/{bulk-import.js → bulk-import/adapter.js} +2 -2
  180. package/lib/worker/bulk-import/api.d.ts +7 -0
  181. package/lib/worker/bulk-import/api.js +53 -0
  182. package/lib/worker/bulk-import/index.d.ts +4 -0
  183. package/lib/worker/bulk-import/index.js +18 -0
  184. package/lib/worker/bulkgate/adapter.d.ts +12 -0
  185. package/lib/worker/{bulkgate.js → bulkgate/adapter.js} +3 -3
  186. package/lib/worker/bulkgate/index.d.ts +4 -0
  187. package/lib/worker/bulkgate/index.js +10 -0
  188. package/lib/worker/email/adapter.d.ts +9 -0
  189. package/lib/worker/{email.js → email/adapter.js} +27 -13
  190. package/lib/worker/email/index.d.ts +4 -0
  191. package/lib/worker/email/index.js +10 -0
  192. package/lib/worker/enrollment-order-generator/adapter.d.ts +4 -0
  193. package/lib/worker/{enrollment-order-generator.js → enrollment-order-generator/adapter.js} +2 -2
  194. package/lib/worker/enrollment-order-generator/index.d.ts +4 -0
  195. package/lib/worker/enrollment-order-generator/index.js +13 -0
  196. package/lib/worker/{error-notifications.d.ts → error-notifications/adapter.d.ts} +1 -0
  197. package/lib/worker/{error-notifications.js → error-notifications/adapter.js} +9 -8
  198. package/lib/worker/error-notifications/index.d.ts +4 -0
  199. package/lib/worker/error-notifications/index.js +13 -0
  200. package/lib/worker/{export-token.d.ts → export-token/adapter.d.ts} +1 -1
  201. package/lib/worker/{export-token.js → export-token/adapter.js} +2 -3
  202. package/lib/worker/export-token/index.d.ts +4 -0
  203. package/lib/worker/export-token/index.js +13 -0
  204. package/lib/worker/{external.d.ts → external/adapter.d.ts} +1 -0
  205. package/lib/worker/{external.js → external/adapter.js} +2 -2
  206. package/lib/worker/external/index.d.ts +4 -0
  207. package/lib/worker/external/index.js +10 -0
  208. package/lib/worker/heartbeat/adapter.d.ts +8 -0
  209. package/lib/worker/{heartbeat.js → heartbeat/adapter.js} +3 -3
  210. package/lib/worker/heartbeat/index.d.ts +4 -0
  211. package/lib/worker/heartbeat/index.js +10 -0
  212. package/lib/worker/{http-request.d.ts → http-request/adapter.d.ts} +1 -1
  213. package/lib/worker/{http-request.js → http-request/adapter.js} +2 -3
  214. package/lib/worker/http-request/index.d.ts +4 -0
  215. package/lib/worker/http-request/index.js +10 -0
  216. package/lib/worker/{message.d.ts → message/adapter.d.ts} +1 -0
  217. package/lib/worker/{message.js → message/adapter.js} +2 -2
  218. package/lib/worker/message/index.d.ts +4 -0
  219. package/lib/worker/message/index.js +10 -0
  220. package/lib/worker/push-notification/adapter.d.ts +9 -0
  221. package/lib/worker/{push-notification.js → push-notification/adapter.js} +3 -3
  222. package/lib/worker/push-notification/index.d.ts +4 -0
  223. package/lib/worker/push-notification/index.js +10 -0
  224. package/lib/worker/twilio/adapter.d.ts +8 -0
  225. package/lib/worker/{twilio.js → twilio/adapter.js} +3 -3
  226. package/lib/worker/twilio/index.d.ts +4 -0
  227. package/lib/worker/twilio/index.js +10 -0
  228. package/lib/worker/update-coinbase-rates/adapter.d.ts +4 -0
  229. package/lib/worker/{update-coinbase-rates.js → update-coinbase-rates/adapter.js} +8 -6
  230. package/lib/worker/update-coinbase-rates/index.d.ts +4 -0
  231. package/lib/worker/update-coinbase-rates/index.js +13 -0
  232. package/lib/worker/update-ecb-rates/adapter.d.ts +4 -0
  233. package/lib/worker/{update-ecb-rates.js → update-ecb-rates/adapter.js} +11 -9
  234. package/lib/worker/update-ecb-rates/index.d.ts +4 -0
  235. package/lib/worker/update-ecb-rates/index.js +13 -0
  236. package/lib/worker/{update-token-ownership.d.ts → update-token-ownership/adapter.d.ts} +2 -0
  237. package/lib/worker/{update-token-ownership.js → update-token-ownership/adapter.js} +8 -7
  238. package/lib/worker/update-token-ownership/index.d.ts +4 -0
  239. package/lib/worker/update-token-ownership/index.js +13 -0
  240. package/lib/worker/{zombie-killer.js → zombie-killer/adapter.js} +1 -2
  241. package/lib/worker/zombie-killer/index.d.ts +4 -0
  242. package/lib/worker/zombie-killer/index.js +10 -0
  243. package/package.json +15 -10
  244. package/lib/delivery/post.d.ts +0 -1
  245. package/lib/delivery/send-message.d.ts +0 -1
  246. package/lib/delivery/stores.d.ts +0 -1
  247. package/lib/enrollments/licensed.d.ts +0 -4
  248. package/lib/files/gridfs/handler-express.d.ts +0 -9
  249. package/lib/files/gridfs/handler-express.js +0 -110
  250. package/lib/files/gridfs/handler-fastify.d.ts +0 -3
  251. package/lib/files/gridfs/handler-fastify.js +0 -138
  252. package/lib/files/minio/handler-express.d.ts +0 -2
  253. package/lib/files/minio/handler-express.js +0 -36
  254. package/lib/files/minio/handler-fastify.d.ts +0 -3
  255. package/lib/files/minio/handler-fastify.js +0 -40
  256. package/lib/filters/local-search.d.ts +0 -3
  257. package/lib/filters/strict-equal.d.ts +0 -1
  258. package/lib/payment/apple-iap/handler-express.d.ts +0 -2
  259. package/lib/payment/apple-iap/handler-express.js +0 -103
  260. package/lib/payment/apple-iap/handler-fastify.d.ts +0 -3
  261. package/lib/payment/braintree.d.ts +0 -1
  262. package/lib/payment/braintree.js +0 -138
  263. package/lib/payment/cryptopay/handler-express.d.ts +0 -2
  264. package/lib/payment/cryptopay/handler-express.js +0 -19
  265. package/lib/payment/cryptopay/handler-fastify.d.ts +0 -3
  266. package/lib/payment/cryptopay/handler-fastify.js +0 -17
  267. package/lib/payment/cryptopay/plugin.d.ts +0 -3
  268. package/lib/payment/datatrans-v2/handler-express.d.ts +0 -1
  269. package/lib/payment/datatrans-v2/handler-express.js +0 -71
  270. package/lib/payment/datatrans-v2/handler-fastify.d.ts +0 -2
  271. package/lib/payment/datatrans-v2/handler-fastify.js +0 -71
  272. package/lib/payment/invoice-prepaid.d.ts +0 -1
  273. package/lib/payment/invoice.d.ts +0 -1
  274. package/lib/payment/paypal-checkout.d.ts +0 -1
  275. package/lib/payment/paypal-checkout.js +0 -87
  276. package/lib/payment/payrexx/handler-express.d.ts +0 -1
  277. package/lib/payment/payrexx/handler-express.js +0 -85
  278. package/lib/payment/payrexx/handler-fastify.d.ts +0 -2
  279. package/lib/payment/payrexx/handler-fastify.js +0 -91
  280. package/lib/payment/postfinance-checkout/handler-express.d.ts +0 -1
  281. package/lib/payment/postfinance-checkout/handler-express.js +0 -37
  282. package/lib/payment/postfinance-checkout/handler-fastify.d.ts +0 -2
  283. package/lib/payment/postfinance-checkout/handler-fastify.js +0 -40
  284. package/lib/payment/saferpay/handler-express.d.ts +0 -1
  285. package/lib/payment/saferpay/handler-express.js +0 -59
  286. package/lib/payment/saferpay/handler-fastify.d.ts +0 -2
  287. package/lib/payment/saferpay/handler-fastify.js +0 -62
  288. package/lib/payment/stripe/handler-express.d.ts +0 -5
  289. package/lib/payment/stripe/handler-express.js +0 -121
  290. package/lib/payment/stripe/handler-fastify.d.ts +0 -6
  291. package/lib/payment/stripe/handler-fastify.js +0 -131
  292. package/lib/presets/all-express.d.ts +0 -6
  293. package/lib/presets/all-express.js +0 -26
  294. package/lib/presets/all-fastify.d.ts +0 -6
  295. package/lib/presets/all-fastify.js +0 -49
  296. package/lib/presets/base-express.d.ts +0 -2
  297. package/lib/presets/base-express.js +0 -5
  298. package/lib/presets/base-fastify.d.ts +0 -3
  299. package/lib/presets/base-fastify.js +0 -16
  300. package/lib/presets/crypto-express.d.ts +0 -3
  301. package/lib/presets/crypto-express.js +0 -8
  302. package/lib/presets/crypto-fastify.d.ts +0 -3
  303. package/lib/presets/crypto-fastify.js +0 -11
  304. package/lib/pricing/discount-half-price.d.ts +0 -2
  305. package/lib/pricing/discount-half-price.js +0 -33
  306. package/lib/pricing/order-items-discount.d.ts +0 -2
  307. package/lib/pricing/order-items-discount.js +0 -50
  308. package/lib/pricing/order-round.d.ts +0 -10
  309. package/lib/pricing/order-round.js +0 -135
  310. package/lib/pricing/product-catalog-price-options.d.ts +0 -2
  311. package/lib/pricing/product-catalog-price-options.js +0 -51
  312. package/lib/pricing/product-round.d.ts +0 -10
  313. package/lib/pricing/product-round.js +0 -44
  314. package/lib/quotations/manual.d.ts +0 -1
  315. package/lib/warehousing/eth-minter.d.ts +0 -1
  316. package/lib/warehousing/store.d.ts +0 -1
  317. package/lib/worker/budgetsms.d.ts +0 -9
  318. package/lib/worker/bulk-export.d.ts +0 -2
  319. package/lib/worker/bulkgate.d.ts +0 -1
  320. package/lib/worker/email.d.ts +0 -1
  321. package/lib/worker/enrollment-order-generator.d.ts +0 -1
  322. package/lib/worker/heartbeat.d.ts +0 -1
  323. package/lib/worker/push-notification.d.ts +0 -1
  324. package/lib/worker/twilio.d.ts +0 -1
  325. package/lib/worker/update-coinbase-rates.d.ts +0 -1
  326. package/lib/worker/update-ecb-rates.d.ts +0 -1
  327. /package/lib/worker/{zombie-killer.d.ts → zombie-killer/adapter.d.ts} +0 -0
@@ -1,407 +1,24 @@
1
- import { createLogger } from '@unchainedshop/logger';
2
- import createDatatransAPI from "./api/index.js";
3
- import parseRegistrationData from "./parseRegistrationData.js";
4
- import roundedAmountFromOrder from "./roundedAmountFromOrder.js";
5
- import { PaymentAdapter, PaymentDirector, PaymentError, PaymentPricingRowCategory, PaymentPricingSheet, OrderPricingSheet, } from '@unchainedshop/core';
6
- const logger = createLogger('unchained:datatrans');
7
- const { DATATRANS_SECRET, DATATRANS_SIGN_KEY, DATATRANS_API_ENDPOINT = 'https://api.sandbox.datatrans.com', DATATRANS_MERCHANT_ID, } = process.env;
8
- const newDatatransError = ({ code, message }) => {
9
- const error = new Error(message);
10
- error.name = `DATATRANS_${code}`;
11
- return error;
12
- };
13
- const throwIfResponseError = (result) => {
14
- if (result.error) {
15
- const rawError = result.error;
16
- throw newDatatransError(rawError);
17
- }
18
- };
19
- const getMarketplaceSplits = async ({ order, orderPayment, config, }) => {
20
- const pricingForOrderPayment = PaymentPricingSheet({
21
- calculation: orderPayment.calculation,
22
- currencyCode: order.currencyCode,
23
- });
24
- const pricing = OrderPricingSheet({
25
- calculation: order.calculation,
26
- currencyCode: order.currencyCode,
27
- });
28
- const { amount: total } = pricing.total({ useNetPrice: false });
29
- return Promise.all(config
30
- .filter((item) => item.key === 'marketplaceSplit')
31
- .map((item) => {
32
- const [subMerchantId, staticDiscountId, sharePercentage] = item.value || ''.split(';').map((f) => f.trim());
33
- const { amount: discountSum } = pricingForOrderPayment.total({
34
- category: PaymentPricingRowCategory.Discount,
35
- discountId: staticDiscountId,
36
- });
37
- const shareFactor = sharePercentage ? parseInt(sharePercentage, 10) / 100 : 1;
38
- const amount = Math.round(total * shareFactor);
39
- const commission = Math.round(discountSum * -1 * shareFactor);
40
- return {
41
- subMerchantId,
42
- amount,
43
- commission,
44
- };
45
- }));
46
- };
47
- const Datatrans = {
48
- ...PaymentAdapter,
1
+ import { Datatrans } from "./adapter.js";
2
+ import { datatransWebhookHandler } from "./api.js";
3
+ const { DATATRANS_WEBHOOK_PATH = '/payment/datatrans/webhook' } = process.env;
4
+ const { DATATRANS_SIGN_KEY, DATATRANS_SIGN2_KEY } = process.env;
5
+ export const DatatransPlugin = {
49
6
  key: 'shop.unchained.datatrans',
50
- label: 'Datatrans',
7
+ label: 'Datatrans Payment Plugin',
51
8
  version: '2.0.0',
52
- initialConfiguration: [
9
+ adapters: [Datatrans],
10
+ routes: [
53
11
  {
54
- key: 'merchantId',
55
- value: null,
12
+ path: DATATRANS_WEBHOOK_PATH,
13
+ method: 'POST',
14
+ handler: datatransWebhookHandler,
56
15
  },
57
16
  ],
58
- typeSupported(type) {
59
- return type === 'GENERIC';
60
- },
61
- actions: (config, context) => {
62
- const getMerchantId = () => {
63
- return config.find((item) => item.key === 'merchantId')?.value || DATATRANS_MERCHANT_ID;
64
- };
65
- const api = () => {
66
- const merchantId = getMerchantId();
67
- if (!DATATRANS_SECRET)
68
- throw new Error('Credential DATATRANS_SECRET not Set');
69
- if (!merchantId)
70
- throw new Error('Credential Merchant ID not configured');
71
- if (!DATATRANS_API_ENDPOINT)
72
- throw new Error('Credential DATATRANS_API_ENDPOINT not Set');
73
- return createDatatransAPI(DATATRANS_API_ENDPOINT, merchantId, DATATRANS_SECRET);
74
- };
75
- const shouldSettleInUnchained = () => {
76
- return config.reduce((current, item) => {
77
- if (item.key === 'settleInUnchained')
78
- return Boolean(item.value);
79
- return current;
80
- }, true);
81
- };
82
- const authorize = async ({ paymentCredentials, ...arbitraryFields }) => {
83
- const { order, orderPayment } = context;
84
- if (!orderPayment)
85
- throw new Error('Order Payment missing in context');
86
- if (!order)
87
- throw new Error('Order missing in context');
88
- const refno = Buffer.from(orderPayment._id, 'hex').toString('base64');
89
- const userId = order?.userId || context?.userId;
90
- const refno2 = userId;
91
- const { currencyCode, amount } = roundedAmountFromOrder(order);
92
- const splits = await getMarketplaceSplits({
93
- orderPayment,
94
- order,
95
- config,
96
- });
97
- const result = await api().authorize({
98
- ...arbitraryFields,
99
- amount,
100
- currency: currencyCode,
101
- refno,
102
- refno2,
103
- autoSettle: false,
104
- customer: {
105
- id: userId,
106
- },
107
- marketplace: splits.length
108
- ? {
109
- splits,
110
- }
111
- : undefined,
112
- [paymentCredentials.meta.objectKey]: JSON.parse(paymentCredentials.token),
113
- });
114
- throwIfResponseError(result);
115
- return result.transactionId;
116
- };
117
- const authorizeAuth = async ({ transactionId, refno, refno2, ...arbitraryFields }) => {
118
- const { order } = context;
119
- if (!order)
120
- throw new Error('Order missing in context');
121
- const { currencyCode, amount } = roundedAmountFromOrder(order);
122
- const result = await api().authorizeAuthenticated({
123
- ...arbitraryFields,
124
- transactionId,
125
- amount,
126
- currency: currencyCode,
127
- refno,
128
- refno2,
129
- autoSettle: false,
130
- });
131
- throwIfResponseError(result);
132
- return result.acquirerAuthorizationCode;
133
- };
134
- const isTransactionAmountValid = (transaction) => {
135
- const { order } = context;
136
- if (!order)
137
- throw new Error('Order missing in context');
138
- const { currencyCode, amount } = roundedAmountFromOrder(order);
139
- if (transaction.currency !== currencyCode ||
140
- transaction.detail.authorize?.amount !== amount) {
141
- logger.info(`currency: ${transaction.currency} === ${currencyCode} => ${transaction.currency === currencyCode}, amount: ${transaction.detail.authorize?.amount} === ${amount} => ${transaction.detail.authorize?.amount === amount}`);
142
- return false;
143
- }
144
- return true;
145
- };
146
- const checkIfTransactionAmountValid = (transactionId, transaction) => {
147
- if (!isTransactionAmountValid(transaction)) {
148
- logger.error(`Transaction declined / Transaction ID ${transactionId} because of amount/currency mismatch`);
149
- throw newDatatransError({
150
- code: `YOU_HAVE_TO_PAY_THE_FULL_AMOUNT_DUDE`,
151
- message: 'Amount / Currency Mismatch with Cart',
152
- });
153
- }
154
- };
155
- const settle = async ({ transactionId, refno, refno2, extensions }) => {
156
- const { order, orderPayment } = context;
157
- if (!orderPayment)
158
- throw new Error('Order Payment missing in context');
159
- if (!order)
160
- throw new Error('Order missing in context');
161
- const { currencyCode, amount } = roundedAmountFromOrder(order);
162
- const splits = await getMarketplaceSplits({
163
- orderPayment,
164
- order,
165
- config,
166
- });
167
- const result = await api().settle({
168
- transactionId,
169
- amount,
170
- refno,
171
- refno2,
172
- currency: currencyCode,
173
- marketplace: splits.length
174
- ? {
175
- splits,
176
- }
177
- : undefined,
178
- extensions,
179
- });
180
- throwIfResponseError(result);
181
- return result;
182
- };
183
- const cancel = async ({ transactionId, refno }) => {
184
- const result = await api().cancel({
185
- transactionId,
186
- refno,
187
- });
188
- throwIfResponseError(result);
189
- return result;
190
- };
191
- const adapterActions = {
192
- ...PaymentAdapter.actions(config, context),
193
- configurationError() {
194
- if (!getMerchantId() || !DATATRANS_SECRET || !DATATRANS_SIGN_KEY) {
195
- return PaymentError.INCOMPLETE_CONFIGURATION;
196
- }
197
- return null;
198
- },
199
- isActive() {
200
- if (adapterActions.configurationError() === null)
201
- return true;
202
- return false;
203
- },
204
- isPayLaterAllowed() {
205
- return false;
206
- },
207
- async sign(transactionContext = {}) {
208
- const { useSecureFields = false, ...arbitraryFields } = transactionContext || {};
209
- const { orderPayment, paymentProvider, order } = context;
210
- const refno = Buffer.from(orderPayment ? orderPayment._id : paymentProvider._id, 'hex').toString('base64');
211
- const userId = order?.userId || context?.userId;
212
- const refno2 = userId;
213
- const price = order
214
- ? roundedAmountFromOrder(order)
215
- : {};
216
- if (useSecureFields) {
217
- const result = await api().secureFields({
218
- ...arbitraryFields,
219
- currency: price.currencyCode || 'CHF',
220
- refno,
221
- refno2,
222
- customer: {
223
- id: userId,
224
- },
225
- amount: price.amount,
226
- });
227
- throwIfResponseError(result);
228
- return JSON.stringify(result);
229
- }
230
- const result = await api().init({
231
- ...arbitraryFields,
232
- currency: price.currencyCode || 'CHF',
233
- refno,
234
- refno2,
235
- customer: {
236
- id: userId,
237
- },
238
- amount: price.amount,
239
- });
240
- throwIfResponseError(result);
241
- return JSON.stringify(result);
242
- },
243
- async validate(credentials) {
244
- if (!credentials.meta)
245
- return false;
246
- const { objectKey, currency } = credentials.meta;
247
- const result = await api().validate({
248
- refno: Buffer.from(`valid-${new Date().getTime()}`, 'hex').toString('base64'),
249
- currency,
250
- [objectKey]: JSON.parse(credentials.token),
251
- });
252
- return Boolean(result?.transactionId);
253
- },
254
- async register(transactionResponse) {
255
- const { transactionId } = transactionResponse;
256
- const result = (await api().status({
257
- transactionId,
258
- }));
259
- if (result.transactionId) {
260
- return parseRegistrationData(result);
261
- }
262
- return null;
263
- },
264
- async confirm() {
265
- if (!shouldSettleInUnchained())
266
- return false;
267
- const { orderPayment, transactionContext } = context;
268
- if (!orderPayment)
269
- throw new Error('Order Payment missing in context');
270
- const { transactionId } = orderPayment;
271
- const { extensions } = transactionContext || {};
272
- if (!transactionId) {
273
- return false;
274
- }
275
- const transaction = (await api().status({
276
- transactionId,
277
- }));
278
- throwIfResponseError(transaction);
279
- const { status } = transaction;
280
- if (status === 'authorized') {
281
- await settle({
282
- transactionId,
283
- refno: transaction.refno,
284
- refno2: transaction.refno2,
285
- extensions,
286
- });
287
- }
288
- return true;
289
- },
290
- async cancel() {
291
- if (!shouldSettleInUnchained())
292
- return false;
293
- const { orderPayment } = context;
294
- if (!orderPayment)
295
- throw new Error('Order Payment missing in context');
296
- const { transactionId } = orderPayment;
297
- if (!transactionId) {
298
- return false;
299
- }
300
- const transaction = (await api().status({
301
- transactionId,
302
- }));
303
- throwIfResponseError(transaction);
304
- const { status } = transaction;
305
- if (status === 'authorized') {
306
- await cancel({
307
- transactionId,
308
- refno: transaction.refno,
309
- });
310
- }
311
- return true;
312
- },
313
- async charge({ transactionId: rawTransactionId, paymentCredentials, authorizeAuthenticated, ...arbitraryFields }) {
314
- if (!rawTransactionId && !paymentCredentials) {
315
- logger.warn('Not trying to charge because of missing payment authorization response, return false to provide later');
316
- return false;
317
- }
318
- const transactionId = rawTransactionId ||
319
- (await authorize({
320
- ...arbitraryFields,
321
- paymentCredentials,
322
- }));
323
- const transaction = (await api().status({
324
- transactionId,
325
- }));
326
- throwIfResponseError(transaction);
327
- if (!transaction) {
328
- throw newDatatransError({
329
- code: `TRANSACTION_NOT_FOUND`,
330
- message: 'Amount / Currency Mismatch with Cart',
331
- });
332
- }
333
- let { status } = transaction;
334
- if (status === 'canceled' || status === 'failed') {
335
- logger.error(`Payment declined or canceled with Transaction ID ${transactionId} and status ${status}`);
336
- throw newDatatransError({
337
- code: `STATUS_${status.toUpperCase()}`,
338
- message: 'Payment declined or canceled',
339
- });
340
- }
341
- if (status === 'authenticated') {
342
- if (authorizeAuthenticated) {
343
- checkIfTransactionAmountValid(transactionId, transaction);
344
- await authorizeAuth({
345
- ...(authorizeAuthenticated || {}),
346
- transactionId,
347
- refno: transaction.refno,
348
- refno2: transaction.refno2,
349
- });
350
- status = 'authorized';
351
- }
352
- else {
353
- logger.error(`Transaction declined / Transaction ID ${transactionId} not authorized yet`);
354
- throw newDatatransError({
355
- code: `STATUS_${status.toUpperCase()}`,
356
- message: 'Payment authenticated but not authorized',
357
- });
358
- }
359
- }
360
- if (status === 'authorized' || status === 'settled') {
361
- let settledTransaction = transaction;
362
- let credentials;
363
- try {
364
- checkIfTransactionAmountValid(transactionId, settledTransaction);
365
- credentials = await parseRegistrationData(settledTransaction);
366
- const result = await api().status({
367
- transactionId,
368
- });
369
- if (result?.error) {
370
- settledTransaction = transaction;
371
- }
372
- else {
373
- settledTransaction = result;
374
- }
375
- }
376
- catch {
377
- await cancel({ transactionId, refno: settledTransaction.refno });
378
- logger.error(`Transaction declined / Transaction ID ${transactionId} authorization cancelled`);
379
- throw newDatatransError({
380
- code: `STATUS_${status.toUpperCase()}`,
381
- message: 'Payment cancelled server-side because of amount missmatch',
382
- });
383
- }
384
- return {
385
- transactionId,
386
- settledTransaction,
387
- arbitraryFields,
388
- credentials,
389
- };
390
- }
391
- if (status === 'initialized' ||
392
- status === 'challenge_required' ||
393
- status === 'challenge_ongoing' ||
394
- status === 'transmitted') {
395
- logger.error(`Transaction ID ${transactionId} in transit with status ${status}`);
396
- throw newDatatransError({
397
- code: `STATUS_${status.toUpperCase()}`,
398
- message: 'Transaction status invalid for checkout',
399
- });
400
- }
401
- return false;
402
- },
403
- };
404
- return adapterActions;
17
+ onRegister: () => {
18
+ if (!DATATRANS_SIGN_KEY && !DATATRANS_SIGN2_KEY) {
19
+ throw new Error('DATATRANS_SIGN_KEY not set');
20
+ }
405
21
  },
406
22
  };
407
- PaymentDirector.registerAdapter(Datatrans);
23
+ export default DatatransPlugin;
24
+ export { Datatrans } from "./adapter.js";
@@ -0,0 +1,2 @@
1
+ import { type IPaymentAdapter } from '@unchainedshop/core';
2
+ export declare const Invoice: IPaymentAdapter;
@@ -1,6 +1,6 @@
1
- import { PaymentAdapter, PaymentDirector } from '@unchainedshop/core';
1
+ import { PaymentAdapter } from '@unchainedshop/core';
2
2
  import { PaymentProviderType } from '@unchainedshop/core-payment';
3
- const Invoice = {
3
+ export const Invoice = {
4
4
  ...PaymentAdapter,
5
5
  key: 'shop.unchained.invoice',
6
6
  label: 'Invoice',
@@ -24,4 +24,3 @@ const Invoice = {
24
24
  };
25
25
  },
26
26
  };
27
- PaymentDirector.registerAdapter(Invoice);
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const InvoicePlugin: IPlugin;
3
+ export default InvoicePlugin;
4
+ export { Invoice } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { Invoice } from "./adapter.js";
3
+ export const InvoicePlugin = {
4
+ key: 'shop.unchained.invoice',
5
+ label: 'Invoice Payment Plugin',
6
+ version: '1.0.0',
7
+ adapters: [Invoice],
8
+ };
9
+ export default InvoicePlugin;
10
+ export { Invoice } from "./adapter.js";
@@ -0,0 +1,2 @@
1
+ import { type IPaymentAdapter } from '@unchainedshop/core';
2
+ export declare const InvoicePrepaid: IPaymentAdapter;
@@ -1,6 +1,6 @@
1
- import { PaymentAdapter, PaymentDirector } from '@unchainedshop/core';
1
+ import { PaymentAdapter } from '@unchainedshop/core';
2
2
  import { PaymentProviderType } from '@unchainedshop/core-payment';
3
- const InvoicePrepaid = {
3
+ export const InvoicePrepaid = {
4
4
  ...PaymentAdapter,
5
5
  key: 'shop.unchained.invoice-prepaid',
6
6
  label: 'Invoice pre-paid',
@@ -27,4 +27,3 @@ const InvoicePrepaid = {
27
27
  };
28
28
  },
29
29
  };
30
- PaymentDirector.registerAdapter(InvoicePrepaid);
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const InvoicePrepaidPlugin: IPlugin;
3
+ export default InvoicePrepaidPlugin;
4
+ export { InvoicePrepaid } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { InvoicePrepaid } from "./adapter.js";
3
+ export const InvoicePrepaidPlugin = {
4
+ key: 'shop.unchained.invoice-prepaid',
5
+ label: 'Invoice Prepaid Payment Plugin',
6
+ version: '1.0.0',
7
+ adapters: [InvoicePrepaid],
8
+ };
9
+ export default InvoicePrepaidPlugin;
10
+ export { InvoicePrepaid } from "./adapter.js";
@@ -0,0 +1,2 @@
1
+ import { type IPaymentAdapter } from '@unchainedshop/core';
2
+ export declare const Payrexx: IPaymentAdapter;
@@ -0,0 +1,161 @@
1
+ import { createLogger } from '@unchainedshop/logger';
2
+ import { mapOrderDataToGatewayObject, mapUserToGatewayObject } from "./payrexx.js";
3
+ import createPayrexxAPI, { GatewayObjectStatus } from "./api/index.js";
4
+ import { OrderPricingSheet, PaymentAdapter, PaymentError, } from '@unchainedshop/core';
5
+ const logger = createLogger('unchained:payrexx');
6
+ export const Payrexx = {
7
+ ...PaymentAdapter,
8
+ key: 'shop.unchained.payment.payrexx',
9
+ label: 'Payrexx',
10
+ version: '1.0.0',
11
+ typeSupported(type) {
12
+ return type === 'GENERIC';
13
+ },
14
+ actions: (config, context) => {
15
+ const { modules } = context;
16
+ const instance = config.find((c) => c.key === 'instance')?.value;
17
+ const adapterActions = {
18
+ ...PaymentAdapter.actions(config, context),
19
+ configurationError() {
20
+ if (!process.env.PAYREXX_SECRET) {
21
+ return PaymentError.INCOMPLETE_CONFIGURATION;
22
+ }
23
+ if (!instance) {
24
+ return PaymentError.INCOMPLETE_CONFIGURATION;
25
+ }
26
+ return null;
27
+ },
28
+ isActive: () => {
29
+ if (adapterActions.configurationError() === null)
30
+ return true;
31
+ return false;
32
+ },
33
+ isPayLaterAllowed() {
34
+ return false;
35
+ },
36
+ sign: async (transactionContext = {}) => {
37
+ const { orderPayment, userId, order } = context;
38
+ if (!order)
39
+ throw new Error('No order in context, can only sign with order context');
40
+ const api = createPayrexxAPI(instance, process.env.PAYREXX_SECRET);
41
+ if (orderPayment) {
42
+ const pricing = OrderPricingSheet({
43
+ calculation: order.calculation,
44
+ currencyCode: order.currencyCode,
45
+ });
46
+ const gatewayObject = mapOrderDataToGatewayObject({ order, orderPayment, pricing }, transactionContext);
47
+ const gateway = await api.createGateway(gatewayObject);
48
+ return JSON.stringify(gateway);
49
+ }
50
+ const user = userId && (await modules.users.findUserById(userId));
51
+ if (!user)
52
+ throw new Error('User not found, can only sign registrations with user context');
53
+ const emailAddress = modules.users.primaryEmail(user)?.address;
54
+ const gateway = await api.createGateway(mapUserToGatewayObject({
55
+ userId,
56
+ emailAddress,
57
+ currencyCode: order?.currencyCode,
58
+ }));
59
+ return JSON.stringify(gateway);
60
+ },
61
+ async register() {
62
+ throw new Error('Not implemented');
63
+ return null;
64
+ },
65
+ async confirm() {
66
+ const { orderPayment } = context;
67
+ if (!orderPayment?.transactionId) {
68
+ return false;
69
+ }
70
+ const { transactionId } = orderPayment;
71
+ const api = createPayrexxAPI(instance, process.env.PAYREXX_SECRET);
72
+ const gatewayObject = await api.getGateway(transactionId);
73
+ if (!gatewayObject) {
74
+ return false;
75
+ }
76
+ if (gatewayObject.status === GatewayObjectStatus.reserved) {
77
+ const allTransactions = gatewayObject.invoices?.flatMap((invoice) => invoice.transactions);
78
+ await Promise.all(allTransactions.map(async (transaction) => api.chargePreAuthorized(transaction.id, { referenceId: '__IGNORE_WEBHOOK__' })));
79
+ return true;
80
+ }
81
+ if (gatewayObject.status === GatewayObjectStatus.confirmed) {
82
+ return true;
83
+ }
84
+ return false;
85
+ },
86
+ async cancel() {
87
+ const { orderPayment } = context;
88
+ if (!orderPayment?.transactionId) {
89
+ return false;
90
+ }
91
+ const { transactionId } = orderPayment;
92
+ const api = createPayrexxAPI(instance, process.env.PAYREXX_SECRET);
93
+ const gatewayObject = await api.getGateway(transactionId);
94
+ if (!gatewayObject) {
95
+ return false;
96
+ }
97
+ if (gatewayObject.status === GatewayObjectStatus.reserved) {
98
+ const allTransactions = gatewayObject.invoices?.flatMap((invoice) => invoice.transactions);
99
+ await Promise.all(allTransactions.map(async (transaction) => api.deleteReservation(transaction.id)));
100
+ return true;
101
+ }
102
+ if (gatewayObject.status === GatewayObjectStatus.confirmed) {
103
+ return false;
104
+ }
105
+ return true;
106
+ },
107
+ charge: async ({ gatewayId, paymentCredentials }) => {
108
+ if (!gatewayId && !paymentCredentials) {
109
+ throw new Error('You have to provide gatewayId or paymentCredentials');
110
+ }
111
+ const { order, orderPayment } = context;
112
+ if (!order)
113
+ throw new Error('No order in context, can only charge with order context');
114
+ if (!orderPayment)
115
+ throw new Error('Order payment not found');
116
+ const api = createPayrexxAPI(instance, process.env.PAYREXX_SECRET);
117
+ const gatewayObject = await api.getGateway(gatewayId);
118
+ if (!gatewayObject) {
119
+ throw new Error('Could not load gateway from the Payrexx API');
120
+ }
121
+ const pricing = OrderPricingSheet({
122
+ calculation: order.calculation,
123
+ currencyCode: order.currencyCode,
124
+ });
125
+ const { currencyCode, amount } = pricing.total({ useNetPrice: false });
126
+ if (gatewayObject.status === 'reserved' ||
127
+ gatewayObject.status === 'confirmed') {
128
+ try {
129
+ if (gatewayObject.currency !== currencyCode.toUpperCase() ||
130
+ gatewayObject.amount !== Math.round(amount)) {
131
+ throw new Error('The price has changed since the intent has been created');
132
+ }
133
+ if (gatewayObject.referenceId !== orderPayment?._id) {
134
+ throw new Error('The order payment is different from the initiating intent');
135
+ }
136
+ logger.info(`Mark as charged, status is ${gatewayObject.status}`, {
137
+ orderPaymentId: gatewayObject.referenceId,
138
+ });
139
+ return {
140
+ transactionId: gatewayId,
141
+ gatewayObject,
142
+ };
143
+ }
144
+ catch (e) {
145
+ if (gatewayObject.status === GatewayObjectStatus.reserved) {
146
+ const allTransactions = gatewayObject.invoices?.flatMap((invoice) => invoice.transactions);
147
+ await Promise.all(allTransactions.map(async (transaction) => api.deleteReservation(transaction.id)));
148
+ }
149
+ throw e;
150
+ }
151
+ }
152
+ logger.info('Charge not possible', {
153
+ orderPaymentId: gatewayObject.referenceId,
154
+ status: gatewayObject.status,
155
+ });
156
+ throw new Error(`Gateway Status ${gatewayObject.status} does not allow checkout`);
157
+ },
158
+ };
159
+ return adapterActions;
160
+ },
161
+ };
@@ -0,0 +1,2 @@
1
+ import type { UnchainedCore } from '@unchainedshop/core';
2
+ export declare function payrexxWebhookHandler(request: Request, context: UnchainedCore): Promise<Response>;