@unchainedshop/plugins 4.3.5 → 4.5.0
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/README.md +137 -0
- package/lib/delivery/post.d.ts +0 -1
- package/lib/delivery/post.js +0 -1
- package/lib/delivery/send-message.d.ts +0 -1
- package/lib/delivery/send-message.js +0 -1
- package/lib/delivery/stores.d.ts +0 -1
- package/lib/delivery/stores.js +0 -1
- package/lib/enrollments/licensed.d.ts +0 -1
- package/lib/enrollments/licensed.js +0 -1
- package/lib/events/aws-eventbridge.d.ts +0 -1
- package/lib/events/aws-eventbridge.js +0 -3
- package/lib/events/node-event-emitter.d.ts +0 -1
- package/lib/events/node-event-emitter.js +0 -1
- package/lib/events/redis.d.ts +0 -1
- package/lib/events/redis.js +0 -1
- package/lib/files/gridfs/adapter.d.ts +3 -4
- package/lib/files/gridfs/adapter.js +6 -6
- package/lib/files/gridfs/handler-express.d.ts +2 -3
- package/lib/files/gridfs/handler-express.js +6 -9
- package/lib/files/gridfs/handler-fastify.d.ts +1 -2
- package/lib/files/gridfs/handler-fastify.js +6 -9
- package/lib/files/gridfs/index.d.ts +2 -3
- package/lib/files/gridfs/index.js +2 -3
- package/lib/files/gridfs/module.d.ts +0 -1
- package/lib/files/gridfs/module.js +0 -4
- package/lib/files/gridfs/sign.d.ts +0 -1
- package/lib/files/gridfs/sign.js +0 -1
- package/lib/files/minio/handler-express.d.ts +0 -1
- package/lib/files/minio/handler-express.js +0 -1
- package/lib/files/minio/handler-fastify.d.ts +1 -2
- package/lib/files/minio/handler-fastify.js +2 -1
- package/lib/files/minio/index.d.ts +1 -2
- package/lib/files/minio/index.js +1 -5
- package/lib/filters/local-search.d.ts +1 -2
- package/lib/filters/local-search.js +8 -20
- package/lib/filters/strict-equal.d.ts +0 -1
- package/lib/filters/strict-equal.js +0 -1
- package/lib/payment/apple-iap/adapter.d.ts +0 -1
- package/lib/payment/apple-iap/adapter.js +3 -5
- package/lib/payment/apple-iap/db/AppleTransactionsCollection.d.ts +1 -2
- package/lib/payment/apple-iap/db/AppleTransactionsCollection.js +2 -1
- package/lib/payment/apple-iap/fix-periods.d.ts +1 -2
- package/lib/payment/apple-iap/fix-periods.js +1 -1
- package/lib/payment/apple-iap/handler-express.d.ts +0 -1
- package/lib/payment/apple-iap/handler-express.js +2 -5
- package/lib/payment/apple-iap/handler-fastify.d.ts +1 -2
- package/lib/payment/apple-iap/handler-fastify.js +4 -5
- package/lib/payment/apple-iap/index.d.ts +2 -3
- package/lib/payment/apple-iap/index.js +2 -3
- package/lib/payment/apple-iap/module.d.ts +1 -2
- package/lib/payment/apple-iap/module.js +1 -2
- package/lib/payment/apple-iap/verify-receipt.d.ts +0 -1
- package/lib/payment/apple-iap/verify-receipt.js +0 -4
- package/lib/payment/braintree.d.ts +0 -1
- package/lib/payment/braintree.js +0 -5
- package/lib/payment/cryptopay/db/CryptopayTransactions.d.ts +1 -2
- package/lib/payment/cryptopay/db/CryptopayTransactions.js +2 -1
- package/lib/payment/cryptopay/denote-amount.d.ts +0 -24
- package/lib/payment/cryptopay/denote-amount.js +2 -26
- package/lib/payment/cryptopay/derive-btc-address.d.ts +0 -1
- package/lib/payment/cryptopay/derive-btc-address.js +4 -14
- package/lib/payment/cryptopay/derive-eth-address.d.ts +0 -1
- package/lib/payment/cryptopay/derive-eth-address.js +1 -3
- package/lib/payment/cryptopay/handle-webhook.d.ts +2 -3
- package/lib/payment/cryptopay/handle-webhook.js +3 -3
- package/lib/payment/cryptopay/handler-express.d.ts +0 -1
- package/lib/payment/cryptopay/handler-express.js +1 -2
- package/lib/payment/cryptopay/handler-fastify.d.ts +1 -2
- package/lib/payment/cryptopay/handler-fastify.js +2 -2
- package/lib/payment/cryptopay/index.d.ts +2 -3
- package/lib/payment/cryptopay/index.js +2 -3
- package/lib/payment/cryptopay/module.d.ts +1 -2
- package/lib/payment/cryptopay/module.js +2 -3
- package/lib/payment/cryptopay/plugin.d.ts +1 -2
- package/lib/payment/cryptopay/plugin.js +8 -37
- package/lib/payment/datatrans-v2/api/authorize.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/authorize.js +0 -2
- package/lib/payment/datatrans-v2/api/authorizeAuthenticated.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/authorizeAuthenticated.js +0 -1
- package/lib/payment/datatrans-v2/api/cancel.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/cancel.js +0 -1
- package/lib/payment/datatrans-v2/api/index.d.ts +8 -9
- package/lib/payment/datatrans-v2/api/index.js +9 -10
- package/lib/payment/datatrans-v2/api/init.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/init.js +2 -4
- package/lib/payment/datatrans-v2/api/makeFetcher.d.ts +0 -1
- package/lib/payment/datatrans-v2/api/makeFetcher.js +0 -3
- package/lib/payment/datatrans-v2/api/secureFields.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/secureFields.js +1 -3
- package/lib/payment/datatrans-v2/api/settle.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/settle.js +0 -1
- package/lib/payment/datatrans-v2/api/status.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/status.js +0 -1
- package/lib/payment/datatrans-v2/api/types.d.ts +0 -1
- package/lib/payment/datatrans-v2/api/types.js +0 -1
- package/lib/payment/datatrans-v2/api/validate.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/validate.js +0 -1
- package/lib/payment/datatrans-v2/generateSignature.d.ts +0 -1
- package/lib/payment/datatrans-v2/generateSignature.js +0 -2
- package/lib/payment/datatrans-v2/getPaths.d.ts +0 -1
- package/lib/payment/datatrans-v2/getPaths.js +0 -1
- package/lib/payment/datatrans-v2/handler-express.d.ts +0 -1
- package/lib/payment/datatrans-v2/handler-express.js +1 -2
- package/lib/payment/datatrans-v2/handler-fastify.d.ts +1 -2
- package/lib/payment/datatrans-v2/handler-fastify.js +1 -2
- package/lib/payment/datatrans-v2/index.d.ts +0 -1
- package/lib/payment/datatrans-v2/index.js +3 -14
- package/lib/payment/datatrans-v2/parseRegistrationData.d.ts +4 -5
- package/lib/payment/datatrans-v2/parseRegistrationData.js +1 -2
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts +1 -2
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.js +0 -1
- package/lib/payment/datatrans-v2/splitProperties.d.ts +0 -1
- package/lib/payment/datatrans-v2/splitProperties.js +0 -2
- package/lib/payment/invoice-prepaid.d.ts +0 -1
- package/lib/payment/invoice-prepaid.js +0 -1
- package/lib/payment/invoice.d.ts +0 -1
- package/lib/payment/invoice.js +0 -1
- package/lib/payment/paypal-checkout.d.ts +0 -1
- package/lib/payment/paypal-checkout.js +0 -11
- package/lib/payment/payrexx/api/index.d.ts +15 -15
- package/lib/payment/payrexx/api/index.js +15 -27
- package/lib/payment/payrexx/api/makeFetcher.d.ts +0 -1
- package/lib/payment/payrexx/api/makeFetcher.js +0 -1
- package/lib/payment/payrexx/handler-express.d.ts +0 -1
- package/lib/payment/payrexx/handler-express.js +0 -4
- package/lib/payment/payrexx/handler-fastify.d.ts +1 -2
- package/lib/payment/payrexx/handler-fastify.js +0 -4
- package/lib/payment/payrexx/index.d.ts +0 -1
- package/lib/payment/payrexx/index.js +9 -35
- package/lib/payment/payrexx/payrexx.d.ts +0 -1
- package/lib/payment/payrexx/payrexx.js +0 -1
- package/lib/payment/postfinance-checkout/api-client.d.ts +0 -1
- package/lib/payment/postfinance-checkout/api-client.js +0 -6
- package/lib/payment/postfinance-checkout/api-types.d.ts +49 -44
- package/lib/payment/postfinance-checkout/api-types.js +43 -51
- package/lib/payment/postfinance-checkout/api.d.ts +1 -2
- package/lib/payment/postfinance-checkout/api.js +2 -3
- package/lib/payment/postfinance-checkout/handler-express.d.ts +0 -1
- package/lib/payment/postfinance-checkout/handler-express.js +1 -2
- package/lib/payment/postfinance-checkout/handler-fastify.d.ts +1 -2
- package/lib/payment/postfinance-checkout/handler-fastify.js +1 -2
- package/lib/payment/postfinance-checkout/index.d.ts +2 -3
- package/lib/payment/postfinance-checkout/index.js +7 -10
- package/lib/payment/postfinance-checkout/types.d.ts +11 -10
- package/lib/payment/postfinance-checkout/types.js +9 -12
- package/lib/payment/postfinance-checkout/utils.d.ts +2 -3
- package/lib/payment/postfinance-checkout/utils.js +1 -2
- package/lib/payment/saferpay/adapter.d.ts +1 -2
- package/lib/payment/saferpay/adapter.js +2 -5
- package/lib/payment/saferpay/api/api/SaferpayClient.d.ts +6 -7
- package/lib/payment/saferpay/api/api/SaferpayClient.js +2 -2
- package/lib/payment/saferpay/api/api/SaferpayConnection.d.ts +0 -1
- package/lib/payment/saferpay/api/api/SaferpayConnection.js +0 -1
- package/lib/payment/saferpay/api/index.d.ts +4 -5
- package/lib/payment/saferpay/api/index.js +1 -2
- package/lib/payment/saferpay/api/models/PaymentMethods.d.ts +0 -1
- package/lib/payment/saferpay/api/models/PaymentMethods.js +0 -1
- package/lib/payment/saferpay/api/models/PaymentPageAssert.d.ts +4 -5
- package/lib/payment/saferpay/api/models/PaymentPageAssert.js +0 -1
- package/lib/payment/saferpay/api/models/PaymentPageInitialize.d.ts +4 -5
- package/lib/payment/saferpay/api/models/PaymentPageInitialize.js +0 -1
- package/lib/payment/saferpay/api/models/Request.d.ts +0 -1
- package/lib/payment/saferpay/api/models/Request.js +0 -1
- package/lib/payment/saferpay/api/models/Response.d.ts +0 -1
- package/lib/payment/saferpay/api/models/Response.js +0 -1
- package/lib/payment/saferpay/api/models/Transaction.d.ts +0 -1
- package/lib/payment/saferpay/api/models/Transaction.js +0 -1
- package/lib/payment/saferpay/api/models/TransactionCancel.d.ts +2 -3
- package/lib/payment/saferpay/api/models/TransactionCancel.js +0 -1
- package/lib/payment/saferpay/api/models/TransactionCapture.d.ts +3 -4
- package/lib/payment/saferpay/api/models/TransactionCapture.js +0 -1
- package/lib/payment/saferpay/buildSignature.d.ts +0 -1
- package/lib/payment/saferpay/buildSignature.js +0 -1
- package/lib/payment/saferpay/db/SaferpayTransactionsCollection.d.ts +1 -2
- package/lib/payment/saferpay/db/SaferpayTransactionsCollection.js +1 -1
- package/lib/payment/saferpay/getReturnPath.d.ts +0 -1
- package/lib/payment/saferpay/getReturnPath.js +0 -1
- package/lib/payment/saferpay/handler-express.d.ts +0 -1
- package/lib/payment/saferpay/handler-express.js +1 -2
- package/lib/payment/saferpay/handler-fastify.d.ts +1 -2
- package/lib/payment/saferpay/handler-fastify.js +1 -2
- package/lib/payment/saferpay/index.d.ts +2 -3
- package/lib/payment/saferpay/index.js +2 -3
- package/lib/payment/saferpay/module.d.ts +2 -3
- package/lib/payment/saferpay/module.js +2 -2
- package/lib/payment/stripe/handler-express.d.ts +0 -1
- package/lib/payment/stripe/handler-express.js +1 -2
- package/lib/payment/stripe/handler-fastify.d.ts +1 -2
- package/lib/payment/stripe/handler-fastify.js +1 -2
- package/lib/payment/stripe/index.d.ts +0 -1
- package/lib/payment/stripe/index.js +1 -4
- package/lib/payment/stripe/stripe.d.ts +1 -2
- package/lib/payment/stripe/stripe.js +2 -3
- package/lib/presets/all-express.d.ts +1 -2
- package/lib/presets/all-express.js +9 -10
- package/lib/presets/all-fastify.d.ts +2 -3
- package/lib/presets/all-fastify.js +9 -10
- package/lib/presets/all.d.ts +23 -24
- package/lib/presets/all.js +20 -25
- package/lib/presets/base-express.d.ts +0 -1
- package/lib/presets/base-express.js +1 -2
- package/lib/presets/base-fastify.d.ts +1 -2
- package/lib/presets/base-fastify.js +1 -3
- package/lib/presets/base.d.ts +23 -24
- package/lib/presets/base.js +23 -33
- package/lib/presets/countries/ch.d.ts +2 -3
- package/lib/presets/countries/ch.js +2 -3
- package/lib/presets/crypto-express.d.ts +1 -2
- package/lib/presets/crypto-express.js +2 -3
- package/lib/presets/crypto-fastify.d.ts +1 -2
- package/lib/presets/crypto-fastify.js +2 -3
- package/lib/presets/crypto.d.ts +6 -7
- package/lib/presets/crypto.js +6 -8
- package/lib/pricing/delivery-swiss-tax.d.ts +1 -2
- package/lib/pricing/delivery-swiss-tax.js +2 -3
- package/lib/pricing/discount-100-off.d.ts +1 -2
- package/lib/pricing/discount-100-off.js +0 -4
- package/lib/pricing/discount-half-price-manual.d.ts +1 -2
- package/lib/pricing/discount-half-price-manual.js +0 -4
- package/lib/pricing/discount-half-price.d.ts +1 -2
- package/lib/pricing/discount-half-price.js +0 -4
- package/lib/pricing/free-delivery.d.ts +1 -2
- package/lib/pricing/free-delivery.js +0 -1
- package/lib/pricing/free-payment.d.ts +1 -2
- package/lib/pricing/free-payment.js +0 -1
- package/lib/pricing/order-delivery.d.ts +1 -2
- package/lib/pricing/order-delivery.js +0 -2
- package/lib/pricing/order-discount.d.ts +1 -2
- package/lib/pricing/order-discount.js +0 -4
- package/lib/pricing/order-items-discount.d.ts +0 -1
- package/lib/pricing/order-items-discount.js +0 -5
- package/lib/pricing/order-items.d.ts +0 -1
- package/lib/pricing/order-items.js +0 -2
- package/lib/pricing/order-payment.d.ts +0 -1
- package/lib/pricing/order-payment.js +0 -2
- package/lib/pricing/order-round.d.ts +1 -2
- package/lib/pricing/order-round.js +0 -6
- package/lib/pricing/product-catalog-price-options.d.ts +0 -1
- package/lib/pricing/product-catalog-price-options.js +0 -1
- package/lib/pricing/product-catalog-price.d.ts +1 -2
- package/lib/pricing/product-catalog-price.js +2 -3
- package/lib/pricing/product-discount.d.ts +0 -1
- package/lib/pricing/product-discount.js +0 -1
- package/lib/pricing/product-price-rateconversion.d.ts +1 -2
- package/lib/pricing/product-price-rateconversion.js +0 -4
- package/lib/pricing/product-round.d.ts +1 -2
- package/lib/pricing/product-round.js +0 -1
- package/lib/pricing/product-swiss-tax.d.ts +1 -2
- package/lib/pricing/product-swiss-tax.js +2 -5
- package/lib/pricing/tax/ch.d.ts +2 -3
- package/lib/pricing/tax/ch.js +0 -1
- package/lib/pricing/utils/isDeliveryAddressInCountry.d.ts +1 -2
- package/lib/pricing/utils/isDeliveryAddressInCountry.js +0 -1
- package/lib/quotations/manual.d.ts +0 -1
- package/lib/quotations/manual.js +0 -1
- package/lib/warehousing/eth-minter.d.ts +0 -1
- package/lib/warehousing/eth-minter.js +2 -11
- package/lib/warehousing/store.d.ts +0 -1
- package/lib/warehousing/store.js +0 -1
- package/lib/worker/budgetsms.d.ts +0 -1
- package/lib/worker/budgetsms.js +4 -52
- package/lib/worker/bulk-import.d.ts +1 -2
- package/lib/worker/bulk-import.js +1 -3
- package/lib/worker/bulkgate.d.ts +0 -1
- package/lib/worker/bulkgate.js +7 -20
- package/lib/worker/email.d.ts +0 -1
- package/lib/worker/email.js +0 -3
- package/lib/worker/enrollment-order-generator.d.ts +0 -1
- package/lib/worker/enrollment-order-generator.js +1 -2
- package/lib/worker/error-notifications.d.ts +1 -2
- package/lib/worker/error-notifications.js +2 -4
- package/lib/worker/export-token.d.ts +1 -2
- package/lib/worker/export-token.js +1 -2
- package/lib/worker/external.d.ts +1 -2
- package/lib/worker/external.js +0 -1
- package/lib/worker/heartbeat.d.ts +0 -1
- package/lib/worker/heartbeat.js +0 -1
- package/lib/worker/http-request.d.ts +1 -2
- package/lib/worker/http-request.js +0 -3
- package/lib/worker/message.d.ts +2 -3
- package/lib/worker/message.js +2 -3
- package/lib/worker/push-notification.d.ts +0 -1
- package/lib/worker/push-notification.js +0 -1
- package/lib/worker/twilio.d.ts +0 -1
- package/lib/worker/twilio.js +1 -2
- package/lib/worker/update-coinbase-rates.d.ts +0 -1
- package/lib/worker/update-coinbase-rates.js +3 -6
- package/lib/worker/update-ecb-rates.d.ts +0 -1
- package/lib/worker/update-ecb-rates.js +2 -6
- package/lib/worker/update-token-ownership.d.ts +1 -2
- package/lib/worker/update-token-ownership.js +4 -6
- package/lib/worker/zombie-killer.d.ts +1 -2
- package/lib/worker/zombie-killer.js +2 -9
- package/package.json +20 -25
- package/lib/delivery/post.d.ts.map +0 -1
- package/lib/delivery/post.js.map +0 -1
- package/lib/delivery/send-message.d.ts.map +0 -1
- package/lib/delivery/send-message.js.map +0 -1
- package/lib/delivery/stores.d.ts.map +0 -1
- package/lib/delivery/stores.js.map +0 -1
- package/lib/enrollments/licensed.d.ts.map +0 -1
- package/lib/enrollments/licensed.js.map +0 -1
- package/lib/events/aws-eventbridge.d.ts.map +0 -1
- package/lib/events/aws-eventbridge.js.map +0 -1
- package/lib/events/node-event-emitter.d.ts.map +0 -1
- package/lib/events/node-event-emitter.js.map +0 -1
- package/lib/events/redis.d.ts.map +0 -1
- package/lib/events/redis.js.map +0 -1
- package/lib/files/gridfs/adapter.d.ts.map +0 -1
- package/lib/files/gridfs/adapter.js.map +0 -1
- package/lib/files/gridfs/handler-express.d.ts.map +0 -1
- package/lib/files/gridfs/handler-express.js.map +0 -1
- package/lib/files/gridfs/handler-fastify.d.ts.map +0 -1
- package/lib/files/gridfs/handler-fastify.js.map +0 -1
- package/lib/files/gridfs/index.d.ts.map +0 -1
- package/lib/files/gridfs/index.js.map +0 -1
- package/lib/files/gridfs/module.d.ts.map +0 -1
- package/lib/files/gridfs/module.js.map +0 -1
- package/lib/files/gridfs/sign.d.ts.map +0 -1
- package/lib/files/gridfs/sign.js.map +0 -1
- package/lib/files/minio/handler-express.d.ts.map +0 -1
- package/lib/files/minio/handler-express.js.map +0 -1
- package/lib/files/minio/handler-fastify.d.ts.map +0 -1
- package/lib/files/minio/handler-fastify.js.map +0 -1
- package/lib/files/minio/index.d.ts.map +0 -1
- package/lib/files/minio/index.js.map +0 -1
- package/lib/filters/local-search.d.ts.map +0 -1
- package/lib/filters/local-search.js.map +0 -1
- package/lib/filters/strict-equal.d.ts.map +0 -1
- package/lib/filters/strict-equal.js.map +0 -1
- package/lib/payment/apple-iap/adapter.d.ts.map +0 -1
- package/lib/payment/apple-iap/adapter.js.map +0 -1
- package/lib/payment/apple-iap/db/AppleTransactionsCollection.d.ts.map +0 -1
- package/lib/payment/apple-iap/db/AppleTransactionsCollection.js.map +0 -1
- package/lib/payment/apple-iap/fix-periods.d.ts.map +0 -1
- package/lib/payment/apple-iap/fix-periods.js.map +0 -1
- package/lib/payment/apple-iap/handler-express.d.ts.map +0 -1
- package/lib/payment/apple-iap/handler-express.js.map +0 -1
- package/lib/payment/apple-iap/handler-fastify.d.ts.map +0 -1
- package/lib/payment/apple-iap/handler-fastify.js.map +0 -1
- package/lib/payment/apple-iap/index.d.ts.map +0 -1
- package/lib/payment/apple-iap/index.js.map +0 -1
- package/lib/payment/apple-iap/module.d.ts.map +0 -1
- package/lib/payment/apple-iap/module.js.map +0 -1
- package/lib/payment/apple-iap/verify-receipt.d.ts.map +0 -1
- package/lib/payment/apple-iap/verify-receipt.js.map +0 -1
- package/lib/payment/braintree.d.ts.map +0 -1
- package/lib/payment/braintree.js.map +0 -1
- package/lib/payment/cryptopay/db/CryptopayTransactions.d.ts.map +0 -1
- package/lib/payment/cryptopay/db/CryptopayTransactions.js.map +0 -1
- package/lib/payment/cryptopay/denote-amount.d.ts.map +0 -1
- package/lib/payment/cryptopay/denote-amount.js.map +0 -1
- package/lib/payment/cryptopay/derive-btc-address.d.ts.map +0 -1
- package/lib/payment/cryptopay/derive-btc-address.js.map +0 -1
- package/lib/payment/cryptopay/derive-eth-address.d.ts.map +0 -1
- package/lib/payment/cryptopay/derive-eth-address.js.map +0 -1
- package/lib/payment/cryptopay/handle-webhook.d.ts.map +0 -1
- package/lib/payment/cryptopay/handle-webhook.js.map +0 -1
- package/lib/payment/cryptopay/handler-express.d.ts.map +0 -1
- package/lib/payment/cryptopay/handler-express.js.map +0 -1
- package/lib/payment/cryptopay/handler-fastify.d.ts.map +0 -1
- package/lib/payment/cryptopay/handler-fastify.js.map +0 -1
- package/lib/payment/cryptopay/index.d.ts.map +0 -1
- package/lib/payment/cryptopay/index.js.map +0 -1
- package/lib/payment/cryptopay/module.d.ts.map +0 -1
- package/lib/payment/cryptopay/module.js.map +0 -1
- package/lib/payment/cryptopay/plugin.d.ts.map +0 -1
- package/lib/payment/cryptopay/plugin.js.map +0 -1
- package/lib/payment/datatrans-v2/api/authorize.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/authorize.js.map +0 -1
- package/lib/payment/datatrans-v2/api/authorizeAuthenticated.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/authorizeAuthenticated.js.map +0 -1
- package/lib/payment/datatrans-v2/api/cancel.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/cancel.js.map +0 -1
- package/lib/payment/datatrans-v2/api/index.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/index.js.map +0 -1
- package/lib/payment/datatrans-v2/api/init.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/init.js.map +0 -1
- package/lib/payment/datatrans-v2/api/makeFetcher.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/makeFetcher.js.map +0 -1
- package/lib/payment/datatrans-v2/api/secureFields.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/secureFields.js.map +0 -1
- package/lib/payment/datatrans-v2/api/settle.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/settle.js.map +0 -1
- package/lib/payment/datatrans-v2/api/status.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/status.js.map +0 -1
- package/lib/payment/datatrans-v2/api/types.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/types.js.map +0 -1
- package/lib/payment/datatrans-v2/api/validate.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/validate.js.map +0 -1
- package/lib/payment/datatrans-v2/generateSignature.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/generateSignature.js.map +0 -1
- package/lib/payment/datatrans-v2/getPaths.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/getPaths.js.map +0 -1
- package/lib/payment/datatrans-v2/handler-express.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/handler-express.js.map +0 -1
- package/lib/payment/datatrans-v2/handler-fastify.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/handler-fastify.js.map +0 -1
- package/lib/payment/datatrans-v2/index.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/index.js.map +0 -1
- package/lib/payment/datatrans-v2/parseRegistrationData.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/parseRegistrationData.js.map +0 -1
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.js.map +0 -1
- package/lib/payment/datatrans-v2/splitProperties.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/splitProperties.js.map +0 -1
- package/lib/payment/invoice-prepaid.d.ts.map +0 -1
- package/lib/payment/invoice-prepaid.js.map +0 -1
- package/lib/payment/invoice.d.ts.map +0 -1
- package/lib/payment/invoice.js.map +0 -1
- package/lib/payment/paypal-checkout.d.ts.map +0 -1
- package/lib/payment/paypal-checkout.js.map +0 -1
- package/lib/payment/payrexx/api/index.d.ts.map +0 -1
- package/lib/payment/payrexx/api/index.js.map +0 -1
- package/lib/payment/payrexx/api/makeFetcher.d.ts.map +0 -1
- package/lib/payment/payrexx/api/makeFetcher.js.map +0 -1
- package/lib/payment/payrexx/handler-express.d.ts.map +0 -1
- package/lib/payment/payrexx/handler-express.js.map +0 -1
- package/lib/payment/payrexx/handler-fastify.d.ts.map +0 -1
- package/lib/payment/payrexx/handler-fastify.js.map +0 -1
- package/lib/payment/payrexx/index.d.ts.map +0 -1
- package/lib/payment/payrexx/index.js.map +0 -1
- package/lib/payment/payrexx/payrexx.d.ts.map +0 -1
- package/lib/payment/payrexx/payrexx.js.map +0 -1
- package/lib/payment/postfinance-checkout/api-client.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/api-client.js.map +0 -1
- package/lib/payment/postfinance-checkout/api-types.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/api-types.js.map +0 -1
- package/lib/payment/postfinance-checkout/api.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/api.js.map +0 -1
- package/lib/payment/postfinance-checkout/handler-express.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/handler-express.js.map +0 -1
- package/lib/payment/postfinance-checkout/handler-fastify.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/handler-fastify.js.map +0 -1
- package/lib/payment/postfinance-checkout/index.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/index.js.map +0 -1
- package/lib/payment/postfinance-checkout/types.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/types.js.map +0 -1
- package/lib/payment/postfinance-checkout/utils.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/utils.js.map +0 -1
- package/lib/payment/saferpay/adapter.d.ts.map +0 -1
- package/lib/payment/saferpay/adapter.js.map +0 -1
- package/lib/payment/saferpay/api/api/SaferpayClient.d.ts.map +0 -1
- package/lib/payment/saferpay/api/api/SaferpayClient.js.map +0 -1
- package/lib/payment/saferpay/api/api/SaferpayConnection.d.ts.map +0 -1
- package/lib/payment/saferpay/api/api/SaferpayConnection.js.map +0 -1
- package/lib/payment/saferpay/api/index.d.ts.map +0 -1
- package/lib/payment/saferpay/api/index.js.map +0 -1
- package/lib/payment/saferpay/api/models/PaymentMethods.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/PaymentMethods.js.map +0 -1
- package/lib/payment/saferpay/api/models/PaymentPageAssert.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/PaymentPageAssert.js.map +0 -1
- package/lib/payment/saferpay/api/models/PaymentPageInitialize.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/PaymentPageInitialize.js.map +0 -1
- package/lib/payment/saferpay/api/models/Request.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/Request.js.map +0 -1
- package/lib/payment/saferpay/api/models/Response.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/Response.js.map +0 -1
- package/lib/payment/saferpay/api/models/Transaction.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/Transaction.js.map +0 -1
- package/lib/payment/saferpay/api/models/TransactionCancel.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/TransactionCancel.js.map +0 -1
- package/lib/payment/saferpay/api/models/TransactionCapture.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/TransactionCapture.js.map +0 -1
- package/lib/payment/saferpay/buildSignature.d.ts.map +0 -1
- package/lib/payment/saferpay/buildSignature.js.map +0 -1
- package/lib/payment/saferpay/db/SaferpayTransactionsCollection.d.ts.map +0 -1
- package/lib/payment/saferpay/db/SaferpayTransactionsCollection.js.map +0 -1
- package/lib/payment/saferpay/getReturnPath.d.ts.map +0 -1
- package/lib/payment/saferpay/getReturnPath.js.map +0 -1
- package/lib/payment/saferpay/handler-express.d.ts.map +0 -1
- package/lib/payment/saferpay/handler-express.js.map +0 -1
- package/lib/payment/saferpay/handler-fastify.d.ts.map +0 -1
- package/lib/payment/saferpay/handler-fastify.js.map +0 -1
- package/lib/payment/saferpay/index.d.ts.map +0 -1
- package/lib/payment/saferpay/index.js.map +0 -1
- package/lib/payment/saferpay/module.d.ts.map +0 -1
- package/lib/payment/saferpay/module.js.map +0 -1
- package/lib/payment/stripe/handler-express.d.ts.map +0 -1
- package/lib/payment/stripe/handler-express.js.map +0 -1
- package/lib/payment/stripe/handler-fastify.d.ts.map +0 -1
- package/lib/payment/stripe/handler-fastify.js.map +0 -1
- package/lib/payment/stripe/index.d.ts.map +0 -1
- package/lib/payment/stripe/index.js.map +0 -1
- package/lib/payment/stripe/stripe.d.ts.map +0 -1
- package/lib/payment/stripe/stripe.js.map +0 -1
- package/lib/presets/all-express.d.ts.map +0 -1
- package/lib/presets/all-express.js.map +0 -1
- package/lib/presets/all-fastify.d.ts.map +0 -1
- package/lib/presets/all-fastify.js.map +0 -1
- package/lib/presets/all.d.ts.map +0 -1
- package/lib/presets/all.js.map +0 -1
- package/lib/presets/base-express.d.ts.map +0 -1
- package/lib/presets/base-express.js.map +0 -1
- package/lib/presets/base-fastify.d.ts.map +0 -1
- package/lib/presets/base-fastify.js.map +0 -1
- package/lib/presets/base.d.ts.map +0 -1
- package/lib/presets/base.js.map +0 -1
- package/lib/presets/countries/ch.d.ts.map +0 -1
- package/lib/presets/countries/ch.js.map +0 -1
- package/lib/presets/crypto-express.d.ts.map +0 -1
- package/lib/presets/crypto-express.js.map +0 -1
- package/lib/presets/crypto-fastify.d.ts.map +0 -1
- package/lib/presets/crypto-fastify.js.map +0 -1
- package/lib/presets/crypto.d.ts.map +0 -1
- package/lib/presets/crypto.js.map +0 -1
- package/lib/pricing/delivery-swiss-tax.d.ts.map +0 -1
- package/lib/pricing/delivery-swiss-tax.js.map +0 -1
- package/lib/pricing/discount-100-off.d.ts.map +0 -1
- package/lib/pricing/discount-100-off.js.map +0 -1
- package/lib/pricing/discount-half-price-manual.d.ts.map +0 -1
- package/lib/pricing/discount-half-price-manual.js.map +0 -1
- package/lib/pricing/discount-half-price.d.ts.map +0 -1
- package/lib/pricing/discount-half-price.js.map +0 -1
- package/lib/pricing/free-delivery.d.ts.map +0 -1
- package/lib/pricing/free-delivery.js.map +0 -1
- package/lib/pricing/free-payment.d.ts.map +0 -1
- package/lib/pricing/free-payment.js.map +0 -1
- package/lib/pricing/order-delivery.d.ts.map +0 -1
- package/lib/pricing/order-delivery.js.map +0 -1
- package/lib/pricing/order-discount.d.ts.map +0 -1
- package/lib/pricing/order-discount.js.map +0 -1
- package/lib/pricing/order-items-discount.d.ts.map +0 -1
- package/lib/pricing/order-items-discount.js.map +0 -1
- package/lib/pricing/order-items.d.ts.map +0 -1
- package/lib/pricing/order-items.js.map +0 -1
- package/lib/pricing/order-payment.d.ts.map +0 -1
- package/lib/pricing/order-payment.js.map +0 -1
- package/lib/pricing/order-round.d.ts.map +0 -1
- package/lib/pricing/order-round.js.map +0 -1
- package/lib/pricing/product-catalog-price-options.d.ts.map +0 -1
- package/lib/pricing/product-catalog-price-options.js.map +0 -1
- package/lib/pricing/product-catalog-price.d.ts.map +0 -1
- package/lib/pricing/product-catalog-price.js.map +0 -1
- package/lib/pricing/product-discount.d.ts.map +0 -1
- package/lib/pricing/product-discount.js.map +0 -1
- package/lib/pricing/product-price-rateconversion.d.ts.map +0 -1
- package/lib/pricing/product-price-rateconversion.js.map +0 -1
- package/lib/pricing/product-round.d.ts.map +0 -1
- package/lib/pricing/product-round.js.map +0 -1
- package/lib/pricing/product-swiss-tax.d.ts.map +0 -1
- package/lib/pricing/product-swiss-tax.js.map +0 -1
- package/lib/pricing/tax/ch.d.ts.map +0 -1
- package/lib/pricing/tax/ch.js.map +0 -1
- package/lib/pricing/utils/isDeliveryAddressInCountry.d.ts.map +0 -1
- package/lib/pricing/utils/isDeliveryAddressInCountry.js.map +0 -1
- package/lib/quotations/manual.d.ts.map +0 -1
- package/lib/quotations/manual.js.map +0 -1
- package/lib/warehousing/eth-minter.d.ts.map +0 -1
- package/lib/warehousing/eth-minter.js.map +0 -1
- package/lib/warehousing/store.d.ts.map +0 -1
- package/lib/warehousing/store.js.map +0 -1
- package/lib/worker/budgetsms.d.ts.map +0 -1
- package/lib/worker/budgetsms.js.map +0 -1
- package/lib/worker/bulk-import.d.ts.map +0 -1
- package/lib/worker/bulk-import.js.map +0 -1
- package/lib/worker/bulkgate.d.ts.map +0 -1
- package/lib/worker/bulkgate.js.map +0 -1
- package/lib/worker/email.d.ts.map +0 -1
- package/lib/worker/email.js.map +0 -1
- package/lib/worker/enrollment-order-generator.d.ts.map +0 -1
- package/lib/worker/enrollment-order-generator.js.map +0 -1
- package/lib/worker/error-notifications.d.ts.map +0 -1
- package/lib/worker/error-notifications.js.map +0 -1
- package/lib/worker/export-token.d.ts.map +0 -1
- package/lib/worker/export-token.js.map +0 -1
- package/lib/worker/external.d.ts.map +0 -1
- package/lib/worker/external.js.map +0 -1
- package/lib/worker/heartbeat.d.ts.map +0 -1
- package/lib/worker/heartbeat.js.map +0 -1
- package/lib/worker/http-request.d.ts.map +0 -1
- package/lib/worker/http-request.js.map +0 -1
- package/lib/worker/message.d.ts.map +0 -1
- package/lib/worker/message.js.map +0 -1
- package/lib/worker/push-notification.d.ts.map +0 -1
- package/lib/worker/push-notification.js.map +0 -1
- package/lib/worker/twilio.d.ts.map +0 -1
- package/lib/worker/twilio.js.map +0 -1
- package/lib/worker/update-coinbase-rates.d.ts.map +0 -1
- package/lib/worker/update-coinbase-rates.js.map +0 -1
- package/lib/worker/update-ecb-rates.d.ts.map +0 -1
- package/lib/worker/update-ecb-rates.js.map +0 -1
- package/lib/worker/update-token-ownership.d.ts.map +0 -1
- package/lib/worker/update-token-ownership.js.map +0 -1
- package/lib/worker/zombie-killer.d.ts.map +0 -1
- package/lib/worker/zombie-killer.js.map +0 -1
- package/readme.md +0 -5
- package/src/delivery/post.ts +0 -30
- package/src/delivery/send-message.ts +0 -50
- package/src/delivery/stores.ts +0 -53
- package/src/enrollments/licensed.ts +0 -61
- package/src/events/aws-eventbridge.ts +0 -45
- package/src/events/node-event-emitter.ts +0 -18
- package/src/events/redis.ts +0 -34
- package/src/files/gridfs/adapter.ts +0 -176
- package/src/files/gridfs/handler-express.ts +0 -145
- package/src/files/gridfs/handler-fastify.ts +0 -177
- package/src/files/gridfs/index.ts +0 -6
- package/src/files/gridfs/module.ts +0 -54
- package/src/files/gridfs/sign.ts +0 -28
- package/src/files/minio/handler-express.ts +0 -35
- package/src/files/minio/handler-fastify.ts +0 -44
- package/src/files/minio/index.ts +0 -232
- package/src/filters/local-search.ts +0 -101
- package/src/filters/strict-equal.ts +0 -30
- package/src/payment/apple-iap/adapter.ts +0 -153
- package/src/payment/apple-iap/db/AppleTransactionsCollection.ts +0 -14
- package/src/payment/apple-iap/fix-periods.ts +0 -31
- package/src/payment/apple-iap/handler-express.ts +0 -140
- package/src/payment/apple-iap/handler-fastify.ts +0 -147
- package/src/payment/apple-iap/index.ts +0 -6
- package/src/payment/apple-iap/module.ts +0 -34
- package/src/payment/apple-iap/verify-receipt.ts +0 -27
- package/src/payment/braintree.ts +0 -167
- package/src/payment/cryptopay/db/CryptopayTransactions.ts +0 -16
- package/src/payment/cryptopay/denote-amount.test.ts +0 -28
- package/src/payment/cryptopay/denote-amount.ts +0 -29
- package/src/payment/cryptopay/derive-btc-address.test.ts +0 -22
- package/src/payment/cryptopay/derive-btc-address.ts +0 -46
- package/src/payment/cryptopay/derive-eth-address.test.ts +0 -22
- package/src/payment/cryptopay/derive-eth-address.ts +0 -40
- package/src/payment/cryptopay/handle-webhook.ts +0 -103
- package/src/payment/cryptopay/handler-express.ts +0 -21
- package/src/payment/cryptopay/handler-fastify.ts +0 -24
- package/src/payment/cryptopay/index.ts +0 -7
- package/src/payment/cryptopay/module.ts +0 -138
- package/src/payment/cryptopay/plugin.ts +0 -282
- package/src/payment/cryptopay/readme.md +0 -23
- package/src/payment/datatrans-v2/api/authorize.ts +0 -17
- package/src/payment/datatrans-v2/api/authorizeAuthenticated.ts +0 -20
- package/src/payment/datatrans-v2/api/cancel.ts +0 -13
- package/src/payment/datatrans-v2/api/index.ts +0 -24
- package/src/payment/datatrans-v2/api/init.ts +0 -43
- package/src/payment/datatrans-v2/api/makeFetcher.ts +0 -52
- package/src/payment/datatrans-v2/api/secureFields.ts +0 -19
- package/src/payment/datatrans-v2/api/settle.ts +0 -13
- package/src/payment/datatrans-v2/api/status.ts +0 -8
- package/src/payment/datatrans-v2/api/types.ts +0 -378
- package/src/payment/datatrans-v2/api/validate.ts +0 -13
- package/src/payment/datatrans-v2/generateSignature.test.ts +0 -18
- package/src/payment/datatrans-v2/generateSignature.ts +0 -36
- package/src/payment/datatrans-v2/getPaths.ts +0 -25
- package/src/payment/datatrans-v2/handler-express.ts +0 -91
- package/src/payment/datatrans-v2/handler-fastify.ts +0 -97
- package/src/payment/datatrans-v2/index.ts +0 -524
- package/src/payment/datatrans-v2/parseRegistrationData.ts +0 -34
- package/src/payment/datatrans-v2/roundedAmountFromOrder.ts +0 -16
- package/src/payment/datatrans-v2/splitProperties.ts +0 -58
- package/src/payment/invoice-prepaid.ts +0 -40
- package/src/payment/invoice.ts +0 -36
- package/src/payment/paypal-checkout.ts +0 -127
- package/src/payment/payrexx/api/index.ts +0 -84
- package/src/payment/payrexx/api/makeFetcher.ts +0 -83
- package/src/payment/payrexx/handler-express.ts +0 -93
- package/src/payment/payrexx/handler-fastify.ts +0 -105
- package/src/payment/payrexx/index.ts +0 -248
- package/src/payment/payrexx/payrexx.ts +0 -65
- package/src/payment/payrexx/readme.md +0 -4
- package/src/payment/postfinance-checkout/api-client.ts +0 -111
- package/src/payment/postfinance-checkout/api-types.ts +0 -111
- package/src/payment/postfinance-checkout/api.ts +0 -114
- package/src/payment/postfinance-checkout/handler-express.ts +0 -44
- package/src/payment/postfinance-checkout/handler-fastify.ts +0 -53
- package/src/payment/postfinance-checkout/index.ts +0 -271
- package/src/payment/postfinance-checkout/types.ts +0 -27
- package/src/payment/postfinance-checkout/utils.ts +0 -39
- package/src/payment/saferpay/adapter.ts +0 -273
- package/src/payment/saferpay/api/api/SaferpayClient.ts +0 -79
- package/src/payment/saferpay/api/api/SaferpayConnection.ts +0 -36
- package/src/payment/saferpay/api/index.ts +0 -8
- package/src/payment/saferpay/api/models/PaymentMethods.ts +0 -26
- package/src/payment/saferpay/api/models/PaymentPageAssert.ts +0 -75
- package/src/payment/saferpay/api/models/PaymentPageInitialize.ts +0 -58
- package/src/payment/saferpay/api/models/Request.ts +0 -14
- package/src/payment/saferpay/api/models/Response.ts +0 -9
- package/src/payment/saferpay/api/models/Transaction.ts +0 -6
- package/src/payment/saferpay/api/models/TransactionCancel.ts +0 -15
- package/src/payment/saferpay/api/models/TransactionCapture.ts +0 -20
- package/src/payment/saferpay/buildSignature.ts +0 -9
- package/src/payment/saferpay/db/SaferpayTransactionsCollection.ts +0 -13
- package/src/payment/saferpay/getReturnPath.ts +0 -10
- package/src/payment/saferpay/handler-express.ts +0 -71
- package/src/payment/saferpay/handler-fastify.ts +0 -80
- package/src/payment/saferpay/index.ts +0 -6
- package/src/payment/saferpay/module.ts +0 -41
- package/src/payment/stripe/handler-express.ts +0 -135
- package/src/payment/stripe/handler-fastify.ts +0 -151
- package/src/payment/stripe/index.ts +0 -163
- package/src/payment/stripe/readme.md +0 -12
- package/src/payment/stripe/stripe.ts +0 -137
- package/src/presets/all-express.ts +0 -51
- package/src/presets/all-fastify.ts +0 -72
- package/src/presets/all.ts +0 -37
- package/src/presets/base-express.ts +0 -7
- package/src/presets/base-fastify.ts +0 -20
- package/src/presets/base.ts +0 -42
- package/src/presets/countries/ch.ts +0 -2
- package/src/presets/crypto-express.ts +0 -12
- package/src/presets/crypto-fastify.ts +0 -15
- package/src/presets/crypto.ts +0 -11
- package/src/pricing/delivery-swiss-tax.ts +0 -78
- package/src/pricing/discount-100-off.test.ts +0 -41
- package/src/pricing/discount-100-off.ts +0 -48
- package/src/pricing/discount-half-price-manual.test.ts +0 -52
- package/src/pricing/discount-half-price-manual.ts +0 -47
- package/src/pricing/discount-half-price.test.ts +0 -52
- package/src/pricing/discount-half-price.ts +0 -50
- package/src/pricing/free-delivery.test.ts +0 -10
- package/src/pricing/free-delivery.ts +0 -36
- package/src/pricing/free-payment.ts +0 -37
- package/src/pricing/licenced-enrollment.test.ts +0 -38
- package/src/pricing/order-delivery.test.ts +0 -9
- package/src/pricing/order-delivery.ts +0 -47
- package/src/pricing/order-discount.test.ts +0 -10
- package/src/pricing/order-discount.ts +0 -123
- package/src/pricing/order-items-discount.ts +0 -86
- package/src/pricing/order-items.ts +0 -61
- package/src/pricing/order-payment.ts +0 -48
- package/src/pricing/order-round.ts +0 -174
- package/src/pricing/plugins-index.test.ts +0 -5
- package/src/pricing/product-catalog-price-options.ts +0 -67
- package/src/pricing/product-catalog-price.ts +0 -71
- package/src/pricing/product-discount.ts +0 -97
- package/src/pricing/product-price-rateconversion.ts +0 -74
- package/src/pricing/product-round.ts +0 -66
- package/src/pricing/product-swiss-tax.ts +0 -102
- package/src/pricing/tax/ch.test.ts +0 -20
- package/src/pricing/tax/ch.ts +0 -65
- package/src/pricing/utils/isDeliveryAddressInCountry.test.ts +0 -106
- package/src/pricing/utils/isDeliveryAddressInCountry.ts +0 -26
- package/src/quotations/manual.ts +0 -26
- package/src/warehousing/eth-minter.ts +0 -167
- package/src/warehousing/store.ts +0 -45
- package/src/worker/budgetsms.ts +0 -268
- package/src/worker/bulk-import.ts +0 -77
- package/src/worker/bulkgate.ts +0 -138
- package/src/worker/email.ts +0 -165
- package/src/worker/enrollment-order-generator.ts +0 -94
- package/src/worker/error-notifications.ts +0 -83
- package/src/worker/export-token.ts +0 -32
- package/src/worker/external.ts +0 -17
- package/src/worker/heartbeat.ts +0 -37
- package/src/worker/http-request.ts +0 -71
- package/src/worker/message.ts +0 -56
- package/src/worker/push-notification.ts +0 -121
- package/src/worker/twilio.ts +0 -78
- package/src/worker/update-coinbase-rates.ts +0 -76
- package/src/worker/update-ecb-rates.ts +0 -115
- package/src/worker/update-token-ownership.ts +0 -70
- package/src/worker/zombie-killer.ts +0 -139
- package/tests/mock/datatrans/v1/secure-fields.json +0 -4
- package/tests/mock/datatrans/v1/transactions/authorize.json +0 -48
- package/tests/mock/datatrans/v1/transactions/card_check_authorized.json +0 -47
- package/tests/mock/datatrans/v1/transactions/payment_alias_authorized/settle.json +0 -1
- package/tests/mock/datatrans/v1/transactions/payment_alias_authorized.json +0 -48
- package/tests/mock/datatrans/v1/transactions/payment_authorized/cancel.json +0 -1
- package/tests/mock/datatrans/v1/transactions/payment_authorized/settle.json +0 -1
- package/tests/mock/datatrans/v1/transactions/payment_authorized.json +0 -48
- package/tests/mock/datatrans/v1/transactions/payment_authorized_low_amount/cancel.json +0 -1
- package/tests/mock/datatrans/v1/transactions/payment_authorized_low_amount.json +0 -48
- package/tests/mock/datatrans/v1/transactions/validate.json +0 -1
- package/tests/mock/datatrans/v1/transactions.json +0 -4
- package/tests/mock/payrexx/Gateway/1000001.json +0 -106
- package/tests/mock/payrexx/Gateway.json +0 -24
- package/tests/mock/payrexx/transaction_example1.json +0 -65
- package/tests/mock/payrexx/transaction_example2.json +0 -65
- package/tests/mock/payrexx/transaction_example3.json +0 -94
- package/tsconfig.json +0 -9
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { createLogger } from '@unchainedshop/logger';
|
|
2
|
-
import { Context } from '@unchainedshop/api';
|
|
3
|
-
import { OrderStatus } from '@unchainedshop/core-orders';
|
|
4
|
-
import { CryptopayModule } from './module.js';
|
|
5
|
-
import { ProductPriceRate } from '@unchainedshop/core-products';
|
|
6
|
-
|
|
7
|
-
const { CRYPTOPAY_SECRET, CRYPTOPAY_MAX_RATE_AGE = '360' } = process.env;
|
|
8
|
-
|
|
9
|
-
const logger = createLogger('unchained:cryptopay:handler');
|
|
10
|
-
|
|
11
|
-
export default async function handleWebhook(
|
|
12
|
-
{
|
|
13
|
-
secret,
|
|
14
|
-
wallet,
|
|
15
|
-
price,
|
|
16
|
-
ping,
|
|
17
|
-
}: {
|
|
18
|
-
secret: string;
|
|
19
|
-
wallet?: {
|
|
20
|
-
address: string;
|
|
21
|
-
blockHeight: number;
|
|
22
|
-
amount: string;
|
|
23
|
-
contract?: string;
|
|
24
|
-
decimals?: number;
|
|
25
|
-
currencyCode: string;
|
|
26
|
-
};
|
|
27
|
-
price?: {
|
|
28
|
-
baseCurrency: string;
|
|
29
|
-
token: string;
|
|
30
|
-
rate: number;
|
|
31
|
-
timestamp: string; // ISO date string
|
|
32
|
-
};
|
|
33
|
-
ping?: {
|
|
34
|
-
blockHeight: number;
|
|
35
|
-
currencyCode: string;
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
context: Context & {
|
|
39
|
-
modules: CryptopayModule;
|
|
40
|
-
},
|
|
41
|
-
) {
|
|
42
|
-
const { modules, services } = context;
|
|
43
|
-
|
|
44
|
-
if (secret !== CRYPTOPAY_SECRET) {
|
|
45
|
-
logger.warn(`webhook called with invalid secret`);
|
|
46
|
-
throw new Error('Secret invalid');
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (wallet) {
|
|
50
|
-
const { address, blockHeight, amount, contract, decimals, currencyCode } = wallet;
|
|
51
|
-
logger.debug('webhook received wallet data', wallet);
|
|
52
|
-
const { orderPaymentId } = await modules.cryptopay.updateWalletAddress({
|
|
53
|
-
address,
|
|
54
|
-
blockHeight,
|
|
55
|
-
amount,
|
|
56
|
-
contract,
|
|
57
|
-
decimals: decimals ?? 0,
|
|
58
|
-
currencyCode,
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
const orderPayment =
|
|
62
|
-
orderPaymentId &&
|
|
63
|
-
(await modules.orders.payments.findOrderPayment({
|
|
64
|
-
orderPaymentId,
|
|
65
|
-
}));
|
|
66
|
-
|
|
67
|
-
if (orderPayment) {
|
|
68
|
-
// Try to process order to next status
|
|
69
|
-
// TODO: Not sure if it's correct to use processOrder here if status is PENDING!
|
|
70
|
-
const order = await modules.orders.findOrder({ orderId: orderPayment.orderId });
|
|
71
|
-
if (order!.status === null) {
|
|
72
|
-
await services.orders.checkoutOrder(order!._id, {});
|
|
73
|
-
} else if (order!.status === OrderStatus.PENDING) {
|
|
74
|
-
await services.orders.processOrder(order!, {});
|
|
75
|
-
} else {
|
|
76
|
-
throw new Error('Already processed');
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (price) {
|
|
82
|
-
logger.debug('webhook received price data', price);
|
|
83
|
-
const { baseCurrency, token, rate, timestamp } = price;
|
|
84
|
-
|
|
85
|
-
const timestampDate = new Date(timestamp);
|
|
86
|
-
const expiresAt = new Date(new Date().getTime() + parseInt(CRYPTOPAY_MAX_RATE_AGE, 10) * 1000);
|
|
87
|
-
|
|
88
|
-
const rateData: ProductPriceRate = {
|
|
89
|
-
baseCurrency,
|
|
90
|
-
quoteCurrency: token,
|
|
91
|
-
rate,
|
|
92
|
-
expiresAt,
|
|
93
|
-
timestamp: timestampDate,
|
|
94
|
-
};
|
|
95
|
-
await modules.products.prices.rates.updateRates([rateData]);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (ping) {
|
|
99
|
-
logger.debug('webhook received ping data', ping);
|
|
100
|
-
const { blockHeight, currencyCode } = ping;
|
|
101
|
-
await modules.cryptopay.updateMostRecentBlock(currencyCode, blockHeight);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { createLogger } from '@unchainedshop/logger';
|
|
2
|
-
import handleWebhook from './handle-webhook.js';
|
|
3
|
-
|
|
4
|
-
const logger = createLogger('unchained:cryptopay:handler');
|
|
5
|
-
|
|
6
|
-
const cryptopayHandler = async (req, res) => {
|
|
7
|
-
if (req.method === 'POST') {
|
|
8
|
-
try {
|
|
9
|
-
await handleWebhook(req.body, req.unchainedContext);
|
|
10
|
-
res.status(200).send({ success: true });
|
|
11
|
-
return;
|
|
12
|
-
} catch (e) {
|
|
13
|
-
logger.error(e);
|
|
14
|
-
res.status(500).send({ success: false, error: e.message });
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
res.status(404).send();
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default cryptopayHandler;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createLogger } from '@unchainedshop/logger';
|
|
2
|
-
import handleWebhook from './handle-webhook.js';
|
|
3
|
-
import { FastifyRequest, RouteHandlerMethod } from 'fastify';
|
|
4
|
-
|
|
5
|
-
const logger = createLogger('unchained:cryptopay:handler');
|
|
6
|
-
|
|
7
|
-
const cryptopayHandler: RouteHandlerMethod = async (
|
|
8
|
-
req: FastifyRequest & {
|
|
9
|
-
unchainedContext: any;
|
|
10
|
-
},
|
|
11
|
-
reply,
|
|
12
|
-
) => {
|
|
13
|
-
try {
|
|
14
|
-
await handleWebhook(req.body as any, req.unchainedContext);
|
|
15
|
-
reply.status(200);
|
|
16
|
-
return reply.send({ success: true });
|
|
17
|
-
} catch (e) {
|
|
18
|
-
logger.error(e);
|
|
19
|
-
reply.status(500);
|
|
20
|
-
return reply.send({ success: false, error: e.message });
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default cryptopayHandler;
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { mongodb } from '@unchainedshop/mongodb';
|
|
2
|
-
import { CryptopayTransaction, CryptopayTransactionsCollection } from './db/CryptopayTransactions.js';
|
|
3
|
-
|
|
4
|
-
const configureCryptopayModule = ({ db }) => {
|
|
5
|
-
const CryptoTransactions = CryptopayTransactionsCollection(db);
|
|
6
|
-
|
|
7
|
-
const getWalletAddress = async (
|
|
8
|
-
address: string,
|
|
9
|
-
contract?: string,
|
|
10
|
-
): Promise<CryptopayTransaction | null> => {
|
|
11
|
-
const addressId = [address, contract].filter(Boolean).join(':');
|
|
12
|
-
return CryptoTransactions.findOne({ _id: addressId });
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const updateMostRecentBlock = async (currencyCode: string, blockHeight: number): Promise<void> => {
|
|
16
|
-
await CryptoTransactions.updateMany(
|
|
17
|
-
{
|
|
18
|
-
currencyCode,
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
$set: {
|
|
22
|
-
mostRecentBlockHeight: blockHeight,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const mapOrderPaymentToWalletAddress = async ({
|
|
29
|
-
address,
|
|
30
|
-
contract,
|
|
31
|
-
currencyCode,
|
|
32
|
-
orderPaymentId,
|
|
33
|
-
}: {
|
|
34
|
-
address: string;
|
|
35
|
-
contract?: string;
|
|
36
|
-
currencyCode: string;
|
|
37
|
-
orderPaymentId: string;
|
|
38
|
-
}): Promise<CryptopayTransaction> => {
|
|
39
|
-
const addressId = [address, contract].filter(Boolean).join(':');
|
|
40
|
-
|
|
41
|
-
return (await CryptoTransactions.findOneAndUpdate(
|
|
42
|
-
{
|
|
43
|
-
_id: addressId,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
$setOnInsert: {
|
|
47
|
-
_id: addressId,
|
|
48
|
-
currencyCode,
|
|
49
|
-
mostRecentBlockHeight: 0,
|
|
50
|
-
blockHeight: 0,
|
|
51
|
-
amount: mongodb.Decimal128.fromString('0'),
|
|
52
|
-
created: new Date(),
|
|
53
|
-
},
|
|
54
|
-
$set: {
|
|
55
|
-
orderPaymentId,
|
|
56
|
-
updated: new Date(),
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
{ upsert: true, returnDocument: 'after' },
|
|
60
|
-
)) as CryptopayTransaction;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const getNextDerivationNumber = async (currencyCode: string): Promise<number> => {
|
|
64
|
-
return (await CryptoTransactions.countDocuments({ currencyCode })) + 1;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const getWalletAddressesByOrderPaymentId = async (
|
|
68
|
-
orderPaymentId: string,
|
|
69
|
-
): Promise<CryptopayTransaction[]> => {
|
|
70
|
-
return CryptoTransactions.find(
|
|
71
|
-
{
|
|
72
|
-
orderPaymentId,
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
sort: {
|
|
76
|
-
created: 1, // Sort by creation date, most recent first
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
).toArray();
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const updateWalletAddress = async ({
|
|
83
|
-
address,
|
|
84
|
-
blockHeight,
|
|
85
|
-
amount,
|
|
86
|
-
contract,
|
|
87
|
-
currencyCode,
|
|
88
|
-
decimals,
|
|
89
|
-
}: {
|
|
90
|
-
address: string;
|
|
91
|
-
blockHeight: number;
|
|
92
|
-
amount: string | number;
|
|
93
|
-
contract?: string;
|
|
94
|
-
currencyCode: string;
|
|
95
|
-
decimals: number;
|
|
96
|
-
}): Promise<CryptopayTransaction> => {
|
|
97
|
-
const addressId = [address, contract].filter(Boolean).join(':');
|
|
98
|
-
return (await CryptoTransactions.findOneAndUpdate(
|
|
99
|
-
{
|
|
100
|
-
_id: addressId,
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
$setOnInsert: {
|
|
104
|
-
_id: addressId,
|
|
105
|
-
created: new Date(),
|
|
106
|
-
},
|
|
107
|
-
$set: {
|
|
108
|
-
currencyCode,
|
|
109
|
-
decimals,
|
|
110
|
-
blockHeight,
|
|
111
|
-
mostRecentBlockHeight: blockHeight,
|
|
112
|
-
amount: mongodb.Decimal128.fromString(typeof amount === 'number' ? `${amount}` : amount),
|
|
113
|
-
updated: new Date(),
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
{ upsert: true, returnDocument: 'after' },
|
|
117
|
-
)) as CryptopayTransaction;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
return {
|
|
121
|
-
getWalletAddress,
|
|
122
|
-
updateMostRecentBlock,
|
|
123
|
-
updateWalletAddress,
|
|
124
|
-
mapOrderPaymentToWalletAddress,
|
|
125
|
-
getNextDerivationNumber,
|
|
126
|
-
getWalletAddressesByOrderPaymentId,
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export default {
|
|
131
|
-
cryptopay: {
|
|
132
|
-
configure: configureCryptopayModule,
|
|
133
|
-
},
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export interface CryptopayModule {
|
|
137
|
-
cryptopay: ReturnType<typeof configureCryptopayModule>;
|
|
138
|
-
}
|
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IPaymentAdapter,
|
|
3
|
-
PaymentAdapter,
|
|
4
|
-
PaymentDirector,
|
|
5
|
-
PaymentError,
|
|
6
|
-
OrderPricingSheet,
|
|
7
|
-
} from '@unchainedshop/core';
|
|
8
|
-
import { createLogger } from '@unchainedshop/logger';
|
|
9
|
-
|
|
10
|
-
import { CryptopayModule } from './module.js';
|
|
11
|
-
import deriveBtcAddress from './derive-btc-address.js';
|
|
12
|
-
import deriveEthAddress from './derive-eth-address.js';
|
|
13
|
-
import denoteAmount from './denote-amount.js';
|
|
14
|
-
|
|
15
|
-
const logger = createLogger('unchained:cryptopay');
|
|
16
|
-
|
|
17
|
-
const { CRYPTOPAY_SECRET, CRYPTOPAY_BTC_XPUB, CRYPTOPAY_ETH_XPUB } = process.env;
|
|
18
|
-
|
|
19
|
-
enum CryptopayCurrencies {
|
|
20
|
-
BTC = 'BTC',
|
|
21
|
-
ETH = 'ETH',
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface CryptopayAddress {
|
|
25
|
-
currencyCode: CryptopayCurrencies;
|
|
26
|
-
address: string;
|
|
27
|
-
currencyConversionRate?: number;
|
|
28
|
-
currencyConversionExpiryDate?: Date;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const Cryptopay: IPaymentAdapter = {
|
|
32
|
-
...PaymentAdapter,
|
|
33
|
-
|
|
34
|
-
key: 'shop.unchained.payment.cryptopay',
|
|
35
|
-
label: 'Cryptopay',
|
|
36
|
-
version: '1.0.0',
|
|
37
|
-
|
|
38
|
-
typeSupported(type) {
|
|
39
|
-
return type === 'GENERIC';
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
actions: (config, context) => {
|
|
43
|
-
const { modules } = context as typeof context & { modules: CryptopayModule };
|
|
44
|
-
|
|
45
|
-
const setConversionRates = async (currencyCode: string, existingAddresses: any[]) => {
|
|
46
|
-
const originCurrencyObj = await modules.currencies.findCurrency({ isoCode: currencyCode });
|
|
47
|
-
|
|
48
|
-
if (!originCurrencyObj?.isActive) throw new Error('Origin currency is not supported');
|
|
49
|
-
|
|
50
|
-
const updatedAddresses = await Promise.all(
|
|
51
|
-
existingAddresses.map(async (addressData) => {
|
|
52
|
-
const targetCurrencyObj = await modules.currencies.findCurrency({
|
|
53
|
-
isoCode: addressData.currencyCode,
|
|
54
|
-
});
|
|
55
|
-
if (!targetCurrencyObj?.isActive) return null;
|
|
56
|
-
const rateData = await modules.products.prices.rates.getRate(
|
|
57
|
-
originCurrencyObj,
|
|
58
|
-
targetCurrencyObj,
|
|
59
|
-
);
|
|
60
|
-
return {
|
|
61
|
-
...addressData,
|
|
62
|
-
currencyConversionRate: rateData?.rate,
|
|
63
|
-
currencyConversionExpiryDate: rateData?.expiresAt,
|
|
64
|
-
};
|
|
65
|
-
}),
|
|
66
|
-
);
|
|
67
|
-
return updatedAddresses.filter(Boolean);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const updateTransactionsWithOrderPaymentId = async (
|
|
71
|
-
orderPaymentId: string,
|
|
72
|
-
cryptoAddresses: CryptopayAddress[],
|
|
73
|
-
) => {
|
|
74
|
-
for (const cryptoAddress of cryptoAddresses) {
|
|
75
|
-
const { address, currencyCode } = cryptoAddress;
|
|
76
|
-
await modules.cryptopay.mapOrderPaymentToWalletAddress({
|
|
77
|
-
address,
|
|
78
|
-
currencyCode,
|
|
79
|
-
orderPaymentId,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const adapterActions = {
|
|
85
|
-
...PaymentAdapter.actions(config, context),
|
|
86
|
-
|
|
87
|
-
configurationError() {
|
|
88
|
-
if (!CRYPTOPAY_SECRET) {
|
|
89
|
-
return PaymentError.INCOMPLETE_CONFIGURATION;
|
|
90
|
-
}
|
|
91
|
-
if (!CRYPTOPAY_BTC_XPUB && !CRYPTOPAY_ETH_XPUB) {
|
|
92
|
-
return PaymentError.INCOMPLETE_CONFIGURATION;
|
|
93
|
-
}
|
|
94
|
-
return null;
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
isActive() {
|
|
98
|
-
// Only support orders that have prices in BTC or ETH for the moment
|
|
99
|
-
if (adapterActions.configurationError() !== null) return false;
|
|
100
|
-
if (!context.order) return true;
|
|
101
|
-
// if (
|
|
102
|
-
// !Object.values(CryptopayCurrencies).includes(
|
|
103
|
-
// context.order.currencyCode as CryptopayCurrencies,
|
|
104
|
-
// )
|
|
105
|
-
// )
|
|
106
|
-
// return false;
|
|
107
|
-
return true;
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
isPayLaterAllowed() {
|
|
111
|
-
return false;
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
sign: async () => {
|
|
115
|
-
const { orderPayment, order } = context;
|
|
116
|
-
if (!orderPayment)
|
|
117
|
-
throw new Error('Payment Credential Registration is not yet supported for Cryptopay');
|
|
118
|
-
|
|
119
|
-
if (!order) throw new Error('Order context is required for signing with Cryptopay');
|
|
120
|
-
|
|
121
|
-
const existingAddresses = await modules.cryptopay.getWalletAddressesByOrderPaymentId(
|
|
122
|
-
orderPayment._id,
|
|
123
|
-
);
|
|
124
|
-
if (existingAddresses.length) {
|
|
125
|
-
// Do not derive addresses a second time for order payment, return existing addresses
|
|
126
|
-
const existingAddressesWithNewExpiration = await setConversionRates(
|
|
127
|
-
order.currencyCode,
|
|
128
|
-
existingAddresses.map(
|
|
129
|
-
({ _id, currencyCode }) =>
|
|
130
|
-
({
|
|
131
|
-
address: _id,
|
|
132
|
-
currencyCode,
|
|
133
|
-
}) as CryptopayAddress,
|
|
134
|
-
),
|
|
135
|
-
);
|
|
136
|
-
return JSON.stringify(existingAddressesWithNewExpiration);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const cryptoAddresses: CryptopayAddress[] = [];
|
|
140
|
-
if (CRYPTOPAY_BTC_XPUB) {
|
|
141
|
-
const btcDerivationNumber = await modules.cryptopay.getNextDerivationNumber(
|
|
142
|
-
CryptopayCurrencies.BTC,
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
const address = deriveBtcAddress(CRYPTOPAY_BTC_XPUB, btcDerivationNumber);
|
|
146
|
-
cryptoAddresses.push({
|
|
147
|
-
currencyCode: CryptopayCurrencies.BTC,
|
|
148
|
-
address,
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
if (CRYPTOPAY_ETH_XPUB) {
|
|
152
|
-
const ethDerivationNumber = await modules.cryptopay.getNextDerivationNumber(
|
|
153
|
-
CryptopayCurrencies.ETH,
|
|
154
|
-
);
|
|
155
|
-
|
|
156
|
-
const address = deriveEthAddress(CRYPTOPAY_ETH_XPUB, ethDerivationNumber);
|
|
157
|
-
cryptoAddresses.push({
|
|
158
|
-
currencyCode: CryptopayCurrencies.ETH,
|
|
159
|
-
address,
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
const cryptoAddressesWithExpiration = await setConversionRates(
|
|
164
|
-
order.currencyCode,
|
|
165
|
-
cryptoAddresses,
|
|
166
|
-
);
|
|
167
|
-
await updateTransactionsWithOrderPaymentId(orderPayment._id, cryptoAddresses);
|
|
168
|
-
return JSON.stringify(cryptoAddressesWithExpiration);
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
charge: async () => {
|
|
172
|
-
const { order, orderPayment } = context;
|
|
173
|
-
|
|
174
|
-
if (!orderPayment)
|
|
175
|
-
throw new Error('Order Payment context is required for charging with Cryptopay');
|
|
176
|
-
|
|
177
|
-
if (!order) throw new Error('Order context is required for charging with Cryptopay');
|
|
178
|
-
|
|
179
|
-
const foundWalletsWithBalances = await modules.cryptopay.getWalletAddressesByOrderPaymentId(
|
|
180
|
-
orderPayment._id,
|
|
181
|
-
);
|
|
182
|
-
|
|
183
|
-
const walletForOrderPayment = foundWalletsWithBalances.find(
|
|
184
|
-
(wallet) => BigInt(wallet.amount.toString()) > 0n,
|
|
185
|
-
);
|
|
186
|
-
|
|
187
|
-
const pricing = OrderPricingSheet({
|
|
188
|
-
calculation: order.calculation,
|
|
189
|
-
currencyCode: order.currencyCode,
|
|
190
|
-
});
|
|
191
|
-
const totalAmount = BigInt(pricing?.total({ useNetPrice: false }).amount);
|
|
192
|
-
|
|
193
|
-
if (walletForOrderPayment && walletForOrderPayment.currencyCode !== order.currencyCode) {
|
|
194
|
-
const baseCurrency = await modules.currencies.findCurrency({
|
|
195
|
-
isoCode: walletForOrderPayment.currencyCode,
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
if (!baseCurrency) throw new Error('Base currency not found');
|
|
199
|
-
|
|
200
|
-
const quoteCurrency = await modules.currencies.findCurrency({ isoCode: order.currencyCode });
|
|
201
|
-
|
|
202
|
-
if (!quoteCurrency) throw new Error('Quote currency not found');
|
|
203
|
-
|
|
204
|
-
const rate = await modules.products.prices.rates.getRateRange(
|
|
205
|
-
baseCurrency,
|
|
206
|
-
quoteCurrency,
|
|
207
|
-
order.confirmed || new Date(),
|
|
208
|
-
);
|
|
209
|
-
|
|
210
|
-
if (!rate) throw new Error('No conversion rate found');
|
|
211
|
-
|
|
212
|
-
const convertedAmount = denoteAmount(
|
|
213
|
-
walletForOrderPayment.amount.toString(),
|
|
214
|
-
walletForOrderPayment.decimals,
|
|
215
|
-
);
|
|
216
|
-
|
|
217
|
-
// Add a Promille 🍻
|
|
218
|
-
// const minAmount = parseFloat(convertedAmount.toString()) * min * 0.999;
|
|
219
|
-
const maxAmount = parseFloat(convertedAmount.toString()) * rate.max * 1.001;
|
|
220
|
-
|
|
221
|
-
if (maxAmount && maxAmount >= totalAmount) {
|
|
222
|
-
// Enough sent
|
|
223
|
-
return {
|
|
224
|
-
transactionId: walletForOrderPayment._id,
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
logger.info(
|
|
228
|
-
`Cryptopay Plugin: Wallet ${walletForOrderPayment._id} balance too low (yet): ${maxAmount} < ${totalAmount}`,
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
if (walletForOrderPayment) {
|
|
233
|
-
const convertedAmount = denoteAmount(
|
|
234
|
-
walletForOrderPayment.amount.toString(),
|
|
235
|
-
walletForOrderPayment.decimals,
|
|
236
|
-
);
|
|
237
|
-
|
|
238
|
-
if (convertedAmount && convertedAmount >= totalAmount) {
|
|
239
|
-
return {
|
|
240
|
-
transactionId: walletForOrderPayment._id,
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
logger.info(
|
|
244
|
-
`Cryptopay Plugin: Wallet ${walletForOrderPayment._id} balance too low (yet): ${convertedAmount} < ${totalAmount}`,
|
|
245
|
-
);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
logger.info(
|
|
249
|
-
`Cryptopay Plugin: No confirmed payments found for currency ${
|
|
250
|
-
order.currencyCode
|
|
251
|
-
} and addresses ${JSON.stringify(foundWalletsWithBalances)}`,
|
|
252
|
-
);
|
|
253
|
-
|
|
254
|
-
/* TODO: Crypto Handling
|
|
255
|
-
|
|
256
|
-
1. Check that generated crypto addresses are unique and no order payments share the same crypto address, only repeat when derivations completely exhausted.
|
|
257
|
-
2. When derivation path get's close to "exhaustedness" (95%), send a special e-mail alert to tell the user should generate a new xpub.
|
|
258
|
-
3. Extend the handler to report the highest seen block number so we can calculate confirmations,
|
|
259
|
-
4. Order rejection should trigger an e-mail advising the vendor to actively send back funds
|
|
260
|
-
|
|
261
|
-
To allow paying in ETH or BTC or Tokens for CHF orders, it should work like this:
|
|
262
|
-
- When signing, we convert with what we have, if we can convert, fine, if we can't we throw an error at the client. The found rate id will be stored together with a signature of the order total + currency + an expiration date in a special collection
|
|
263
|
-
- We also return that signed payload to the client so the client can show something like Total: CHF 50.- "Pay 0.0024 BTC in the next 30 minutes"
|
|
264
|
-
- When a payment occured, the charge function of the plugin picks up. If it can find a valid signed converted amount in the special collection, it will use that information instead of the order total to compare against.
|
|
265
|
-
- When a payment occured to late, the order payment will not be marked as paid and a report will be sent to the vendor that with information about how much to send back.
|
|
266
|
-
|
|
267
|
-
Refunds have to be 2nd priority:
|
|
268
|
-
For every case where we should "send back" money to someone, it get's difficult because we don't own the private key. On ETH, we could use permit/approve with web3 to get the permission to send those funds back. On BTC, we could use lightning invoices for the refunds but that will be fuckin compley anyway.
|
|
269
|
-
|
|
270
|
-
*/
|
|
271
|
-
|
|
272
|
-
return false;
|
|
273
|
-
},
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
return adapterActions;
|
|
277
|
-
},
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
PaymentDirector.registerAdapter(Cryptopay);
|
|
281
|
-
|
|
282
|
-
export default Cryptopay;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Cryptopay
|
|
2
|
-
|
|
3
|
-
curl -X POST http://localhost:4010/payment/cryptopay -d '{ "secret": "secret", "address": "0xF5F72AE7fa1fa990ebaF163208Ed7aD6a3f42DEA", "blockHeight": 7469853, "amount": "50000000000000000", "decimals": 18, "currency": "ETH"}' -H 'Content-Type: application/json'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## HD Key Requirements
|
|
7
|
-
|
|
8
|
-
Using HD keys allows us to generate "child-keys" for every payment. This helps us link payments to checkouts and improves privacy of the vendor as we don't expose the grand total of revenue the vendor makes on the blockchain directly.
|
|
9
|
-
|
|
10
|
-
**Bitcoin:**
|
|
11
|
-
For the extended HD key we only support native segwit (zpub) format, so if you have a ypub for example, use this tool here to make it the correct format:
|
|
12
|
-
|
|
13
|
-
https://3rditeration.github.io/btc-extended-key-converter/
|
|
14
|
-
|
|
15
|
-
**Ethereum:**
|
|
16
|
-
For the extended HD key we need an extended public key using the discussed derivation path here:
|
|
17
|
-
https://github.com/ethereum/EIPs/issues/84
|
|
18
|
-
https://github.com/satoshilabs/slips/blob/master/slip-0044.md
|
|
19
|
-
|
|
20
|
-
Thus, we are deriving child keys the Metamask way:
|
|
21
|
-
m/44'/60'/0'/0/0
|
|
22
|
-
m/44'/60'/0'/0/1
|
|
23
|
-
m/44'/60'/0'/0/...
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// https://api-reference.datatrans.ch/#operation/Authorize
|
|
2
|
-
|
|
3
|
-
import { FetchDatatransFn, AuthorizeRequestPayload, AuthorizeResponse } from './types.js';
|
|
4
|
-
|
|
5
|
-
export default async function authorize({
|
|
6
|
-
...payload
|
|
7
|
-
}: AuthorizeRequestPayload): Promise<AuthorizeResponse> {
|
|
8
|
-
const reqBody = {
|
|
9
|
-
...payload,
|
|
10
|
-
autoSettle: false,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const { fetchDatatrans }: { fetchDatatrans: FetchDatatransFn } = this;
|
|
14
|
-
const result = await fetchDatatrans('/v1/transactions/authorize', reqBody);
|
|
15
|
-
const json = await result.json();
|
|
16
|
-
return json;
|
|
17
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FetchDatatransFn,
|
|
3
|
-
AuthorizeAuthenticatedRequestPayload,
|
|
4
|
-
AuthorizeAuthenticatedResponse,
|
|
5
|
-
} from './types.js';
|
|
6
|
-
|
|
7
|
-
export default async function authorizeAuthenticated({
|
|
8
|
-
transactionId,
|
|
9
|
-
...payload
|
|
10
|
-
}: AuthorizeAuthenticatedRequestPayload): Promise<AuthorizeAuthenticatedResponse> {
|
|
11
|
-
const reqBody = {
|
|
12
|
-
...payload,
|
|
13
|
-
autoSettle: false,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const { fetchDatatrans }: { fetchDatatrans: FetchDatatransFn } = this;
|
|
17
|
-
const result = await fetchDatatrans(`/v1/transactions/${transactionId}/authorize`, reqBody);
|
|
18
|
-
const json = await result.json();
|
|
19
|
-
return json;
|
|
20
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FetchDatatransFn, CancelRequestPayload, CancelResponse } from './types.js';
|
|
2
|
-
|
|
3
|
-
export default async function cancel({
|
|
4
|
-
transactionId,
|
|
5
|
-
...payload
|
|
6
|
-
}: CancelRequestPayload): Promise<CancelResponse> {
|
|
7
|
-
const reqBody = payload;
|
|
8
|
-
const { fetchDatatrans }: { fetchDatatrans: FetchDatatransFn } = this;
|
|
9
|
-
const result = await fetchDatatrans(`/v1/transactions/${transactionId}/cancel`, reqBody);
|
|
10
|
-
if (result.status === 204) return true;
|
|
11
|
-
const json = await result.json();
|
|
12
|
-
return json;
|
|
13
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import makeFetcher from './makeFetcher.js';
|
|
2
|
-
import status from './status.js';
|
|
3
|
-
import init from './init.js';
|
|
4
|
-
import secureFields from './secureFields.js';
|
|
5
|
-
import authorize from './authorize.js';
|
|
6
|
-
import validate from './validate.js';
|
|
7
|
-
import settle from './settle.js';
|
|
8
|
-
import cancel from './cancel.js';
|
|
9
|
-
import authorizeAuthenticated from './authorizeAuthenticated.js';
|
|
10
|
-
|
|
11
|
-
export default function createDatatransAPI(endpoint: string, merchantId: string, secret: string) {
|
|
12
|
-
const fetchDatatrans = makeFetcher(endpoint, merchantId, secret);
|
|
13
|
-
return {
|
|
14
|
-
fetchDatatrans,
|
|
15
|
-
init,
|
|
16
|
-
authorize,
|
|
17
|
-
validate,
|
|
18
|
-
secureFields,
|
|
19
|
-
status,
|
|
20
|
-
authorizeAuthenticated,
|
|
21
|
-
settle,
|
|
22
|
-
cancel,
|
|
23
|
-
};
|
|
24
|
-
}
|