@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
@@ -0,0 +1,165 @@
1
+ import { createLogger } from '@unchainedshop/logger';
2
+ import { stripe } from "./stripe.js";
3
+ const logger = createLogger('unchained:stripe:handler');
4
+ export const WebhookEventTypes = {
5
+ PAYMENT_INTENT_SUCCEEDED: 'payment_intent.succeeded',
6
+ SETUP_INTENT_SUCCEEDED: 'setup_intent.succeeded',
7
+ };
8
+ export async function stripeWebhookHandler(request, context) {
9
+ try {
10
+ const { modules, services } = context;
11
+ const sig = request.headers.get('stripe-signature');
12
+ if (!sig) {
13
+ logger.error('stripe-signature header was not provided for webhook');
14
+ return new Response(JSON.stringify({
15
+ success: false,
16
+ message: 'stripe-signature header was not provided for webhook',
17
+ name: 'MISSING_SIGNATURE',
18
+ }), {
19
+ status: 400,
20
+ headers: { 'Content-Type': 'application/json' },
21
+ });
22
+ }
23
+ if (!process.env.STRIPE_ENDPOINT_SECRET) {
24
+ logger.error('env STRIPE_ENDPOINT_SECRET is required for webhook handling');
25
+ return new Response(JSON.stringify({
26
+ success: false,
27
+ message: 'env STRIPE_ENDPOINT_SECRET is required for webhook handling',
28
+ name: 'MISSING_ENDPOINT_SECRET',
29
+ }), {
30
+ status: 500,
31
+ headers: { 'Content-Type': 'application/json' },
32
+ });
33
+ }
34
+ const rawBody = await request.text();
35
+ let event;
36
+ try {
37
+ event = stripe.webhooks.constructEvent(rawBody, sig, process.env.STRIPE_ENDPOINT_SECRET);
38
+ }
39
+ catch (err) {
40
+ logger.error(`Error constructing event: ${err.message}`);
41
+ return new Response(JSON.stringify({
42
+ success: false,
43
+ message: err.message,
44
+ name: err.name || 'SIGNATURE_VERIFICATION_FAILED',
45
+ }), {
46
+ status: 400,
47
+ headers: { 'Content-Type': 'application/json' },
48
+ });
49
+ }
50
+ if (!Object.values(WebhookEventTypes).includes(event.type)) {
51
+ logger.info(`unhandled event type`, {
52
+ type: event.type,
53
+ });
54
+ return new Response(JSON.stringify({
55
+ success: false,
56
+ ignored: true,
57
+ name: 'UNHANDLED_EVENT_TYPE',
58
+ message: `Unhandled event type: ${event.type}. Supported types: ${Object.values(WebhookEventTypes).join(', ')}`,
59
+ }), {
60
+ status: 200,
61
+ headers: { 'Content-Type': 'application/json' },
62
+ });
63
+ }
64
+ const environmentInMetadata = event.data?.object?.metadata?.environment || '';
65
+ const environmentInEnv = process.env.STRIPE_WEBHOOK_ENVIRONMENT || '';
66
+ if (environmentInMetadata !== environmentInEnv) {
67
+ logger.info(`unhandled event environment`, {
68
+ type: event.type,
69
+ environment: environmentInMetadata,
70
+ });
71
+ return new Response(JSON.stringify({
72
+ success: false,
73
+ ignored: true,
74
+ name: 'UNHANDLED_EVENT_ENVIRONMENT',
75
+ message: `Unhandled event environment: ${environmentInMetadata}. Supported environment: ${environmentInEnv}`,
76
+ }), {
77
+ status: 200,
78
+ headers: { 'Content-Type': 'application/json' },
79
+ });
80
+ }
81
+ logger.info(`Processing event`, {
82
+ type: event.type,
83
+ });
84
+ if (event.type === WebhookEventTypes.PAYMENT_INTENT_SUCCEEDED) {
85
+ const paymentIntent = event.data.object;
86
+ const { orderPaymentId } = paymentIntent.metadata || {};
87
+ logger.info(`checkout with orderPaymentId: ${orderPaymentId}`, {
88
+ type: event.type,
89
+ });
90
+ await modules.orders.payments.logEvent(orderPaymentId, event);
91
+ const orderPayment = await modules.orders.payments.findOrderPayment({
92
+ orderPaymentId,
93
+ });
94
+ if (!orderPayment) {
95
+ throw new Error(`order payment not found with orderPaymentId: ${orderPaymentId}`);
96
+ }
97
+ const order = await services.orders.checkoutOrder(orderPayment.orderId, {
98
+ paymentContext: {
99
+ paymentIntentId: paymentIntent.id,
100
+ },
101
+ });
102
+ if (!order)
103
+ throw new Error(`Order with id ${orderPayment.orderId} not found`);
104
+ logger.info(`checkout successful`, {
105
+ orderPaymentId,
106
+ orderId: order._id,
107
+ type: event.type,
108
+ });
109
+ return new Response(JSON.stringify({
110
+ success: true,
111
+ message: 'checkout successful',
112
+ orderId: order._id,
113
+ }), {
114
+ status: 200,
115
+ headers: { 'Content-Type': 'application/json' },
116
+ });
117
+ }
118
+ if (event.type === WebhookEventTypes.SETUP_INTENT_SUCCEEDED) {
119
+ const setupIntent = event.data.object;
120
+ const { paymentProviderId, userId } = setupIntent.metadata || {};
121
+ logger.info(`registered payment credential with paymentProviderId: ${paymentProviderId}`, {
122
+ type: event.type,
123
+ userId,
124
+ });
125
+ const paymentCredentials = await services.orders.registerPaymentCredentials(paymentProviderId, {
126
+ transactionContext: {
127
+ setupIntentId: setupIntent.id,
128
+ },
129
+ userId,
130
+ });
131
+ logger.info(`payment credentials registration successful`, {
132
+ userId,
133
+ paymentProviderId,
134
+ paymentCredentialsId: paymentCredentials?._id,
135
+ type: event.type,
136
+ });
137
+ return new Response(JSON.stringify({
138
+ success: true,
139
+ message: 'payment credentials registration successful',
140
+ paymentCredentialsId: paymentCredentials?._id,
141
+ }), {
142
+ status: 200,
143
+ headers: { 'Content-Type': 'application/json' },
144
+ });
145
+ }
146
+ return new Response(JSON.stringify({
147
+ success: false,
148
+ message: 'Unhandled event type',
149
+ }), {
150
+ status: 200,
151
+ headers: { 'Content-Type': 'application/json' },
152
+ });
153
+ }
154
+ catch (error) {
155
+ logger.error(error);
156
+ return new Response(JSON.stringify({
157
+ success: false,
158
+ message: error.message,
159
+ name: error.name,
160
+ }), {
161
+ status: 500,
162
+ headers: { 'Content-Type': 'application/json' },
163
+ });
164
+ }
165
+ }
@@ -1 +1,4 @@
1
- export {};
1
+ import type { IPlugin } from '@unchainedshop/core';
2
+ export declare const StripePlugin: IPlugin;
3
+ export default StripePlugin;
4
+ export { Stripe } from './adapter.ts';
@@ -1,122 +1,28 @@
1
1
  import { createLogger } from '@unchainedshop/logger';
2
- import { stripe, createOrderPaymentIntent, createRegistrationIntent } from "./stripe.js";
3
- import { OrderPricingSheet, PaymentAdapter, PaymentDirector, PaymentError, } from '@unchainedshop/core';
2
+ import { Stripe } from "./adapter.js";
3
+ import { stripeWebhookHandler } from "./api.js";
4
+ const { STRIPE_WEBHOOK_PATH = '/payment/stripe/webhook' } = process.env;
4
5
  const logger = createLogger('unchained:stripe');
5
- const Stripe = {
6
- ...PaymentAdapter,
6
+ export const StripePlugin = {
7
7
  key: 'shop.unchained.payment.stripe',
8
- label: 'Stripe',
8
+ label: 'Stripe Payment Plugin',
9
9
  version: '2.0.0',
10
- typeSupported(type) {
11
- return type === 'GENERIC';
12
- },
13
- actions: (config, context) => {
14
- const { modules } = context;
15
- const descriptorPrefix = config.find(({ key }) => key === 'descriptorPrefix')?.value || '';
16
- const assertUserData = async (forcedUserId) => {
17
- const userId = forcedUserId || context?.userId;
18
- const user = await modules.users.findUserById(userId);
19
- if (!user)
20
- throw new Error('User not found');
21
- const email = modules.users.primaryEmail(user)?.address;
22
- const name = user.profile?.displayName || user.username || email;
23
- return {
24
- email,
25
- name,
26
- userId,
27
- };
28
- };
29
- const adapterActions = {
30
- ...PaymentAdapter.actions(config, context),
31
- configurationError() {
32
- if (!stripe)
33
- return PaymentError.INCOMPLETE_CONFIGURATION;
34
- return null;
35
- },
36
- isActive: () => {
37
- if (adapterActions.configurationError() === null)
38
- return true;
39
- return false;
40
- },
41
- isPayLaterAllowed() {
42
- return false;
43
- },
44
- validate: async ({ token }) => {
45
- const paymentMethod = await stripe.paymentMethods.retrieve(token);
46
- return !!paymentMethod;
47
- },
48
- register: async ({ setupIntentId }) => {
49
- if (!setupIntentId) {
50
- throw new Error('You have to provide a setupIntentId');
51
- }
52
- const setupIntent = await stripe.setupIntents.retrieve(setupIntentId);
53
- if (setupIntent.status === 'succeeded') {
54
- return {
55
- token: setupIntent.payment_method,
56
- customer: setupIntent.customer,
57
- payment_method_types: setupIntent.payment_method_types,
58
- usage: setupIntent.usage,
59
- };
60
- }
61
- logger.warn('Registration declined', setupIntentId);
62
- return null;
63
- },
64
- sign: async (transactionContext = {}) => {
65
- const { orderPayment, order, paymentProvider } = context;
66
- const { userId, name, email } = await assertUserData(order?.userId);
67
- if (orderPayment) {
68
- if (!order)
69
- throw new Error('order not found in context');
70
- const pricing = OrderPricingSheet({
71
- calculation: order?.calculation,
72
- currencyCode: order?.currencyCode,
73
- });
74
- const paymentIntent = await createOrderPaymentIntent({ userId, name, email, order, orderPayment, pricing, descriptorPrefix }, transactionContext);
75
- return paymentIntent.client_secret;
76
- }
77
- const paymentIntent = await createRegistrationIntent({ userId, name, email, paymentProviderId: paymentProvider._id, descriptorPrefix }, transactionContext);
78
- return paymentIntent.client_secret;
79
- },
80
- charge: async ({ paymentIntentId, paymentCredentials }) => {
81
- if (!paymentIntentId && !paymentCredentials) {
82
- throw new Error('You have to provide paymentIntentId or paymentCredentials');
83
- }
84
- const { order, orderPayment } = context;
85
- if (!order)
86
- throw new Error('order not found in context');
87
- if (!orderPayment)
88
- throw new Error('orderPayment not found in context');
89
- const { userId, name, email } = await assertUserData(order?.userId);
90
- const pricing = OrderPricingSheet({
91
- calculation: order.calculation,
92
- currencyCode: order.currencyCode,
93
- });
94
- const paymentIntentObject = paymentIntentId
95
- ? await stripe.paymentIntents.retrieve(paymentIntentId)
96
- : await createOrderPaymentIntent({ userId, name, email, orderPayment, order, pricing, descriptorPrefix }, {
97
- customer: paymentCredentials.meta?.customer,
98
- confirm: true,
99
- payment_method: paymentCredentials.token,
100
- payment_method_types: paymentCredentials.meta?.payment_method_types,
101
- });
102
- const { currencyCode, amount } = pricing.total({ useNetPrice: false });
103
- if (paymentIntentObject.currency !== currencyCode.toLowerCase() ||
104
- paymentIntentObject.amount !== Math.round(amount)) {
105
- throw new Error('The price has changed since the intent has been created');
106
- }
107
- if (paymentIntentObject.metadata?.orderPaymentId !== orderPayment?._id) {
108
- throw new Error('The order payment is different from the initiating intent');
109
- }
110
- if (paymentIntentObject.status === 'succeeded') {
111
- return paymentIntentObject;
112
- }
113
- logger.info('Charge postponed because paymentIntent has wrong status', {
114
- orderPaymentId: paymentIntentObject.id,
115
- });
116
- return false;
117
- },
118
- };
119
- return adapterActions;
10
+ adapters: [Stripe],
11
+ routes: [
12
+ {
13
+ path: STRIPE_WEBHOOK_PATH,
14
+ method: 'POST',
15
+ handler: stripeWebhookHandler,
16
+ },
17
+ ],
18
+ onRegister: () => {
19
+ if (!process.env.STRIPE_SECRET) {
20
+ throw new Error('STRIPE_SECRET not set');
21
+ }
22
+ if (!process.env.STRIPE_ENDPOINT_SECRET) {
23
+ logger.warn('STRIPE_ENDPOINT_SECRET not set - webhooks will not work');
24
+ }
120
25
  },
121
26
  };
122
- PaymentDirector.registerAdapter(Stripe);
27
+ export default StripePlugin;
28
+ export { Stripe } from "./adapter.js";
@@ -3,14 +3,11 @@ const logger = createLogger('unchained:stripe');
3
3
  const { STRIPE_SECRET, STRIPE_WEBHOOK_ENVIRONMENT, EMAIL_WEBSITE_NAME } = process.env;
4
4
  export let stripe;
5
5
  const environment = STRIPE_WEBHOOK_ENVIRONMENT ?? null;
6
- if (!STRIPE_SECRET) {
7
- logger.warn('STRIPE_SECRET is not set, skipping initialization');
8
- }
9
- else {
6
+ if (STRIPE_SECRET) {
10
7
  try {
11
8
  const { default: Stripe } = await import('stripe');
12
9
  stripe = new Stripe(STRIPE_SECRET, {
13
- apiVersion: '2025-12-15.clover',
10
+ apiVersion: '2026-02-25.clover',
14
11
  });
15
12
  }
16
13
  catch {
@@ -1,70 +1 @@
1
- import './countries/ch.ts';
2
- import '../delivery/send-message.ts';
3
- import '../delivery/stores.ts';
4
- import '../payment/invoice-prepaid.ts';
5
- import '../payment/paypal-checkout.ts';
6
- import '../payment/stripe/index.ts';
7
- import '../payment/postfinance-checkout/index.ts';
8
- import '../payment/datatrans-v2/index.ts';
9
- import '../payment/payrexx/index.ts';
10
- import '../filters/strict-equal.ts';
11
- import '../filters/local-search.ts';
12
- import '../worker/twilio.ts';
13
- import '../worker/bulkgate.ts';
14
- import '../worker/budgetsms.ts';
15
- import '../worker/push-notification.ts';
16
- import '../worker/enrollment-order-generator.ts';
17
- declare const modules: {
18
- saferpayTransactions: {
19
- configure: ({ db }: {
20
- db: import("mongodb").Db;
21
- }) => Promise<{
22
- findTransactionById: (_id: import("bson").ObjectId) => Promise<import("mongodb").WithId<import("../payment/saferpay/db/SaferpayTransactionsCollection.ts").SaferpayTransaction> | null>;
23
- createTransaction: (orderPaymentId: any) => Promise<import("bson").ObjectId>;
24
- setToken: (_id: import("bson").ObjectId, token: string) => Promise<void>;
25
- }>;
26
- };
27
- appleTransactions: {
28
- configure: ({ db }: {
29
- db: any;
30
- }) => Promise<{
31
- findTransactionById: (transactionIdentifier: string) => Promise<import("../payment/apple-iap/db/AppleTransactionsCollection.ts").AppleTransaction | null>;
32
- createTransaction: (doc: Omit<import("../payment/apple-iap/db/AppleTransactionsCollection.ts").AppleTransaction, "_id" | "created"> & Pick<Partial<import("../payment/apple-iap/db/AppleTransactionsCollection.ts").AppleTransaction>, "_id" | "created">) => Promise<string>;
33
- }>;
34
- };
35
- cryptopay: {
36
- configure: ({ db }: {
37
- db: any;
38
- }) => {
39
- getWalletAddress: (address: string, contract?: string) => Promise<import("../payment/cryptopay/db/CryptopayTransactions.ts").CryptopayTransaction | null>;
40
- updateMostRecentBlock: (currencyCode: string, blockHeight: number) => Promise<void>;
41
- updateWalletAddress: ({ address, blockHeight, amount, contract, currencyCode, decimals, }: {
42
- address: string;
43
- blockHeight: number;
44
- amount: string | number;
45
- contract?: string;
46
- currencyCode: string;
47
- decimals: number;
48
- }) => Promise<import("../payment/cryptopay/db/CryptopayTransactions.ts").CryptopayTransaction>;
49
- mapOrderPaymentToWalletAddress: ({ address, contract, currencyCode, orderPaymentId, }: {
50
- address: string;
51
- contract?: string;
52
- currencyCode: string;
53
- orderPaymentId: string;
54
- }) => Promise<import("../payment/cryptopay/db/CryptopayTransactions.ts").CryptopayTransaction>;
55
- getNextDerivationNumber: (currencyCode: string) => Promise<number>;
56
- getWalletAddressesByOrderPaymentId: (orderPaymentId: string) => Promise<import("../payment/cryptopay/db/CryptopayTransactions.ts").CryptopayTransaction[]>;
57
- };
58
- };
59
- gridfsFileUploads: {
60
- configure: ({ db }: {
61
- db: any;
62
- }) => {
63
- createWriteStream: (directoryName: any, fileId: any, fileName: any, uploadOptions: import("mongodb").GridFSBucketWriteStream["options"]) => Promise<import("mongodb").GridFSBucketWriteStream>;
64
- getFileInfo: (directoryName: any, fileId: any) => Promise<import("mongodb").GridFSFile | null>;
65
- createReadStream: (directoryName: any, fileId: any) => Promise<import("mongodb").GridFSBucketReadStream>;
66
- removeFileFromBucket: (directoryName: any, fileId: any) => Promise<void>;
67
- };
68
- };
69
- };
70
- export default modules;
1
+ export declare function registerAllPlugins(): void;
@@ -1,27 +1,41 @@
1
- import baseModules from "./base.js";
2
- import "./countries/ch.js";
3
- import cryptoModules from "./crypto.js";
4
- import "../delivery/send-message.js";
5
- import "../delivery/stores.js";
6
- import "../payment/invoice-prepaid.js";
7
- import "../payment/paypal-checkout.js";
8
- import appleTransactionsModules from "../payment/apple-iap/index.js";
9
- import saferpayTransactionsModules from "../payment/saferpay/index.js";
10
- import "../payment/stripe/index.js";
11
- import "../payment/postfinance-checkout/index.js";
12
- import "../payment/datatrans-v2/index.js";
13
- import "../payment/payrexx/index.js";
14
- import "../filters/strict-equal.js";
15
- import "../filters/local-search.js";
16
- import "../worker/twilio.js";
17
- import "../worker/bulkgate.js";
18
- import "../worker/budgetsms.js";
19
- import "../worker/push-notification.js";
20
- import "../worker/enrollment-order-generator.js";
21
- const modules = {
22
- ...baseModules,
23
- ...cryptoModules,
24
- ...appleTransactionsModules,
25
- ...saferpayTransactionsModules,
26
- };
27
- export default modules;
1
+ import { registerBasePlugins } from "./base.js";
2
+ import { registerCryptoPlugins } from "./crypto.js";
3
+ import { registerSwissTaxPlugins } from "./countries/ch.js";
4
+ import { pluginRegistry } from '@unchainedshop/core';
5
+ import { DatatransPlugin } from "../payment/datatrans-v2/index.js";
6
+ import { StripePlugin } from "../payment/stripe/index.js";
7
+ import { InvoicePrepaidPlugin } from "../payment/invoice-prepaid/index.js";
8
+ import { SendMessagePlugin } from "../delivery/send-message/index.js";
9
+ import { PickMupPlugin } from "../delivery/stores/index.js";
10
+ import { AppleIAPPlugin } from "../payment/apple-iap/index.js";
11
+ import { PayrexxPlugin } from "../payment/payrexx/index.js";
12
+ import { PostfinanceCheckoutPlugin } from "../payment/postfinance-checkout/index.js";
13
+ import { SaferpayPlugin } from "../payment/saferpay/index.js";
14
+ import { StrictQualFilterPlugin } from "../filters/strict-equal/index.js";
15
+ import { LocalSearchPlugin } from "../filters/local-search/index.js";
16
+ import { TwilioPlugin } from "../worker/twilio/index.js";
17
+ import { BulkGatePlugin } from "../worker/bulkgate/index.js";
18
+ import { BudgetSMSPlugin } from "../worker/budgetsms/index.js";
19
+ import { PushNotificationPlugin } from "../worker/push-notification/index.js";
20
+ import { EnrollmentOrderGeneratorPlugin } from "../worker/enrollment-order-generator/index.js";
21
+ export function registerAllPlugins() {
22
+ registerBasePlugins();
23
+ registerCryptoPlugins();
24
+ registerSwissTaxPlugins();
25
+ pluginRegistry.register(DatatransPlugin);
26
+ pluginRegistry.register(StripePlugin);
27
+ pluginRegistry.register(AppleIAPPlugin);
28
+ pluginRegistry.register(PayrexxPlugin);
29
+ pluginRegistry.register(PostfinanceCheckoutPlugin);
30
+ pluginRegistry.register(SaferpayPlugin);
31
+ pluginRegistry.register(InvoicePrepaidPlugin);
32
+ pluginRegistry.register(SendMessagePlugin);
33
+ pluginRegistry.register(PickMupPlugin);
34
+ pluginRegistry.register(StrictQualFilterPlugin);
35
+ pluginRegistry.register(LocalSearchPlugin);
36
+ pluginRegistry.register(TwilioPlugin);
37
+ pluginRegistry.register(BulkGatePlugin);
38
+ pluginRegistry.register(BudgetSMSPlugin);
39
+ pluginRegistry.register(PushNotificationPlugin);
40
+ pluginRegistry.register(EnrollmentOrderGeneratorPlugin);
41
+ }
@@ -1,25 +1 @@
1
- import '../delivery/post.ts';
2
- import '../payment/invoice.ts';
3
- import '../warehousing/store.ts';
4
- import '../pricing/free-payment.ts';
5
- import '../pricing/free-delivery.ts';
6
- import '../pricing/order-items.ts';
7
- import '../pricing/order-discount.ts';
8
- import '../pricing/order-delivery.ts';
9
- import '../pricing/order-payment.ts';
10
- import '../pricing/product-catalog-price.ts';
11
- import '../pricing/product-discount.ts';
12
- import '../quotations/manual.ts';
13
- import '../enrollments/licensed.ts';
14
- import '../events/node-event-emitter.ts';
15
- import '../worker/bulk-import.ts';
16
- import '../worker/zombie-killer.ts';
17
- import '../worker/message.ts';
18
- import '../worker/external.ts';
19
- import '../worker/http-request.ts';
20
- import '../worker/heartbeat.ts';
21
- import '../worker/email.ts';
22
- import '../worker/error-notifications.ts';
23
- import '../worker/bulk-export.ts';
24
- import gridfsModules from '../files/gridfs/index.ts';
25
- export default gridfsModules;
1
+ export declare function registerBasePlugins(): void;
@@ -1,25 +1,56 @@
1
- import "../delivery/post.js";
2
- import "../payment/invoice.js";
3
- import "../warehousing/store.js";
4
- import "../pricing/free-payment.js";
5
- import "../pricing/free-delivery.js";
6
- import "../pricing/order-items.js";
7
- import "../pricing/order-discount.js";
8
- import "../pricing/order-delivery.js";
9
- import "../pricing/order-payment.js";
10
- import "../pricing/product-catalog-price.js";
11
- import "../pricing/product-discount.js";
12
- import "../quotations/manual.js";
13
- import "../enrollments/licensed.js";
14
- import "../events/node-event-emitter.js";
15
- import "../worker/bulk-import.js";
16
- import "../worker/zombie-killer.js";
17
- import "../worker/message.js";
18
- import "../worker/external.js";
19
- import "../worker/http-request.js";
20
- import "../worker/heartbeat.js";
21
- import "../worker/email.js";
22
- import "../worker/error-notifications.js";
23
- import "../worker/bulk-export.js";
24
- import gridfsModules from "../files/gridfs/index.js";
25
- export default gridfsModules;
1
+ import { pluginRegistry } from '@unchainedshop/core';
2
+ import { setEmitAdapter } from '@unchainedshop/events';
3
+ import { GridFSPlugin } from "../files/gridfs/index.js";
4
+ import { TempUploadPlugin } from "../files/temp-upload/index.js";
5
+ import { InvoicePlugin } from "../payment/invoice/index.js";
6
+ import { PostPlugin } from "../delivery/post/index.js";
7
+ import { StorePlugin } from "../warehousing/store/index.js";
8
+ import { ERCMetadataPlugin } from "../warehousing/erc-metadata/index.js";
9
+ import { PaymentFreePricePlugin } from "../pricing/free-payment/index.js";
10
+ import { DeliveryFreePricePlugin } from "../pricing/free-delivery/index.js";
11
+ import { OrderItemsPlugin } from "../pricing/order-items/index.js";
12
+ import { OrderDiscountPlugin } from "../pricing/order-discount/index.js";
13
+ import { OrderDeliveryPlugin } from "../pricing/order-delivery/index.js";
14
+ import { OrderPaymentPlugin } from "../pricing/order-payment/index.js";
15
+ import { ProductPricePlugin } from "../pricing/product-catalog-price/index.js";
16
+ import { ProductDiscountPlugin } from "../pricing/product-discount/index.js";
17
+ import { ManualOfferingPlugin } from "../quotations/manual/index.js";
18
+ import { LicensedEnrollmentsPlugin } from "../enrollments/licensed/index.js";
19
+ import { NodeEventEmitter } from "../events/node-event-emitter.js";
20
+ import { BulkImportPlugin } from "../worker/bulk-import/index.js";
21
+ import { ZombieKillerPlugin } from "../worker/zombie-killer/index.js";
22
+ import { MessagePlugin } from "../worker/message/index.js";
23
+ import { ExternalPlugin } from "../worker/external/index.js";
24
+ import { HttpRequestPlugin } from "../worker/http-request/index.js";
25
+ import { HeartbeatPlugin } from "../worker/heartbeat/index.js";
26
+ import { EmailPlugin } from "../worker/email/index.js";
27
+ import { ErrorNotificationsPlugin } from "../worker/error-notifications/index.js";
28
+ import { BulkExportPlugin } from "../worker/bulk-export/index.js";
29
+ export function registerBasePlugins() {
30
+ pluginRegistry.register(GridFSPlugin);
31
+ pluginRegistry.register(TempUploadPlugin);
32
+ pluginRegistry.register(InvoicePlugin);
33
+ pluginRegistry.register(PostPlugin);
34
+ pluginRegistry.register(StorePlugin);
35
+ pluginRegistry.register(ERCMetadataPlugin);
36
+ pluginRegistry.register(PaymentFreePricePlugin);
37
+ pluginRegistry.register(DeliveryFreePricePlugin);
38
+ pluginRegistry.register(OrderItemsPlugin);
39
+ pluginRegistry.register(OrderDiscountPlugin);
40
+ pluginRegistry.register(OrderDeliveryPlugin);
41
+ pluginRegistry.register(OrderPaymentPlugin);
42
+ pluginRegistry.register(ProductPricePlugin);
43
+ pluginRegistry.register(ProductDiscountPlugin);
44
+ pluginRegistry.register(ManualOfferingPlugin);
45
+ pluginRegistry.register(LicensedEnrollmentsPlugin);
46
+ setEmitAdapter(NodeEventEmitter());
47
+ pluginRegistry.register(BulkImportPlugin);
48
+ pluginRegistry.register(ZombieKillerPlugin);
49
+ pluginRegistry.register(MessagePlugin);
50
+ pluginRegistry.register(ExternalPlugin);
51
+ pluginRegistry.register(HttpRequestPlugin);
52
+ pluginRegistry.register(HeartbeatPlugin);
53
+ pluginRegistry.register(EmailPlugin);
54
+ pluginRegistry.register(ErrorNotificationsPlugin);
55
+ pluginRegistry.register(BulkExportPlugin);
56
+ }
@@ -1,2 +1 @@
1
- import '../../pricing/product-swiss-tax.ts';
2
- import '../../pricing/delivery-swiss-tax.ts';
1
+ export declare function registerSwissTaxPlugins(): void;
@@ -1,2 +1,7 @@
1
- import "../../pricing/product-swiss-tax.js";
2
- import "../../pricing/delivery-swiss-tax.js";
1
+ import { ProductSwissTaxPlugin } from "../../pricing/product-swiss-tax/index.js";
2
+ import { DeliverySwissTaxPlugin } from "../../pricing/delivery-swiss-tax/index.js";
3
+ import { pluginRegistry } from '@unchainedshop/core';
4
+ export function registerSwissTaxPlugins() {
5
+ pluginRegistry.register(ProductSwissTaxPlugin);
6
+ pluginRegistry.register(DeliverySwissTaxPlugin);
7
+ }
@@ -1,7 +1,3 @@
1
- import cryptopayModules from '../payment/cryptopay/index.ts';
2
- import '../warehousing/eth-minter.ts';
3
- import '../pricing/product-price-rateconversion.ts';
4
- import '../worker/update-ecb-rates.ts';
5
- import '../worker/update-coinbase-rates.ts';
6
- import '../worker/export-token.ts';
7
- export default cryptopayModules;
1
+ declare const _default: {};
2
+ export default _default;
3
+ export declare function registerCryptoPlugins(): void;
@@ -1,7 +1,18 @@
1
- import cryptopayModules from "../payment/cryptopay/index.js";
2
- import "../warehousing/eth-minter.js";
3
- import "../pricing/product-price-rateconversion.js";
4
- import "../worker/update-ecb-rates.js";
5
- import "../worker/update-coinbase-rates.js";
6
- import "../worker/export-token.js";
7
- export default cryptopayModules;
1
+ import { pluginRegistry } from '@unchainedshop/core';
2
+ import { CryptopayPlugin } from "../payment/cryptopay/index.js";
3
+ import { ETHMinterPlugin } from "../warehousing/eth-minter/index.js";
4
+ import { ProductPriceRateConversionPlugin } from "../pricing/product-price-rateconversion/index.js";
5
+ import { ExportTokenPlugin } from "../worker/export-token/index.js";
6
+ import { UpdateECBRatesPlugin } from "../worker/update-ecb-rates/index.js";
7
+ import { UpdateCoinbaseRatesPlugin } from "../worker/update-coinbase-rates/index.js";
8
+ import { UpdateTokenOwnershipPlugin } from "../worker/update-token-ownership/index.js";
9
+ export default {};
10
+ export function registerCryptoPlugins() {
11
+ pluginRegistry.register(CryptopayPlugin);
12
+ pluginRegistry.register(ETHMinterPlugin);
13
+ pluginRegistry.register(ProductPriceRateConversionPlugin);
14
+ pluginRegistry.register(ExportTokenPlugin);
15
+ pluginRegistry.register(UpdateECBRatesPlugin);
16
+ pluginRegistry.register(UpdateCoinbaseRatesPlugin);
17
+ pluginRegistry.register(UpdateTokenOwnershipPlugin);
18
+ }
@@ -1,2 +1,3 @@
1
1
  import { type IDeliveryPricingAdapter } from '@unchainedshop/core';
2
2
  export declare const DeliverySwissTax: IDeliveryPricingAdapter;
3
+ export default DeliverySwissTax;