@unchainedshop/plugins 3.1.15 → 4.0.0-rc.11
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.
- package/lib/delivery/pick-mup.js +0 -2
- package/lib/delivery/pick-mup.js.map +1 -1
- package/lib/files/gridfs/adapter.d.ts.map +1 -1
- package/lib/files/gridfs/adapter.js +2 -2
- package/lib/files/gridfs/adapter.js.map +1 -1
- package/lib/files/gridfs/handler-express.d.ts.map +1 -1
- package/lib/files/gridfs/handler-express.js +6 -1
- package/lib/files/gridfs/handler-express.js.map +1 -1
- package/lib/files/gridfs/handler-fastify.d.ts.map +1 -1
- package/lib/files/gridfs/handler-fastify.js +5 -1
- package/lib/files/gridfs/handler-fastify.js.map +1 -1
- package/lib/files/gridfs/module.d.ts +2 -2
- package/lib/files/gridfs/module.d.ts.map +1 -1
- package/lib/filters/local-search.d.ts.map +1 -1
- package/lib/filters/local-search.js +9 -2
- package/lib/filters/local-search.js.map +1 -1
- package/lib/filters/strict-equal.js +18 -0
- package/lib/filters/strict-equal.js.map +1 -1
- package/lib/payment/apple-iap/adapter.js +6 -13
- package/lib/payment/apple-iap/adapter.js.map +1 -1
- package/lib/payment/apple-iap/fix-periods.d.ts.map +1 -1
- package/lib/payment/apple-iap/fix-periods.js +3 -5
- package/lib/payment/apple-iap/fix-periods.js.map +1 -1
- package/lib/payment/apple-iap/handler-express.js +4 -4
- package/lib/payment/apple-iap/handler-express.js.map +1 -1
- package/lib/payment/apple-iap/handler-fastify.js +4 -4
- package/lib/payment/apple-iap/handler-fastify.js.map +1 -1
- package/lib/payment/apple-iap/module.d.ts +2 -2
- package/lib/payment/apple-iap/module.d.ts.map +1 -1
- package/lib/payment/braintree.js +3 -4
- package/lib/payment/braintree.js.map +1 -1
- package/lib/payment/cryptopay/db/CryptopayTransactions.d.ts +1 -2
- package/lib/payment/cryptopay/db/CryptopayTransactions.d.ts.map +1 -1
- package/lib/payment/cryptopay/db/CryptopayTransactions.js.map +1 -1
- package/lib/payment/cryptopay/handle-webhook.js +1 -1
- package/lib/payment/cryptopay/handle-webhook.js.map +1 -1
- package/lib/payment/cryptopay/handler-express.d.ts.map +1 -1
- package/lib/payment/cryptopay/handler-express.js +4 -57
- package/lib/payment/cryptopay/handler-express.js.map +1 -1
- package/lib/payment/cryptopay/handler-fastify.d.ts.map +1 -1
- package/lib/payment/cryptopay/handler-fastify.js +4 -56
- package/lib/payment/cryptopay/handler-fastify.js.map +1 -1
- package/lib/payment/cryptopay/module.d.ts +26 -26
- package/lib/payment/cryptopay/module.d.ts.map +1 -1
- package/lib/payment/cryptopay/module.js +26 -24
- package/lib/payment/cryptopay/module.js.map +1 -1
- package/lib/payment/cryptopay/plugin.d.ts.map +1 -1
- package/lib/payment/cryptopay/plugin.js +33 -79
- package/lib/payment/cryptopay/plugin.js.map +1 -1
- package/lib/payment/datatrans-v2/api/types.d.ts +41 -41
- package/lib/payment/datatrans-v2/api/types.d.ts.map +1 -1
- package/lib/payment/datatrans-v2/getPaths.d.ts +2 -2
- package/lib/payment/datatrans-v2/getPaths.d.ts.map +1 -1
- package/lib/payment/datatrans-v2/index.js +16 -14
- package/lib/payment/datatrans-v2/index.js.map +1 -1
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts +1 -1
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts.map +1 -1
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.js +3 -3
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.js.map +1 -1
- package/lib/payment/paypal-checkout.js +6 -8
- package/lib/payment/paypal-checkout.js.map +1 -1
- package/lib/payment/payrexx/api/index.d.ts +2 -2
- package/lib/payment/payrexx/api/index.d.ts.map +1 -1
- package/lib/payment/payrexx/api/makeFetcher.d.ts.map +1 -1
- package/lib/payment/payrexx/api/makeFetcher.js.map +1 -1
- package/lib/payment/payrexx/index.js +4 -4
- package/lib/payment/payrexx/index.js.map +1 -1
- package/lib/payment/payrexx/payrexx.js +2 -2
- package/lib/payment/payrexx/payrexx.js.map +1 -1
- package/lib/payment/postfinance-checkout/api-client.d.ts +16 -0
- package/lib/payment/postfinance-checkout/api-client.d.ts.map +1 -0
- package/lib/payment/postfinance-checkout/api-client.js +75 -0
- package/lib/payment/postfinance-checkout/api-client.js.map +1 -0
- package/lib/payment/postfinance-checkout/api-types.d.ts +98 -0
- package/lib/payment/postfinance-checkout/api-types.d.ts.map +1 -0
- package/lib/payment/postfinance-checkout/api-types.js +51 -0
- package/lib/payment/postfinance-checkout/api-types.js.map +1 -0
- package/lib/payment/postfinance-checkout/api.d.ts +5 -5
- package/lib/payment/postfinance-checkout/api.d.ts.map +1 -1
- package/lib/payment/postfinance-checkout/api.js +38 -62
- package/lib/payment/postfinance-checkout/api.js.map +1 -1
- package/lib/payment/postfinance-checkout/handler-express.d.ts.map +1 -1
- package/lib/payment/postfinance-checkout/handler-express.js +5 -5
- package/lib/payment/postfinance-checkout/handler-express.js.map +1 -1
- package/lib/payment/postfinance-checkout/handler-fastify.d.ts.map +1 -1
- package/lib/payment/postfinance-checkout/handler-fastify.js +6 -6
- package/lib/payment/postfinance-checkout/handler-fastify.js.map +1 -1
- package/lib/payment/postfinance-checkout/index.d.ts +2 -1
- package/lib/payment/postfinance-checkout/index.d.ts.map +1 -1
- package/lib/payment/postfinance-checkout/index.js +27 -30
- package/lib/payment/postfinance-checkout/index.js.map +1 -1
- package/lib/payment/postfinance-checkout/types.d.ts +4 -4
- package/lib/payment/postfinance-checkout/types.d.ts.map +1 -1
- package/lib/payment/postfinance-checkout/utils.d.ts +3 -3
- package/lib/payment/postfinance-checkout/utils.d.ts.map +1 -1
- package/lib/payment/postfinance-checkout/utils.js +5 -6
- package/lib/payment/postfinance-checkout/utils.js.map +1 -1
- package/lib/payment/saferpay/adapter.d.ts.map +1 -1
- package/lib/payment/saferpay/adapter.js +4 -6
- package/lib/payment/saferpay/adapter.js.map +1 -1
- package/lib/payment/saferpay/api/models/Transaction.d.ts +2 -2
- package/lib/payment/saferpay/api/models/Transaction.d.ts.map +1 -1
- package/lib/payment/saferpay/module.d.ts +2 -2
- package/lib/payment/saferpay/module.d.ts.map +1 -1
- package/lib/payment/stripe/index.js +5 -5
- package/lib/payment/stripe/index.js.map +1 -1
- package/lib/payment/stripe/stripe.js +3 -3
- package/lib/payment/stripe/stripe.js.map +1 -1
- package/lib/presets/all.d.ts +15 -13
- package/lib/presets/all.d.ts.map +1 -1
- package/lib/presets/all.js +3 -1
- package/lib/presets/all.js.map +1 -1
- package/lib/pricing/delivery-swiss-tax.d.ts.map +1 -1
- package/lib/pricing/delivery-swiss-tax.js +2 -2
- package/lib/pricing/delivery-swiss-tax.js.map +1 -1
- package/lib/pricing/order-delivery.js +1 -1
- package/lib/pricing/order-delivery.js.map +1 -1
- package/lib/pricing/order-discount.js +3 -3
- package/lib/pricing/order-discount.js.map +1 -1
- package/lib/pricing/order-items-discount.js +1 -1
- package/lib/pricing/order-items-discount.js.map +1 -1
- package/lib/pricing/order-items.js +1 -1
- package/lib/pricing/order-items.js.map +1 -1
- package/lib/pricing/order-payment.js +1 -1
- package/lib/pricing/order-payment.js.map +1 -1
- package/lib/pricing/order-round.d.ts +1 -1
- package/lib/pricing/order-round.d.ts.map +1 -1
- package/lib/pricing/order-round.js +8 -8
- package/lib/pricing/order-round.js.map +1 -1
- package/lib/pricing/product-catalog-price.d.ts +0 -1
- package/lib/pricing/product-catalog-price.d.ts.map +1 -1
- package/lib/pricing/product-catalog-price.js +6 -18
- package/lib/pricing/product-catalog-price.js.map +1 -1
- package/lib/pricing/product-price-rateconversion.js +2 -2
- package/lib/pricing/product-price-rateconversion.js.map +1 -1
- package/lib/pricing/product-round.d.ts +1 -1
- package/lib/pricing/product-round.d.ts.map +1 -1
- package/lib/pricing/product-round.js +2 -2
- package/lib/pricing/product-round.js.map +1 -1
- package/lib/pricing/product-swiss-tax.d.ts +1 -1
- package/lib/pricing/product-swiss-tax.d.ts.map +1 -1
- package/lib/pricing/product-swiss-tax.js +2 -2
- package/lib/pricing/product-swiss-tax.js.map +1 -1
- package/lib/warehousing/eth-minter.js +2 -2
- package/lib/warehousing/eth-minter.js.map +1 -1
- package/lib/worker/budgetsms.d.ts +10 -0
- package/lib/worker/budgetsms.d.ts.map +1 -0
- package/lib/worker/budgetsms.js +217 -0
- package/lib/worker/budgetsms.js.map +1 -0
- package/lib/worker/bulk-import.js +1 -1
- package/lib/worker/bulk-import.js.map +1 -1
- package/lib/worker/bulkgate.d.ts +2 -0
- package/lib/worker/bulkgate.d.ts.map +1 -0
- package/lib/worker/bulkgate.js +104 -0
- package/lib/worker/bulkgate.js.map +1 -0
- package/lib/worker/enrollment-order-generator.js +1 -1
- package/lib/worker/enrollment-order-generator.js.map +1 -1
- package/lib/worker/error-notifications.d.ts +4 -4
- package/lib/worker/error-notifications.d.ts.map +1 -1
- package/lib/worker/heartbeat.js +2 -8
- package/lib/worker/heartbeat.js.map +1 -1
- package/lib/worker/message.d.ts +1 -1
- package/lib/worker/message.d.ts.map +1 -1
- package/lib/worker/sms.js +16 -16
- package/lib/worker/sms.js.map +1 -1
- package/lib/worker/twilio.d.ts +2 -0
- package/lib/worker/twilio.d.ts.map +1 -0
- package/lib/worker/twilio.js +56 -0
- package/lib/worker/twilio.js.map +1 -0
- package/lib/worker/update-coinbase-rates.js +1 -1
- package/lib/worker/update-coinbase-rates.js.map +1 -1
- package/lib/worker/update-ecb-rates.js.map +1 -1
- package/package.json +32 -53
- package/src/delivery/pick-mup.ts +0 -2
- package/src/files/gridfs/adapter.ts +6 -2
- package/src/files/gridfs/handler-express.ts +9 -1
- package/src/files/gridfs/handler-fastify.ts +8 -1
- package/src/files/gridfs/module.ts +2 -2
- package/src/filters/local-search.ts +11 -2
- package/src/filters/strict-equal.ts +21 -0
- package/src/payment/apple-iap/adapter.ts +7 -14
- package/src/payment/apple-iap/fix-periods.ts +4 -7
- package/src/payment/apple-iap/handler-express.ts +4 -4
- package/src/payment/apple-iap/handler-fastify.ts +4 -4
- package/src/payment/apple-iap/module.ts +2 -2
- package/src/payment/braintree.ts +3 -4
- package/src/payment/cryptopay/db/CryptopayTransactions.ts +1 -2
- package/src/payment/cryptopay/denote-amount.test.ts +28 -0
- package/src/payment/cryptopay/denote-amount.ts +29 -0
- package/src/payment/cryptopay/derive-btc-address.test.ts +22 -0
- package/src/payment/cryptopay/derive-btc-address.ts +48 -0
- package/src/payment/cryptopay/derive-eth-address.test.ts +22 -0
- package/src/payment/cryptopay/derive-eth-address.ts +38 -0
- package/src/payment/cryptopay/handle-webhook.ts +103 -0
- package/src/payment/cryptopay/handler-express.ts +4 -70
- package/src/payment/cryptopay/handler-fastify.ts +6 -71
- package/src/payment/cryptopay/module.ts +44 -40
- package/src/payment/cryptopay/plugin.ts +50 -87
- package/src/payment/cryptopay/readme.md +23 -1
- package/src/payment/datatrans-v2/api/types.ts +41 -41
- package/src/payment/datatrans-v2/getPaths.ts +2 -2
- package/src/payment/datatrans-v2/index.ts +17 -15
- package/src/payment/datatrans-v2/roundedAmountFromOrder.ts +4 -4
- package/src/payment/paypal-checkout.ts +6 -11
- package/src/payment/payrexx/api/index.ts +2 -2
- package/src/payment/payrexx/api/makeFetcher.ts +1 -1
- package/src/payment/payrexx/index.ts +4 -4
- package/src/payment/payrexx/payrexx.ts +2 -2
- package/src/payment/postfinance-checkout/api-client.ts +106 -0
- package/src/payment/postfinance-checkout/api-types.ts +111 -0
- package/src/payment/postfinance-checkout/api.ts +58 -85
- package/src/payment/postfinance-checkout/handler-express.ts +5 -7
- package/src/payment/postfinance-checkout/handler-fastify.ts +6 -8
- package/src/payment/postfinance-checkout/index.ts +43 -35
- package/src/payment/postfinance-checkout/types.ts +6 -6
- package/src/payment/postfinance-checkout/utils.ts +7 -12
- package/src/payment/saferpay/adapter.ts +4 -6
- package/src/payment/saferpay/api/models/Transaction.ts +2 -2
- package/src/payment/saferpay/module.ts +2 -2
- package/src/payment/stripe/index.ts +5 -5
- package/src/payment/stripe/stripe.ts +3 -3
- package/src/presets/all.ts +3 -1
- package/src/pricing/delivery-swiss-tax.ts +6 -2
- package/src/pricing/order-delivery.ts +1 -1
- package/src/pricing/order-discount.ts +3 -3
- package/src/pricing/order-items-discount.ts +1 -1
- package/src/pricing/order-items.ts +1 -1
- package/src/pricing/order-payment.ts +1 -1
- package/src/pricing/order-round.ts +9 -9
- package/src/pricing/product-catalog-price.ts +6 -25
- package/src/pricing/product-price-rateconversion.ts +2 -2
- package/src/pricing/product-round.ts +3 -3
- package/src/pricing/product-swiss-tax.test.ts +6 -6
- package/src/pricing/product-swiss-tax.ts +2 -2
- package/src/warehousing/eth-minter.ts +2 -2
- package/src/worker/budgetsms.ts +268 -0
- package/src/worker/bulk-import.ts +1 -1
- package/src/worker/bulkgate.ts +138 -0
- package/src/worker/enrollment-order-generator.ts +3 -3
- package/src/worker/error-notifications.ts +4 -4
- package/src/worker/heartbeat.ts +4 -11
- package/src/worker/message.ts +1 -1
- package/src/worker/push-notification.ts +2 -2
- package/src/worker/twilio.ts +71 -0
- package/src/worker/update-coinbase-rates.ts +3 -6
- package/src/worker/update-ecb-rates.ts +3 -3
- package/lib/accounts/google-oauth.d.ts +0 -4
- package/lib/accounts/google-oauth.d.ts.map +0 -1
- package/lib/accounts/google-oauth.js +0 -145
- package/lib/accounts/google-oauth.js.map +0 -1
- package/lib/accounts/linkedin-oauth.d.ts +0 -4
- package/lib/accounts/linkedin-oauth.d.ts.map +0 -1
- package/lib/accounts/linkedin-oauth.js +0 -82
- package/lib/accounts/linkedin-oauth.js.map +0 -1
- package/lib/files/gridfs/gridfs-adapter.d.ts +0 -3
- package/lib/files/gridfs/gridfs-adapter.d.ts.map +0 -1
- package/lib/files/gridfs/gridfs-adapter.js +0 -97
- package/lib/files/gridfs/gridfs-adapter.js.map +0 -1
- package/lib/files/gridfs/gridfs-webhook.d.ts +0 -11
- package/lib/files/gridfs/gridfs-webhook.d.ts.map +0 -1
- package/lib/files/gridfs/gridfs-webhook.js +0 -84
- package/lib/files/gridfs/gridfs-webhook.js.map +0 -1
- package/lib/files/minio/minio-adapter.d.ts +0 -6
- package/lib/files/minio/minio-adapter.d.ts.map +0 -1
- package/lib/files/minio/minio-adapter.js +0 -181
- package/lib/files/minio/minio-adapter.js.map +0 -1
- package/lib/files/minio/minio-webhook.d.ts +0 -2
- package/lib/files/minio/minio-webhook.d.ts.map +0 -1
- package/lib/files/minio/minio-webhook.js +0 -33
- package/lib/files/minio/minio-webhook.js.map +0 -1
- package/lib/payment/apple-iap/module/configureAppleTransactionsModule.d.ts +0 -9
- package/lib/payment/apple-iap/module/configureAppleTransactionsModule.d.ts.map +0 -1
- package/lib/payment/apple-iap/module/configureAppleTransactionsModule.js +0 -17
- package/lib/payment/apple-iap/module/configureAppleTransactionsModule.js.map +0 -1
- package/lib/payment/cryptopay/middleware.d.ts +0 -2
- package/lib/payment/cryptopay/middleware.d.ts.map +0 -1
- package/lib/payment/cryptopay/middleware.js +0 -75
- package/lib/payment/cryptopay/middleware.js.map +0 -1
- package/lib/payment/cryptopay/module/configureCryptopayModule.d.ts +0 -25
- package/lib/payment/cryptopay/module/configureCryptopayModule.d.ts.map +0 -1
- package/lib/payment/cryptopay/module/configureCryptopayModule.js +0 -75
- package/lib/payment/cryptopay/module/configureCryptopayModule.js.map +0 -1
- package/lib/payment/datatrans-v2/middleware.d.ts +0 -2
- package/lib/payment/datatrans-v2/middleware.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/middleware.js +0 -68
- package/lib/payment/datatrans-v2/middleware.js.map +0 -1
- package/lib/payment/payrexx/middleware.d.ts +0 -2
- package/lib/payment/payrexx/middleware.d.ts.map +0 -1
- package/lib/payment/payrexx/middleware.js +0 -86
- package/lib/payment/payrexx/middleware.js.map +0 -1
- package/lib/payment/postfinance-checkout/middleware.d.ts +0 -2
- package/lib/payment/postfinance-checkout/middleware.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/middleware.js +0 -38
- package/lib/payment/postfinance-checkout/middleware.js.map +0 -1
- package/lib/payment/saferpay/middleware.d.ts +0 -2
- package/lib/payment/saferpay/middleware.d.ts.map +0 -1
- package/lib/payment/saferpay/middleware.js +0 -57
- package/lib/payment/saferpay/middleware.js.map +0 -1
- package/lib/payment/saferpay/module/configureSaferpayTransactionsModule.d.ts +0 -10
- package/lib/payment/saferpay/module/configureSaferpayTransactionsModule.d.ts.map +0 -1
- package/lib/payment/saferpay/module/configureSaferpayTransactionsModule.js +0 -24
- package/lib/payment/saferpay/module/configureSaferpayTransactionsModule.js.map +0 -1
- package/lib/payment/stripe/middleware.d.ts +0 -6
- package/lib/payment/stripe/middleware.d.ts.map +0 -1
- package/lib/payment/stripe/middleware.js +0 -114
- package/lib/payment/stripe/middleware.js.map +0 -1
- package/lib/plugins-index.d.ts +0 -48
- package/lib/plugins-index.d.ts.map +0 -1
- package/lib/plugins-index.js +0 -107
- package/lib/plugins-index.js.map +0 -1
- package/lib/worker/BaseWorker.d.ts +0 -30
- package/lib/worker/BaseWorker.d.ts.map +0 -1
- package/lib/worker/BaseWorker.js +0 -79
- package/lib/worker/BaseWorker.js.map +0 -1
- package/lib/worker/EventListenerWorker.d.ts +0 -6
- package/lib/worker/EventListenerWorker.d.ts.map +0 -1
- package/lib/worker/EventListenerWorker.js +0 -46
- package/lib/worker/EventListenerWorker.js.map +0 -1
- package/lib/worker/FailedRescheduler.d.ts +0 -15
- package/lib/worker/FailedRescheduler.d.ts.map +0 -1
- package/lib/worker/FailedRescheduler.js +0 -45
- package/lib/worker/FailedRescheduler.js.map +0 -1
- package/lib/worker/IntervalWorker.d.ts +0 -10
- package/lib/worker/IntervalWorker.d.ts.map +0 -1
- package/lib/worker/IntervalWorker.js +0 -37
- package/lib/worker/IntervalWorker.js.map +0 -1
- package/src/worker/BaseWorker.ts +0 -116
- package/src/worker/EventListenerWorker.ts +0 -61
- package/src/worker/FailedRescheduler.ts +0 -80
- package/src/worker/IntervalWorker.ts +0 -54
- package/src/worker/sms.ts +0 -87
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-coinbase-rates.js","sourceRoot":"","sources":["../../src/worker/update-coinbase-rates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,KAAK,MAAM,eAAe,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,gBAAgB,GAAG,KAAK,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"update-coinbase-rates.js","sourceRoot":"","sources":["../../src/worker/update-coinbase-rates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,KAAK,MAAM,eAAe,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,gBAAgB,GAAG,KAAK,EAAE,IAAI,EAAgE,EAAE;IACpG,OAAO,KAAK,CAAC,uDAAuD,IAAI,EAAE,EAAE;QAC1E,MAAM,EAAE,KAAK;KACd,CAAC;SACC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;SACzB,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAElD,MAAM,mBAAmB,GAA6B;IACpD,GAAG,aAAa;IAEhB,GAAG,EAAE,6CAA6C;IAClD,KAAK,EAAE,uBAAuB;IAC9B,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,uBAAuB;IAE7B,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE;QACpC,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,eAAe,E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ACd,KAAK,EAAE;oBACL,IAAI,EAAE,8BAA8B;oBACpC,OAAO,EAAE,gCAAgC;iBAC1C;aACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC;AAEF,cAAc,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;AAEpD,cAAc,CAAC,uBAAuB,CAAC;IACrC,IAAI,EAAE,mBAAmB,CAAC,IAAI;IAC9B,QAAQ,EAAE,WAAW;CACtB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-ecb-rates.js","sourceRoot":"","sources":["../../src/worker/update-ecb-rates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGlC,MAAM,gBAAgB,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"update-ecb-rates.js","sourceRoot":"","sources":["../../src/worker/update-ecb-rates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGlC,MAAM,gBAAgB,GAAG,KAAK,IAAmD,EAAE;IACjF,OAAO,KAAK,CAAC,+DAA+D,EAAE;QAC5E,MAAM,EAAE,KAAK;KACd,CAAC;SACC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;SACzB,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;SAC1C,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACb,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EA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-rc.11",
|
|
4
4
|
"main": "lib/plugins-index.js",
|
|
5
5
|
"types": "lib/plugins-index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -34,46 +34,44 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"@unchainedshop/
|
|
39
|
-
"@unchainedshop/core-
|
|
40
|
-
"@unchainedshop/core-
|
|
41
|
-
"@unchainedshop/core-
|
|
42
|
-
"@unchainedshop/core-
|
|
43
|
-
"@unchainedshop/core-
|
|
44
|
-
"@unchainedshop/core-
|
|
45
|
-
"@unchainedshop/
|
|
46
|
-
"@unchainedshop/
|
|
47
|
-
"@unchainedshop/
|
|
48
|
-
"@unchainedshop/
|
|
49
|
-
"@unchainedshop/utils": "^3.1.13",
|
|
37
|
+
"@unchainedshop/api": "^4.0.0-rc.4",
|
|
38
|
+
"@unchainedshop/core-delivery": "^4.0.0-rc.4",
|
|
39
|
+
"@unchainedshop/core-enrollments": "^4.0.0-rc.4",
|
|
40
|
+
"@unchainedshop/core-orders": "^4.0.0-rc.4",
|
|
41
|
+
"@unchainedshop/core-payment": "^4.0.0-rc.4",
|
|
42
|
+
"@unchainedshop/core-products": "^4.0.0-rc.4",
|
|
43
|
+
"@unchainedshop/core-warehousing": "^4.0.0-rc.4",
|
|
44
|
+
"@unchainedshop/core-worker": "^4.0.0-rc.4",
|
|
45
|
+
"@unchainedshop/events": "^4.0.0-rc.4",
|
|
46
|
+
"@unchainedshop/file-upload": "^4.0.0-rc.4",
|
|
47
|
+
"@unchainedshop/logger": "^4.0.0-rc.4",
|
|
48
|
+
"@unchainedshop/utils": "^4.0.0-rc.4",
|
|
50
49
|
"event-iterator": "^2.0.0",
|
|
51
50
|
"JSONStream": "^1.3.5"
|
|
52
51
|
},
|
|
53
52
|
"peerDependencies": {
|
|
54
53
|
"@aws-sdk/client-eventbridge": ">= 3.714 < 4",
|
|
54
|
+
"@breejs/later": "^4.2.0",
|
|
55
55
|
"@paypal/checkout-server-sdk": "1.x",
|
|
56
|
-
"@redis/client": ">= 1
|
|
57
|
-
"bip32": "
|
|
58
|
-
"
|
|
59
|
-
"bs58check": "^4.0.0",
|
|
60
|
-
"ethers": ">= 6.13 < 7",
|
|
56
|
+
"@redis/client": ">= 1 < 6",
|
|
57
|
+
"@scure/bip32": ">= 1.7 < 2",
|
|
58
|
+
"@scure/btc-signer": ">= 1.8 < 2",
|
|
61
59
|
"expiry-map": "2.x",
|
|
62
60
|
"express": ">= 5 < 6",
|
|
63
61
|
"fastify": ">= 5.2 < 6",
|
|
64
|
-
"mime-types": ">=
|
|
62
|
+
"mime-types": ">= 2 < 4",
|
|
65
63
|
"minio": "8.x",
|
|
66
64
|
"nodemailer": ">= 6.9 < 8",
|
|
67
65
|
"open": "10.x",
|
|
68
66
|
"p-memoize": "7.x",
|
|
69
|
-
"
|
|
70
|
-
"stripe": ">= 18 < 19",
|
|
71
|
-
"tiny-secp256k1": "2.x",
|
|
72
|
-
"twilio": "5.x",
|
|
67
|
+
"stripe": ">= 17 < 19",
|
|
73
68
|
"web-push": ">= 3.6 <4",
|
|
74
69
|
"xml-js": ">= 1.6 < 2"
|
|
75
70
|
},
|
|
76
71
|
"peerDependenciesMeta": {
|
|
72
|
+
"@breejs/later": {
|
|
73
|
+
"optional": true
|
|
74
|
+
},
|
|
77
75
|
"@aws-sdk/client-eventbridge": {
|
|
78
76
|
"optional": true
|
|
79
77
|
},
|
|
@@ -83,16 +81,10 @@
|
|
|
83
81
|
"@redis/client": {
|
|
84
82
|
"optional": true
|
|
85
83
|
},
|
|
86
|
-
"bip32": {
|
|
87
|
-
"optional": true
|
|
88
|
-
},
|
|
89
|
-
"bitcoinjs-lib": {
|
|
90
|
-
"optional": true
|
|
91
|
-
},
|
|
92
|
-
"bs58check": {
|
|
84
|
+
"@scure/bip32": {
|
|
93
85
|
"optional": true
|
|
94
86
|
},
|
|
95
|
-
"
|
|
87
|
+
"@scure/btc-signer": {
|
|
96
88
|
"optional": true
|
|
97
89
|
},
|
|
98
90
|
"expiry-map": {
|
|
@@ -119,18 +111,9 @@
|
|
|
119
111
|
"p-memoize": {
|
|
120
112
|
"optional": true
|
|
121
113
|
},
|
|
122
|
-
"postfinancecheckout": {
|
|
123
|
-
"optional": true
|
|
124
|
-
},
|
|
125
114
|
"stripe": {
|
|
126
115
|
"optional": true
|
|
127
116
|
},
|
|
128
|
-
"tiny-secp256k1": {
|
|
129
|
-
"optional": true
|
|
130
|
-
},
|
|
131
|
-
"twilio": {
|
|
132
|
-
"optional": true
|
|
133
|
-
},
|
|
134
117
|
"web-push": {
|
|
135
118
|
"optional": true
|
|
136
119
|
},
|
|
@@ -141,26 +124,22 @@
|
|
|
141
124
|
"devDependencies": {
|
|
142
125
|
"@breejs/later": "^4.2.0",
|
|
143
126
|
"@paypal/checkout-server-sdk": "^1.0.3",
|
|
144
|
-
"@redis/client": "^5.
|
|
127
|
+
"@redis/client": "^5.6.0",
|
|
128
|
+
"@scure/bip32": "^1.7.0",
|
|
129
|
+
"@scure/btc-signer": "^1.8.1",
|
|
130
|
+
"@types/breejs__later": "^4.1.5",
|
|
145
131
|
"@types/express": "^5.0.3",
|
|
146
|
-
"@types/node": "^24.0.
|
|
147
|
-
"bip32": "^5.0.0-rc.0",
|
|
148
|
-
"bitcoinjs-lib": "^6.1.7",
|
|
149
|
-
"bs58check": "^4.0.0",
|
|
150
|
-
"ethers": "^6.14.4",
|
|
132
|
+
"@types/node": "^24.0.13",
|
|
151
133
|
"expiry-map": "^2.0.0",
|
|
152
134
|
"express": "^5.1.0",
|
|
153
135
|
"fastify": "^5.4.0",
|
|
154
|
-
"mime-types": "^3.0.
|
|
136
|
+
"mime-types": "^3.0.1",
|
|
155
137
|
"minio": "^8.0.5",
|
|
156
|
-
"nodemailer": "^7.0.
|
|
138
|
+
"nodemailer": "^7.0.5",
|
|
157
139
|
"open": "^10.1.2",
|
|
158
140
|
"p-memoize": "^7.1.1",
|
|
159
|
-
"
|
|
160
|
-
"stripe": "^18.2.1",
|
|
161
|
-
"tiny-secp256k1": "^2.2.4",
|
|
141
|
+
"stripe": "^18.3.0",
|
|
162
142
|
"tsx": "^4.20.3",
|
|
163
|
-
"twilio": "^5.7.1",
|
|
164
143
|
"typescript": "^5.8.3",
|
|
165
144
|
"web-push": "^3.6.7",
|
|
166
145
|
"xml-js": "^1.6.11"
|
package/src/delivery/pick-mup.ts
CHANGED
|
@@ -22,7 +22,6 @@ const fetchPickMupLocations = async (key: string, idsFilter?: string) => {
|
|
|
22
22
|
const { stores = [] } = result || {};
|
|
23
23
|
return stores.flatMap(({ markets = [], location = {}, id }) => {
|
|
24
24
|
return markets.map(({ full_name: fullName }) => {
|
|
25
|
-
// eslint-disable-line
|
|
26
25
|
const {
|
|
27
26
|
geo: { lat, lon },
|
|
28
27
|
zip,
|
|
@@ -90,7 +89,6 @@ const PickMup: IDeliveryAdapter = {
|
|
|
90
89
|
},
|
|
91
90
|
|
|
92
91
|
configurationError: () => {
|
|
93
|
-
// eslint-disable-line
|
|
94
92
|
if (!getKey()) {
|
|
95
93
|
return DeliveryError.INCOMPLETE_CONFIGURATION;
|
|
96
94
|
}
|
|
@@ -36,7 +36,7 @@ export const GridFSAdapter: IFileAdapter<
|
|
|
36
36
|
...FileAdapter,
|
|
37
37
|
async createDownloadURL(file, expiry) {
|
|
38
38
|
// If public, just return the stored path from the db
|
|
39
|
-
if (!file
|
|
39
|
+
if (!file?.meta?.isPrivate) return file?.url;
|
|
40
40
|
|
|
41
41
|
const expiryTimestamp =
|
|
42
42
|
expiry ||
|
|
@@ -94,7 +94,11 @@ export const GridFSAdapter: IFileAdapter<
|
|
|
94
94
|
...options,
|
|
95
95
|
},
|
|
96
96
|
);
|
|
97
|
-
await pipeline(
|
|
97
|
+
await pipeline(
|
|
98
|
+
stream,
|
|
99
|
+
new PassThrough({ allowHalfOpen: true, highWaterMark: 1024 * 1024 }),
|
|
100
|
+
writeStream,
|
|
101
|
+
);
|
|
98
102
|
const { length } = writeStream;
|
|
99
103
|
const url = `/gridfs/${directoryName}/${encodeURIComponent(hashedFilename)}`;
|
|
100
104
|
|
|
@@ -65,7 +65,11 @@ const gridfsHandler = async (
|
|
|
65
65
|
metadata: { 'content-type': type },
|
|
66
66
|
},
|
|
67
67
|
);
|
|
68
|
-
await pipeline(
|
|
68
|
+
await pipeline(
|
|
69
|
+
req,
|
|
70
|
+
new PassThrough({ allowHalfOpen: true, highWaterMark: 1024 * 1024 }),
|
|
71
|
+
writeStream,
|
|
72
|
+
);
|
|
69
73
|
|
|
70
74
|
const { length } = writeStream;
|
|
71
75
|
await services.files.linkFile({ fileId, size: length, type });
|
|
@@ -100,6 +104,10 @@ const gridfsHandler = async (
|
|
|
100
104
|
res.end('Access restricted: Invalid signature.');
|
|
101
105
|
return;
|
|
102
106
|
}
|
|
107
|
+
} else if (!fileDocument) {
|
|
108
|
+
res.statusCode = 404;
|
|
109
|
+
res.end();
|
|
110
|
+
return;
|
|
103
111
|
}
|
|
104
112
|
if (file?.metadata?.['content-type']) {
|
|
105
113
|
res.setHeader('Content-Type', file.metadata['content-type']);
|
|
@@ -59,7 +59,11 @@ const gridfsHandler: RouteHandlerMethod = async (
|
|
|
59
59
|
},
|
|
60
60
|
);
|
|
61
61
|
|
|
62
|
-
await pipeline(
|
|
62
|
+
await pipeline(
|
|
63
|
+
req.raw,
|
|
64
|
+
new PassThrough({ allowHalfOpen: true, highWaterMark: 1024 * 1024 }),
|
|
65
|
+
writeStream,
|
|
66
|
+
);
|
|
63
67
|
|
|
64
68
|
const { length } = writeStream;
|
|
65
69
|
await services.files.linkFile({ fileId, size: length, type });
|
|
@@ -91,6 +95,9 @@ const gridfsHandler: RouteHandlerMethod = async (
|
|
|
91
95
|
reply.status(403);
|
|
92
96
|
return reply.send('Access restricted: Invalid signature.');
|
|
93
97
|
}
|
|
98
|
+
} else if (!fileDocument) {
|
|
99
|
+
reply.status(404);
|
|
100
|
+
return reply.send();
|
|
94
101
|
}
|
|
95
102
|
|
|
96
103
|
if (file?.metadata?.['content-type']) {
|
|
@@ -2,6 +2,10 @@ import { mongodb } from '@unchainedshop/mongodb';
|
|
|
2
2
|
import { ProductText } from '@unchainedshop/core-products';
|
|
3
3
|
import { AssortmentText } from '@unchainedshop/core-assortments';
|
|
4
4
|
import { FilterDirector, FilterAdapter, IFilterAdapter } from '@unchainedshop/core';
|
|
5
|
+
import { createLogger } from '@unchainedshop/logger';
|
|
6
|
+
import { isDocumentDBCompatModeEnabled } from '@unchainedshop/mongodb';
|
|
7
|
+
|
|
8
|
+
const logger = createLogger('unchained:core-filters:local-search');
|
|
5
9
|
|
|
6
10
|
const LocalSearch: IFilterAdapter = {
|
|
7
11
|
...FilterAdapter,
|
|
@@ -38,7 +42,6 @@ const LocalSearch: IFilterAdapter = {
|
|
|
38
42
|
return products.map(({ productId }) => productId);
|
|
39
43
|
},
|
|
40
44
|
|
|
41
|
-
// eslint-disable-next-line
|
|
42
45
|
searchAssortments: async ({ assortmentIds }) => {
|
|
43
46
|
const { queryString } = params.searchQuery;
|
|
44
47
|
|
|
@@ -89,4 +92,10 @@ const LocalSearch: IFilterAdapter = {
|
|
|
89
92
|
|
|
90
93
|
export default LocalSearch;
|
|
91
94
|
|
|
92
|
-
|
|
95
|
+
if (!isDocumentDBCompatModeEnabled()) {
|
|
96
|
+
FilterDirector.registerAdapter(LocalSearch);
|
|
97
|
+
} else {
|
|
98
|
+
logger.warn(
|
|
99
|
+
'Free text search queries have been disabled due to DocumentDB compatibility mode (env UNCHAINED_DOCUMENTDB_COMPAT_MODE is trueish)',
|
|
100
|
+
);
|
|
101
|
+
}
|
|
@@ -12,6 +12,27 @@ const StrictQualFilter: IFilterAdapter = {
|
|
|
12
12
|
return {
|
|
13
13
|
...FilterAdapter.actions(params),
|
|
14
14
|
|
|
15
|
+
searchProducts: async ({ productIds }) => {
|
|
16
|
+
// Search Products
|
|
17
|
+
const { queryString } = params.searchQuery;
|
|
18
|
+
|
|
19
|
+
if (!queryString && !productIds) {
|
|
20
|
+
// If no query string is provided, return all product IDs
|
|
21
|
+
return params.modules.products.findProductIds({});
|
|
22
|
+
}
|
|
23
|
+
return productIds;
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
searchAssortments: async ({ assortmentIds }) => {
|
|
27
|
+
// Search Assortments
|
|
28
|
+
const { queryString } = params.searchQuery;
|
|
29
|
+
if (!queryString && !assortmentIds) {
|
|
30
|
+
// If no query string is provided, return all assortment IDs
|
|
31
|
+
return params.modules.assortments.findAssortmentIds({});
|
|
32
|
+
}
|
|
33
|
+
return assortmentIds;
|
|
34
|
+
},
|
|
35
|
+
|
|
15
36
|
transformProductSelector: async (lastSelector, options) => {
|
|
16
37
|
const { key, value } = options || {};
|
|
17
38
|
|
|
@@ -3,7 +3,7 @@ import { createLogger } from '@unchainedshop/logger';
|
|
|
3
3
|
import { AppleTransactionsModule } from './module.js';
|
|
4
4
|
import { verifyReceipt } from './verify-receipt.js';
|
|
5
5
|
|
|
6
|
-
const logger = createLogger('unchained:core-payment:iap');
|
|
6
|
+
const logger = createLogger('unchained:core-payment:apple-iap');
|
|
7
7
|
|
|
8
8
|
const { APPLE_IAP_SHARED_SECRET } = process.env;
|
|
9
9
|
|
|
@@ -26,7 +26,6 @@ const AppleIAP: IPaymentAdapter = {
|
|
|
26
26
|
...PaymentAdapter.actions(params, context),
|
|
27
27
|
|
|
28
28
|
configurationError() {
|
|
29
|
-
// eslint-disable-line
|
|
30
29
|
if (!APPLE_IAP_SHARED_SECRET) {
|
|
31
30
|
return PaymentError.INCOMPLETE_CONFIGURATION;
|
|
32
31
|
}
|
|
@@ -38,23 +37,19 @@ const AppleIAP: IPaymentAdapter = {
|
|
|
38
37
|
return false;
|
|
39
38
|
},
|
|
40
39
|
|
|
41
|
-
// eslint-disable-next-line
|
|
42
40
|
isPayLaterAllowed() {
|
|
43
41
|
return false;
|
|
44
42
|
},
|
|
45
43
|
|
|
46
|
-
// eslint-disable-next-line
|
|
47
44
|
async sign() {
|
|
48
45
|
throw new Error('Apple IAP does not support payment signing');
|
|
49
46
|
},
|
|
50
47
|
|
|
51
|
-
// eslint-disable-next-line
|
|
52
48
|
async validate() {
|
|
53
49
|
// once registered receipt transactions are valid by default!
|
|
54
50
|
return true;
|
|
55
51
|
},
|
|
56
52
|
|
|
57
|
-
// eslint-disable-next-line
|
|
58
53
|
async register(transactionContext) {
|
|
59
54
|
const { receiptData } = transactionContext;
|
|
60
55
|
|
|
@@ -62,13 +57,13 @@ const AppleIAP: IPaymentAdapter = {
|
|
|
62
57
|
receiptData,
|
|
63
58
|
password: APPLE_IAP_SHARED_SECRET,
|
|
64
59
|
});
|
|
65
|
-
const { status, latest_receipt_info: latestReceiptInfo } = response;
|
|
60
|
+
const { status, latest_receipt_info: latestReceiptInfo } = response;
|
|
66
61
|
|
|
67
62
|
if (status === 0) {
|
|
68
63
|
logger.debug('Apple IAP Plugin: Receipt validated and updated for the user');
|
|
69
|
-
const latestTransaction = latestReceiptInfo[latestReceiptInfo.length - 1];
|
|
64
|
+
const latestTransaction = latestReceiptInfo[latestReceiptInfo.length - 1];
|
|
70
65
|
return {
|
|
71
|
-
token: latestTransaction.web_order_line_item_id,
|
|
66
|
+
token: latestTransaction.web_order_line_item_id,
|
|
72
67
|
latestReceiptInfo,
|
|
73
68
|
};
|
|
74
69
|
}
|
|
@@ -79,7 +74,6 @@ const AppleIAP: IPaymentAdapter = {
|
|
|
79
74
|
return null;
|
|
80
75
|
},
|
|
81
76
|
|
|
82
|
-
// eslint-disable-next-line
|
|
83
77
|
async charge(transactionContext) {
|
|
84
78
|
const { meta, paymentCredentials, receiptData } = transactionContext || {};
|
|
85
79
|
const { transactionIdentifier } = meta || {};
|
|
@@ -100,10 +94,9 @@ const AppleIAP: IPaymentAdapter = {
|
|
|
100
94
|
}
|
|
101
95
|
|
|
102
96
|
const transactions =
|
|
103
|
-
receiptResponse?.latest_receipt_info ||
|
|
104
|
-
paymentCredentials?.meta?.latestReceiptInfo;
|
|
97
|
+
receiptResponse?.latest_receipt_info || paymentCredentials?.meta?.latestReceiptInfo;
|
|
105
98
|
const matchedTransaction = transactions?.find(
|
|
106
|
-
(transaction) => transaction?.transaction_id === transactionIdentifier,
|
|
99
|
+
(transaction) => transaction?.transaction_id === transactionIdentifier,
|
|
107
100
|
);
|
|
108
101
|
if (!matchedTransaction) {
|
|
109
102
|
throw new Error(
|
|
@@ -131,7 +124,7 @@ const AppleIAP: IPaymentAdapter = {
|
|
|
131
124
|
|
|
132
125
|
const isMatchesTransaction =
|
|
133
126
|
parseInt(matchedTransaction.quantity, 10) === quantity &&
|
|
134
|
-
matchedTransaction.product_id === productId;
|
|
127
|
+
matchedTransaction.product_id === productId;
|
|
135
128
|
|
|
136
129
|
if (!isMatchesTransaction)
|
|
137
130
|
throw new Error('Apple IAP Plugin: Product in order does not match transaction');
|
|
@@ -4,17 +4,14 @@ export const fixPeriods = async (
|
|
|
4
4
|
{ transactionId, enrollmentId, orderId, transactions },
|
|
5
5
|
unchainedAPI: UnchainedCore,
|
|
6
6
|
) => {
|
|
7
|
-
const relevantTransactions = transactions.filter(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return original_transaction_id === transactionId; // eslint-disable-line
|
|
11
|
-
},
|
|
12
|
-
);
|
|
7
|
+
const relevantTransactions = transactions.filter(({ original_transaction_id }) => {
|
|
8
|
+
return original_transaction_id === transactionId;
|
|
9
|
+
});
|
|
13
10
|
|
|
14
11
|
const adjustedEnrollmentPeriods = relevantTransactions
|
|
15
12
|
.map((transaction) => {
|
|
16
13
|
return {
|
|
17
|
-
isTrial: transaction.is_trial_period === 'true',
|
|
14
|
+
isTrial: transaction.is_trial_period === 'true',
|
|
18
15
|
start: new Date(parseInt(transaction.purchase_date_ms, 10)),
|
|
19
16
|
end: new Date(parseInt(transaction.expires_date_ms, 10)),
|
|
20
17
|
orderId: transaction.transaction_id === transactionId ? orderId : null,
|
|
@@ -3,7 +3,7 @@ import { EnrollmentStatus } from '@unchainedshop/core-enrollments';
|
|
|
3
3
|
import { createLogger } from '@unchainedshop/logger';
|
|
4
4
|
import { fixPeriods } from './fix-periods.js';
|
|
5
5
|
|
|
6
|
-
const logger = createLogger('unchained:core-payment:iap');
|
|
6
|
+
const logger = createLogger('unchained:core-payment:apple-iap:handler');
|
|
7
7
|
|
|
8
8
|
const { APPLE_IAP_SHARED_SECRET } = process.env;
|
|
9
9
|
|
|
@@ -25,7 +25,7 @@ export const appleIAPHandler = async (req, res) => {
|
|
|
25
25
|
throw new Error('shared secret not valid');
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
const transactions = responseBody?.unified_receipt?.latest_receipt_info;
|
|
28
|
+
const transactions = responseBody?.unified_receipt?.latest_receipt_info;
|
|
29
29
|
const latestTransaction = transactions[0];
|
|
30
30
|
|
|
31
31
|
if (responseBody.notification_type === AppleNotificationTypes.INITIAL_BUY) {
|
|
@@ -40,7 +40,7 @@ export const appleIAPHandler = async (req, res) => {
|
|
|
40
40
|
|
|
41
41
|
const order = await services.orders.checkoutOrder(orderPayment.orderId, {
|
|
42
42
|
paymentContext: {
|
|
43
|
-
|
|
43
|
+
receiptData: responseBody?.unified_receipt?.latest_receipt,
|
|
44
44
|
},
|
|
45
45
|
});
|
|
46
46
|
const orderId = order._id;
|
|
@@ -78,7 +78,7 @@ export const appleIAPHandler = async (req, res) => {
|
|
|
78
78
|
|
|
79
79
|
await services.orders.registerPaymentCredentials(enrollment.payment.paymentProviderId, {
|
|
80
80
|
transactionContext: {
|
|
81
|
-
|
|
81
|
+
receiptData: responseBody?.unified_receipt?.latest_receipt,
|
|
82
82
|
},
|
|
83
83
|
userId: enrollment.userId,
|
|
84
84
|
});
|
|
@@ -5,7 +5,7 @@ import { fixPeriods } from './fix-periods.js';
|
|
|
5
5
|
import { FastifyRequest, RouteHandlerMethod } from 'fastify';
|
|
6
6
|
import { AppleTransactionsModule } from './module.js';
|
|
7
7
|
|
|
8
|
-
const logger = createLogger('unchained:core-payment:iap');
|
|
8
|
+
const logger = createLogger('unchained:core-payment:apple-iap:handler');
|
|
9
9
|
|
|
10
10
|
const { APPLE_IAP_SHARED_SECRET } = process.env;
|
|
11
11
|
|
|
@@ -33,7 +33,7 @@ export const appleIAPHandler: RouteHandlerMethod = async (
|
|
|
33
33
|
throw new Error('shared secret not valid');
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
const transactions = responseBody?.unified_receipt?.latest_receipt_info;
|
|
37
37
|
const latestTransaction = transactions[0];
|
|
38
38
|
|
|
39
39
|
if (responseBody.notification_type === AppleNotificationTypes.INITIAL_BUY) {
|
|
@@ -48,7 +48,7 @@ export const appleIAPHandler: RouteHandlerMethod = async (
|
|
|
48
48
|
|
|
49
49
|
const order = await services.orders.checkoutOrder(orderPayment.orderId, {
|
|
50
50
|
paymentContext: {
|
|
51
|
-
|
|
51
|
+
receiptData: responseBody?.unified_receipt?.latest_receipt,
|
|
52
52
|
},
|
|
53
53
|
});
|
|
54
54
|
const orderId = order._id;
|
|
@@ -86,7 +86,7 @@ export const appleIAPHandler: RouteHandlerMethod = async (
|
|
|
86
86
|
|
|
87
87
|
await services.orders.registerPaymentCredentials(enrollment.payment.paymentProviderId, {
|
|
88
88
|
transactionContext: {
|
|
89
|
-
|
|
89
|
+
receiptData: responseBody?.unified_receipt?.latest_receipt,
|
|
90
90
|
},
|
|
91
91
|
userId: enrollment.userId,
|
|
92
92
|
});
|
package/src/payment/braintree.ts
CHANGED
|
@@ -52,7 +52,6 @@ const BraintreeDirect: IPaymentAdapter = {
|
|
|
52
52
|
return BRAINTREE_SANDBOX_TOKEN;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
// eslint-disable-next-line
|
|
56
55
|
const getPrivateKey = () => {
|
|
57
56
|
return BRAINTREE_PRIVATE_KEY;
|
|
58
57
|
};
|
|
@@ -114,17 +113,17 @@ const BraintreeDirect: IPaymentAdapter = {
|
|
|
114
113
|
|
|
115
114
|
// eslint-disable-next-line
|
|
116
115
|
// @ts-ignore
|
|
117
|
-
const braintree = (await import('braintree')).default;
|
|
116
|
+
const braintree = (await import('braintree')).default;
|
|
118
117
|
const gateway = getGateway(braintree);
|
|
119
118
|
const address = order.billingAddress;
|
|
120
119
|
const pricing = OrderPricingSheet({
|
|
121
120
|
calculation: order.calculation,
|
|
122
|
-
|
|
121
|
+
currencyCode: order.currencyCode,
|
|
123
122
|
});
|
|
124
123
|
const rounded = Math.round(pricing.total({ useNetPrice: false }).amount / 10 || 0) * 10;
|
|
125
124
|
const saleRequest = {
|
|
126
125
|
amount: rounded / 100,
|
|
127
|
-
merchantAccountId: order.
|
|
126
|
+
merchantAccountId: order.currencyCode,
|
|
128
127
|
paymentMethodNonce: paypalPaymentMethodNonce,
|
|
129
128
|
orderId: order.orderNumber || order._id,
|
|
130
129
|
shipping: address
|
|
@@ -6,9 +6,8 @@ export type CryptopayTransaction = {
|
|
|
6
6
|
blockHeight: number;
|
|
7
7
|
mostRecentBlockHeight: number;
|
|
8
8
|
amount: mongodb.Decimal128;
|
|
9
|
-
|
|
9
|
+
currencyCode: string;
|
|
10
10
|
decimals: number;
|
|
11
|
-
contract: string;
|
|
12
11
|
orderPaymentId?: string;
|
|
13
12
|
} & TimestampFields;
|
|
14
13
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { describe, it } from 'node:test';
|
|
2
|
+
import assert from 'node:assert';
|
|
3
|
+
import denoteAmount from './denote-amount.js';
|
|
4
|
+
|
|
5
|
+
describe('Denote Amount', () => {
|
|
6
|
+
it('Handle amount with 18 decimals', () => {
|
|
7
|
+
// For example, Ethereum uses 18 decimals, this converts WEI to GWei
|
|
8
|
+
assert.equal(denoteAmount('1000000000000000000', 18), 1000000000n);
|
|
9
|
+
assert.equal(denoteAmount('100000000000000', 18), 100000n);
|
|
10
|
+
assert.equal(denoteAmount('100', 18), 0n);
|
|
11
|
+
});
|
|
12
|
+
it('Handle amount with 10 decimals', () => {
|
|
13
|
+
assert.equal(denoteAmount('100000000', 10), 10000000n);
|
|
14
|
+
assert.equal(denoteAmount('100000000000000', 10), 10000000000000n);
|
|
15
|
+
assert.equal(denoteAmount('100', 10), 10n);
|
|
16
|
+
});
|
|
17
|
+
it('Handle amount with 8 decimals', () => {
|
|
18
|
+
// For example, Bitcoin uses 8 decimals, this keeps Satoshi as is
|
|
19
|
+
assert.equal(denoteAmount('100000000', 8), 100000000n);
|
|
20
|
+
assert.equal(denoteAmount('100000000000000', 8), 100000000000000n);
|
|
21
|
+
assert.equal(denoteAmount('1', 8), 1n);
|
|
22
|
+
});
|
|
23
|
+
it('Handle amount with 2 decimals', () => {
|
|
24
|
+
assert.equal(denoteAmount('100000000', 2), 100000000n);
|
|
25
|
+
assert.equal(denoteAmount('100000000000000', 2), 100000000000000n);
|
|
26
|
+
assert.equal(denoteAmount('1', 2), 1n);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a cryptocurrency amount from its smallest unit (e.g., wei, satoshi) to a normalized value
|
|
3
|
+
* with 9 decimal places of precision.
|
|
4
|
+
*
|
|
5
|
+
* This function handles the denomination of cryptocurrency amounts by converting from the
|
|
6
|
+
* blockchain's native smallest units (like wei for Ethereum which is 10^-18 ETH, or satoshi for Bitcoin
|
|
7
|
+
* which is 10^-8 BTC) to a standardized format with 9 decimal places for consistent handling across
|
|
8
|
+
* different cryptocurrencies.
|
|
9
|
+
*
|
|
10
|
+
* @param {string} amountAsString - The amount in the cryptocurrency's smallest unit (e.g., wei, satoshi)
|
|
11
|
+
* represented as a string to handle large numbers
|
|
12
|
+
* @param {number} decimals - The number of decimal places used by the cryptocurrency
|
|
13
|
+
* (e.g., 18 for Ethereum, 8 for Bitcoin)
|
|
14
|
+
* @returns {number} The converted amount with 9 decimal places of precision
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Convert 1 ETH in wei (1000000000000000000) to normalized format
|
|
18
|
+
* denoteAmount("1000000000000000000", 18)
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Convert 1 BTC in satoshi (100000000) to normalized format
|
|
22
|
+
* denoteAmount("100000000", 8)
|
|
23
|
+
*/
|
|
24
|
+
export default function denoteAmount(amountAsString: string, decimals: number) {
|
|
25
|
+
if (decimals <= 9) return BigInt(amountAsString); // No conversion needed if decimals are 9 or less
|
|
26
|
+
const exponent = BigInt(decimals) - 9n;
|
|
27
|
+
const amount = BigInt(amountAsString);
|
|
28
|
+
return amount / 10n ** exponent; // Denote to 9 decimals
|
|
29
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { describe, it } from 'node:test';
|
|
2
|
+
import assert from 'node:assert';
|
|
3
|
+
import deriveBtcAddress from './derive-btc-address.js';
|
|
4
|
+
|
|
5
|
+
describe('BTC Address Derivation', () => {
|
|
6
|
+
it('returns a deterministic BIP44 child address', () => {
|
|
7
|
+
assert.equal(
|
|
8
|
+
deriveBtcAddress(
|
|
9
|
+
'zpub6qpRm6gMdkrXvVKw7qgayHnqJGJkpE4rnYQdyJfZW87ed4Fk6HjVaThN12hv2rrL3EzfvvBW6ZpbMEe5UxZYEjhgeMigyvAbS5LiXPkKrys',
|
|
10
|
+
1,
|
|
11
|
+
),
|
|
12
|
+
'bc1qspcam3ntdpvhgz4vnxfdhas6qr8hf8tjfaz5p4',
|
|
13
|
+
);
|
|
14
|
+
assert.equal(
|
|
15
|
+
deriveBtcAddress(
|
|
16
|
+
'zpub6qpRm6gMdkrXvVKw7qgayHnqJGJkpE4rnYQdyJfZW87ed4Fk6HjVaThN12hv2rrL3EzfvvBW6ZpbMEe5UxZYEjhgeMigyvAbS5LiXPkKrys',
|
|
17
|
+
2,
|
|
18
|
+
),
|
|
19
|
+
'bc1qd0a7znq3pz3sc4armthddkyam57ey7qjc4v6vn',
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
});
|