@unchainedshop/plugins 4.3.4 → 4.4.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 +7 -2
- 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 +3 -6
- 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 +1 -2
- 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 +0 -1
- 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 +1 -3
- package/lib/worker/update-ecb-rates.d.ts +0 -1
- package/lib/worker/update-ecb-rates.js +0 -3
- package/lib/worker/update-token-ownership.d.ts +1 -2
- package/lib/worker/update-token-ownership.js +0 -1
- package/lib/worker/zombie-killer.d.ts +1 -2
- package/lib/worker/zombie-killer.js +0 -7
- package/package.json +20 -19
- 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 -44
- 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,43 +0,0 @@
|
|
|
1
|
-
// https://api-reference.datatrans.ch/#operation/init
|
|
2
|
-
import getPaths from '../getPaths.js';
|
|
3
|
-
|
|
4
|
-
import { FetchDatatransFn, InitRequestPayload, InitResponse } from './types.js';
|
|
5
|
-
|
|
6
|
-
const defaultRedirect = getPaths();
|
|
7
|
-
|
|
8
|
-
export default async function init({
|
|
9
|
-
option,
|
|
10
|
-
redirect: userRedirect,
|
|
11
|
-
...payload
|
|
12
|
-
}: InitRequestPayload): Promise<InitResponse> {
|
|
13
|
-
const redirect = {
|
|
14
|
-
...defaultRedirect,
|
|
15
|
-
...(userRedirect || {}),
|
|
16
|
-
} as Partial<typeof defaultRedirect>;
|
|
17
|
-
delete redirect?.postUrl;
|
|
18
|
-
delete redirect?.returnUrl;
|
|
19
|
-
|
|
20
|
-
const reqBody = {
|
|
21
|
-
...payload,
|
|
22
|
-
autoSettle: false,
|
|
23
|
-
option: {
|
|
24
|
-
createAlias: true,
|
|
25
|
-
returnCustomerCountry: true,
|
|
26
|
-
...(option || {}), // allow to overturn the options above
|
|
27
|
-
authenticationOnly: false,
|
|
28
|
-
},
|
|
29
|
-
redirect,
|
|
30
|
-
webhook: {
|
|
31
|
-
url: defaultRedirect.postUrl,
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const { fetchDatatrans }: { fetchDatatrans: FetchDatatransFn } = this;
|
|
36
|
-
const result = await fetchDatatrans('/v1/transactions', reqBody);
|
|
37
|
-
const json = await result.json();
|
|
38
|
-
const location = result.headers?.get('location');
|
|
39
|
-
return {
|
|
40
|
-
location,
|
|
41
|
-
...json,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { createLogger } from '@unchainedshop/logger';
|
|
2
|
-
const { MOCK_APIS } = process.env;
|
|
3
|
-
|
|
4
|
-
const logger = createLogger('unchained:datatrans');
|
|
5
|
-
|
|
6
|
-
export default (
|
|
7
|
-
endpoint: string,
|
|
8
|
-
merchantId: string,
|
|
9
|
-
secret: string,
|
|
10
|
-
): ((path: string, body: unknown) => Promise<Response>) => {
|
|
11
|
-
if (MOCK_APIS) {
|
|
12
|
-
return async (path): Promise<Response> => {
|
|
13
|
-
try {
|
|
14
|
-
const { default: json } = await import(
|
|
15
|
-
`${import.meta.dirname}/../../../../tests/mock/datatrans/${path}.json`,
|
|
16
|
-
{
|
|
17
|
-
with: { type: 'json' },
|
|
18
|
-
}
|
|
19
|
-
);
|
|
20
|
-
return {
|
|
21
|
-
json: async () => json,
|
|
22
|
-
status: json?.error ? 500 : 204,
|
|
23
|
-
} as any;
|
|
24
|
-
} catch (error) {
|
|
25
|
-
logger.error('Mock: Error while trying reading and parsing file', {
|
|
26
|
-
...error,
|
|
27
|
-
});
|
|
28
|
-
return {
|
|
29
|
-
json: async () => ({ error: { code: 'MOCK', message: 'MOCK' } }),
|
|
30
|
-
status: 500,
|
|
31
|
-
} as any;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const token = `${merchantId}:${secret}`;
|
|
37
|
-
|
|
38
|
-
return async (path: string, body: any): Promise<Response> => {
|
|
39
|
-
logger.debug(`Fetch ${endpoint}${path}: ${JSON.stringify(body)}`);
|
|
40
|
-
return fetch(`${endpoint}${path}`, {
|
|
41
|
-
method: body ? 'POST' : 'GET',
|
|
42
|
-
body: body ? JSON.stringify(body) : undefined,
|
|
43
|
-
// eslint-disable-next-line
|
|
44
|
-
// @ts-ignore
|
|
45
|
-
duplex: body ? 'half' : undefined,
|
|
46
|
-
headers: {
|
|
47
|
-
'Content-Type': 'application/json',
|
|
48
|
-
Authorization: `Basic ${Buffer.from(token, 'utf-8').toString('base64')}`,
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// https://api-reference.datatrans.ch/#operation/init
|
|
2
|
-
import getPaths from '../getPaths.js';
|
|
3
|
-
|
|
4
|
-
import { FetchDatatransFn, SecureFieldsRequestPayload, SecureFieldsResponse } from './types.js';
|
|
5
|
-
|
|
6
|
-
const defaultRedirect = getPaths();
|
|
7
|
-
|
|
8
|
-
export default async function secureFields(
|
|
9
|
-
payload: SecureFieldsRequestPayload,
|
|
10
|
-
): Promise<SecureFieldsResponse> {
|
|
11
|
-
const reqBody = {
|
|
12
|
-
returnUrl: defaultRedirect.returnUrl,
|
|
13
|
-
...payload,
|
|
14
|
-
};
|
|
15
|
-
const { fetchDatatrans }: { fetchDatatrans: FetchDatatransFn } = this;
|
|
16
|
-
const result = await fetchDatatrans('/v1/transactions/secureFields', reqBody);
|
|
17
|
-
const json = await result.json();
|
|
18
|
-
return json;
|
|
19
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FetchDatatransFn, SettleRequestPayload, SettleResponse } from './types.js';
|
|
2
|
-
|
|
3
|
-
export default async function settle({
|
|
4
|
-
transactionId,
|
|
5
|
-
...payload
|
|
6
|
-
}: SettleRequestPayload): Promise<SettleResponse> {
|
|
7
|
-
const reqBody = payload;
|
|
8
|
-
const { fetchDatatrans }: { fetchDatatrans: FetchDatatransFn } = this;
|
|
9
|
-
const result = await fetchDatatrans(`/v1/transactions/${transactionId}/settle`, reqBody);
|
|
10
|
-
if (result.status === 204) return true;
|
|
11
|
-
const json = await result.json();
|
|
12
|
-
return json;
|
|
13
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FetchDatatransFn, StatusRequestPayload, StatusResponse } from './types.js';
|
|
2
|
-
|
|
3
|
-
export default async function status({ transactionId }: StatusRequestPayload): Promise<StatusResponse> {
|
|
4
|
-
const { fetchDatatrans }: { fetchDatatrans: FetchDatatransFn } = this;
|
|
5
|
-
const result = await fetchDatatrans(`/v1/transactions/${transactionId}`);
|
|
6
|
-
const json = await result.json();
|
|
7
|
-
return json;
|
|
8
|
-
}
|
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
export interface Address {
|
|
2
|
-
gender?: 'female' | 'male';
|
|
3
|
-
title?: string;
|
|
4
|
-
name?: string;
|
|
5
|
-
firstName?: string;
|
|
6
|
-
lastName?: string;
|
|
7
|
-
email?: string;
|
|
8
|
-
street?: string;
|
|
9
|
-
street2?: string;
|
|
10
|
-
zipCode?: string;
|
|
11
|
-
city?: string;
|
|
12
|
-
countryCode?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type BillingAddress = Address & {
|
|
16
|
-
countrySubdivision?: string;
|
|
17
|
-
sortingCode?: string;
|
|
18
|
-
phoneNumber?: string;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type ShippingAddress = Address & {
|
|
22
|
-
countrySubdivision?: string;
|
|
23
|
-
sortingCode?: string;
|
|
24
|
-
phone?: string;
|
|
25
|
-
cellPhone?: string;
|
|
26
|
-
carrier?: string;
|
|
27
|
-
price?: number;
|
|
28
|
-
priceGross?: number;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export type Customer = Address & {
|
|
32
|
-
id?: string;
|
|
33
|
-
phone?: string;
|
|
34
|
-
cellPhone?: string;
|
|
35
|
-
birthDate?: string; // YYYY-MM-DD
|
|
36
|
-
language?: string;
|
|
37
|
-
type?: 'P' | 'C'; // c = company, companyRegisterNumber + name required
|
|
38
|
-
companyLegalForm?: string;
|
|
39
|
-
companyRegisterNumber?: string;
|
|
40
|
-
ipAddress?: string;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export interface Order {
|
|
44
|
-
articles: Record<string, unknown>;
|
|
45
|
-
taxAmount: number;
|
|
46
|
-
shippingAmount: number;
|
|
47
|
-
discountAmount: number;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface DT2015Configuration {
|
|
51
|
-
brandColor: string;
|
|
52
|
-
textColor: 'white' | 'black';
|
|
53
|
-
logoType: 'circle' | 'rectangle' | 'none';
|
|
54
|
-
logoBorderColor: string;
|
|
55
|
-
brandButton: string;
|
|
56
|
-
payButtonTextColor: string;
|
|
57
|
-
logoSrc: string;
|
|
58
|
-
initialView: 'list' | 'grid';
|
|
59
|
-
brandTitle: string;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export type SupportedLanguage =
|
|
63
|
-
| 'de'
|
|
64
|
-
| 'en'
|
|
65
|
-
| 'fr'
|
|
66
|
-
| 'it'
|
|
67
|
-
| 'es'
|
|
68
|
-
| 'el'
|
|
69
|
-
| 'no'
|
|
70
|
-
| 'da'
|
|
71
|
-
| 'pl'
|
|
72
|
-
| 'pt'
|
|
73
|
-
| 'ru'
|
|
74
|
-
| 'ja';
|
|
75
|
-
|
|
76
|
-
export type PaymentMethod =
|
|
77
|
-
| 'ACC'
|
|
78
|
-
| 'ALP'
|
|
79
|
-
| 'APL'
|
|
80
|
-
| 'AMX'
|
|
81
|
-
| 'AZP'
|
|
82
|
-
| 'BON'
|
|
83
|
-
| 'CFY'
|
|
84
|
-
| 'CSY'
|
|
85
|
-
| 'CUP'
|
|
86
|
-
| 'DIN'
|
|
87
|
-
| 'DII'
|
|
88
|
-
| 'DIB'
|
|
89
|
-
| 'DIS'
|
|
90
|
-
| 'DNK'
|
|
91
|
-
| 'ECA'
|
|
92
|
-
| 'ELV'
|
|
93
|
-
| 'EPS'
|
|
94
|
-
| 'ESY'
|
|
95
|
-
| 'INT'
|
|
96
|
-
| 'JCB'
|
|
97
|
-
| 'JEL'
|
|
98
|
-
| 'KLN'
|
|
99
|
-
| 'MAU'
|
|
100
|
-
| 'MDP'
|
|
101
|
-
| 'MFX'
|
|
102
|
-
| 'MPX'
|
|
103
|
-
| 'MYO'
|
|
104
|
-
| 'PAP'
|
|
105
|
-
| 'PAY'
|
|
106
|
-
| 'PEF'
|
|
107
|
-
| 'PFC'
|
|
108
|
-
| 'PSC'
|
|
109
|
-
| 'REK'
|
|
110
|
-
| 'SAM'
|
|
111
|
-
| 'SWB'
|
|
112
|
-
| 'SCX'
|
|
113
|
-
| 'SWP'
|
|
114
|
-
| 'TWI'
|
|
115
|
-
| 'UAP'
|
|
116
|
-
| 'VIS'
|
|
117
|
-
| 'WEC';
|
|
118
|
-
|
|
119
|
-
export type TransactionType = 'payment' | 'credit' | 'card_check';
|
|
120
|
-
|
|
121
|
-
export type TransactionStatusCode =
|
|
122
|
-
| 'initialized'
|
|
123
|
-
| 'challenge_required'
|
|
124
|
-
| 'challenge_ongoing'
|
|
125
|
-
| 'authenticated'
|
|
126
|
-
| 'authorized'
|
|
127
|
-
| 'settled'
|
|
128
|
-
| 'canceled'
|
|
129
|
-
| 'transmitted'
|
|
130
|
-
| 'failed';
|
|
131
|
-
|
|
132
|
-
export interface ResponseError {
|
|
133
|
-
error: {
|
|
134
|
-
code:
|
|
135
|
-
| 'UNKNOWN_ERROR'
|
|
136
|
-
| 'UNAUTHORIZED'
|
|
137
|
-
| 'INVALID_JSON_PAYLOAD'
|
|
138
|
-
| 'UNRECOGNIZED_PROPERTY'
|
|
139
|
-
| 'INVALID_PROPERTY'
|
|
140
|
-
| 'CLIENT_ERROR'
|
|
141
|
-
| 'SERVER_ERROR'
|
|
142
|
-
| 'INVALID_TRANSACTION_STATUS'
|
|
143
|
-
| 'TRANSACTION_NOT_FOUND'
|
|
144
|
-
| 'EXPIRED_CARD'
|
|
145
|
-
| 'INVALID_CARD'
|
|
146
|
-
| 'BLOCKED_CARD'
|
|
147
|
-
| 'UNSUPPORTED_CARD'
|
|
148
|
-
| 'INVALID_ALIAS'
|
|
149
|
-
| 'INVALID_CVV'
|
|
150
|
-
| 'DUPLICATE_REFNO'
|
|
151
|
-
| 'DECLINED'
|
|
152
|
-
| 'SOFT_DECLINED'
|
|
153
|
-
| 'INVALID_SIGN'
|
|
154
|
-
| 'BLOCKED_BY_VELOCITY_CHECKER'
|
|
155
|
-
| 'THIRD_PARTY_ERROR'
|
|
156
|
-
| 'REFERRAL'
|
|
157
|
-
| 'INVALID_SETUP';
|
|
158
|
-
message: string;
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
interface Split {
|
|
163
|
-
subMerchantId: string;
|
|
164
|
-
amount: number;
|
|
165
|
-
commission: number;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export interface Marketplace {
|
|
169
|
-
splits: Split[];
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export interface InitRequestPayload {
|
|
173
|
-
endpoint: string;
|
|
174
|
-
secret: string;
|
|
175
|
-
merchantId: string;
|
|
176
|
-
currency: string;
|
|
177
|
-
refno: string;
|
|
178
|
-
refno2?: string; // optional
|
|
179
|
-
amount?: number; // omit if only for registration
|
|
180
|
-
customer?: Customer;
|
|
181
|
-
billing?: BillingAddress;
|
|
182
|
-
shipping?: ShippingAddress;
|
|
183
|
-
order?: Order;
|
|
184
|
-
card?: Record<string, unknown>;
|
|
185
|
-
BON?: Record<string, unknown>;
|
|
186
|
-
PAP?: Record<string, unknown>;
|
|
187
|
-
PFC?: Record<string, unknown>;
|
|
188
|
-
REK?: Record<string, unknown>;
|
|
189
|
-
KLN?: Record<string, unknown>;
|
|
190
|
-
TWI?: Record<string, unknown>;
|
|
191
|
-
INT?: Record<string, unknown>;
|
|
192
|
-
ESY?: Record<string, unknown>;
|
|
193
|
-
SWP?: Record<string, unknown>;
|
|
194
|
-
MFX?: Record<string, unknown>;
|
|
195
|
-
MPX?: Record<string, unknown>;
|
|
196
|
-
AZP?: Record<string, unknown>;
|
|
197
|
-
EPS?: Record<string, unknown>;
|
|
198
|
-
ALP?: Record<string, unknown>;
|
|
199
|
-
WEC?: Record<string, unknown>;
|
|
200
|
-
SWB?: Record<string, unknown>;
|
|
201
|
-
MDF?: Record<string, unknown>;
|
|
202
|
-
PSC?: Record<string, unknown>;
|
|
203
|
-
airlineData?: Record<string, unknown>;
|
|
204
|
-
language?: SupportedLanguage;
|
|
205
|
-
paymentMethods?: PaymentMethod[];
|
|
206
|
-
theme?: {
|
|
207
|
-
configuration: DT2015Configuration;
|
|
208
|
-
};
|
|
209
|
-
redirect?: {
|
|
210
|
-
successUrl?: string;
|
|
211
|
-
cancelUrl?: string;
|
|
212
|
-
errorUrl?: string;
|
|
213
|
-
startTarget?: string;
|
|
214
|
-
returnTarget?: string;
|
|
215
|
-
method?: 'GET' | 'POST';
|
|
216
|
-
};
|
|
217
|
-
option?: {
|
|
218
|
-
createAlias?: boolean;
|
|
219
|
-
returnMaskedCardNumber?: boolean;
|
|
220
|
-
returnCustomerCountry?: boolean;
|
|
221
|
-
authenticationOnly?: boolean;
|
|
222
|
-
rememberMe?: 'true' | 'checked';
|
|
223
|
-
returnMobileToken?: boolean;
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
export interface InitResponseSuccess {
|
|
228
|
-
transactionId: string;
|
|
229
|
-
mobileToken?: string;
|
|
230
|
-
WEC?: Record<string, unknown>;
|
|
231
|
-
['3D']?: Record<string, unknown>;
|
|
232
|
-
location?: string;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
export interface StatusRequestPayload {
|
|
236
|
-
transactionId: string;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export interface StatusResponseSuccess {
|
|
240
|
-
transactionId: string;
|
|
241
|
-
type: TransactionType;
|
|
242
|
-
status: TransactionStatusCode;
|
|
243
|
-
currency: string;
|
|
244
|
-
refno: string;
|
|
245
|
-
refno2: string;
|
|
246
|
-
paymentMethod: PaymentMethod;
|
|
247
|
-
detail: Record<string, unknown>;
|
|
248
|
-
customer?: Customer;
|
|
249
|
-
cdm?: Record<string, unknown>;
|
|
250
|
-
language: SupportedLanguage;
|
|
251
|
-
card?: Record<string, unknown>;
|
|
252
|
-
TWI?: Record<string, unknown>;
|
|
253
|
-
PAP?: Record<string, unknown>;
|
|
254
|
-
REK?: Record<string, unknown>;
|
|
255
|
-
ELV?: Record<string, unknown>;
|
|
256
|
-
KLN?: Record<string, unknown>;
|
|
257
|
-
INT?: Record<string, unknown>;
|
|
258
|
-
SWP?: Record<string, unknown>;
|
|
259
|
-
MFX?: Record<string, unknown>;
|
|
260
|
-
MPX?: Record<string, unknown>;
|
|
261
|
-
MDP?: Record<string, unknown>;
|
|
262
|
-
ESY?: Record<string, unknown>;
|
|
263
|
-
PFC?: Record<string, unknown>;
|
|
264
|
-
WEC?: Record<string, unknown>;
|
|
265
|
-
SCX?: Record<string, unknown>;
|
|
266
|
-
history: Record<string, unknown>[];
|
|
267
|
-
ep2?: Record<string, unknown>;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
export interface SecureFieldsRequestPayload {
|
|
271
|
-
currency: string;
|
|
272
|
-
returnUrl?: string;
|
|
273
|
-
amount?: number;
|
|
274
|
-
['3D']?: Record<string, unknown>;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
export interface SecureFieldsResponseSuccess {
|
|
278
|
-
transactionId: string;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
export interface AuthorizeRequestPayload {
|
|
282
|
-
amount: number;
|
|
283
|
-
currency: string;
|
|
284
|
-
refno: string;
|
|
285
|
-
refno2?: string;
|
|
286
|
-
autoSettle?: boolean;
|
|
287
|
-
customer?: Customer;
|
|
288
|
-
billing?: BillingAddress;
|
|
289
|
-
shipping?: ShippingAddress;
|
|
290
|
-
order?: Order;
|
|
291
|
-
card?: Record<string, unknown>;
|
|
292
|
-
BON?: Record<string, unknown>;
|
|
293
|
-
PAP?: Record<string, unknown>;
|
|
294
|
-
PFC?: Record<string, unknown>;
|
|
295
|
-
REK?: Record<string, unknown>;
|
|
296
|
-
KLN?: Record<string, unknown>;
|
|
297
|
-
TWI?: Record<string, unknown>;
|
|
298
|
-
INT?: Record<string, unknown>;
|
|
299
|
-
ESY?: Record<string, unknown>;
|
|
300
|
-
ACC?: Record<string, unknown>;
|
|
301
|
-
PAY?: Record<string, unknown>;
|
|
302
|
-
APL?: Record<string, unknown>;
|
|
303
|
-
SWB?: Record<string, unknown>;
|
|
304
|
-
airlineData?: Record<string, unknown>;
|
|
305
|
-
marketplace?: Marketplace;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
export interface AuthorizeResponseSuccess {
|
|
309
|
-
transactionId: string;
|
|
310
|
-
acquirerAuthorizationCode?: string;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
export interface AuthorizeAuthenticatedRequestPayload {
|
|
314
|
-
transactionId: string;
|
|
315
|
-
refno: string;
|
|
316
|
-
amount?: number;
|
|
317
|
-
currency?: string;
|
|
318
|
-
refno2?: string;
|
|
319
|
-
autoSettle?: boolean;
|
|
320
|
-
CDM?: Record<string, unknown>;
|
|
321
|
-
['3D']?: Record<string, unknown>;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
export interface AuthorizeAuthenticatedResponseSuccess {
|
|
325
|
-
acquirerAuthorizationCode: string;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
export interface ValidateRequestPayload {
|
|
329
|
-
currency: string;
|
|
330
|
-
refno: string;
|
|
331
|
-
refno2?: string;
|
|
332
|
-
card?: Record<string, unknown>;
|
|
333
|
-
PFC?: Record<string, unknown>;
|
|
334
|
-
KLN?: Record<string, unknown>;
|
|
335
|
-
PAP?: Record<string, unknown>;
|
|
336
|
-
PAY?: Record<string, unknown>;
|
|
337
|
-
APL?: Record<string, unknown>;
|
|
338
|
-
ESY?: Record<string, unknown>;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
export interface ValidateResponseSuccess {
|
|
342
|
-
transactionId: string;
|
|
343
|
-
acquirerAuthorizationCode?: string;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
export interface SettleRequestPayload {
|
|
347
|
-
transactionId: string;
|
|
348
|
-
amount: number;
|
|
349
|
-
currency: string;
|
|
350
|
-
refno: string;
|
|
351
|
-
refno2?: string;
|
|
352
|
-
airlineData?: Record<string, unknown>;
|
|
353
|
-
marketplace?: Marketplace;
|
|
354
|
-
extensions?: Record<string, string>;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
export interface CancelRequestPayload {
|
|
358
|
-
transactionId: string;
|
|
359
|
-
refno: string;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
export type InitResponse = InitResponseSuccess | ResponseError;
|
|
363
|
-
|
|
364
|
-
export type SecureFieldsResponse = SecureFieldsResponseSuccess | ResponseError;
|
|
365
|
-
|
|
366
|
-
export type StatusResponse = StatusResponseSuccess | ResponseError;
|
|
367
|
-
|
|
368
|
-
export type AuthorizeResponse = AuthorizeResponseSuccess | ResponseError;
|
|
369
|
-
|
|
370
|
-
export type AuthorizeAuthenticatedResponse = AuthorizeAuthenticatedResponseSuccess | ResponseError;
|
|
371
|
-
|
|
372
|
-
export type ValidateResponse = ValidateResponseSuccess | ResponseError;
|
|
373
|
-
|
|
374
|
-
export type SettleResponse = true | ResponseError;
|
|
375
|
-
|
|
376
|
-
export type CancelResponse = true | ResponseError;
|
|
377
|
-
|
|
378
|
-
export type FetchDatatransFn = (path: string, body?: unknown) => Promise<Response>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FetchDatatransFn, ValidateRequestPayload, ValidateResponse } from './types.js';
|
|
2
|
-
|
|
3
|
-
export default async function validate(payload: ValidateRequestPayload): Promise<ValidateResponse> {
|
|
4
|
-
const { fetchDatatrans }: { fetchDatatrans: FetchDatatransFn } = this;
|
|
5
|
-
|
|
6
|
-
const reqBody = {
|
|
7
|
-
...payload,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const result = await fetchDatatrans(`/v1/transactions/validate`, reqBody);
|
|
11
|
-
const json = await result.json();
|
|
12
|
-
return json;
|
|
13
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
|
-
import assert from 'node:assert';
|
|
3
|
-
import generateSignature from './generateSignature';
|
|
4
|
-
|
|
5
|
-
describe('Datatrans Signature', () => {
|
|
6
|
-
it('Correct hashing applies', async () => {
|
|
7
|
-
const { security, signKey, timestamp, body } = {
|
|
8
|
-
security: 'dynamic-sign' as any,
|
|
9
|
-
signKey: '1337',
|
|
10
|
-
timestamp: '12424123412',
|
|
11
|
-
body: '{"card":{"3D":{"authenticationResponse":"D"},"alias":"70119122433810042","expiryMonth":"12","expiryYear":"21","info":{"brand":"VISA CREDIT","country":"GB","issuer":"DATATRANS","type":"credit","usage":"consumer"},"masked":"424242xxxxxx4242"},"currency":"CHF","detail":{"authorize":{"acquirerAuthorizationCode":"100055"}},"history":[{"action":"init","date":"2021-09-03T08:00:32Z","ip":"212.232.234.26","source":"api","success":true},{"action":"authorize","date":"2021-09-03T08:00:55Z","ip":"212.232.234.26","source":"redirect","success":true}],"language":"de","paymentMethod":"VIS","refno":"1NTU1NQ=","refno2":"user","status":"authorized","transactionId":"card_check_authorized","type":"card_check"}',
|
|
12
|
-
};
|
|
13
|
-
assert.strictEqual(
|
|
14
|
-
await generateSignature({ security, signKey })(timestamp, body),
|
|
15
|
-
'5118c93025fdb16a110cdde3aa7669422da320cfe9478e35b531f45c4619d4db',
|
|
16
|
-
);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export const Security = {
|
|
2
|
-
NONE: '',
|
|
3
|
-
STATIC_SIGN: 'static-sign',
|
|
4
|
-
DYNAMIC_SIGN: 'dynamic-sign',
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
const generateSignature =
|
|
8
|
-
({ security, signKey }: { security: '' | 'static-sign' | 'dynamic-sign'; signKey: string }) =>
|
|
9
|
-
async (...parts) => {
|
|
10
|
-
// https://docs.datatrans.ch/docs/security-sign
|
|
11
|
-
if (security.toLowerCase() === Security.STATIC_SIGN) return signKey;
|
|
12
|
-
if (security.toLowerCase() === Security.NONE) return '';
|
|
13
|
-
|
|
14
|
-
const resultString = parts.filter(Boolean).join('');
|
|
15
|
-
|
|
16
|
-
const signKeyInBytes = Buffer.from(signKey, 'hex');
|
|
17
|
-
|
|
18
|
-
const key = await crypto.subtle.importKey(
|
|
19
|
-
'raw',
|
|
20
|
-
Uint8Array.from(signKeyInBytes),
|
|
21
|
-
{ name: 'HMAC', hash: 'SHA-256' },
|
|
22
|
-
false,
|
|
23
|
-
['sign'],
|
|
24
|
-
);
|
|
25
|
-
const signatureBinary = await crypto.subtle.sign(
|
|
26
|
-
'HMAC',
|
|
27
|
-
key,
|
|
28
|
-
new TextEncoder().encode(resultString),
|
|
29
|
-
);
|
|
30
|
-
const hmacSubtle = Array.from(new Uint8Array(signatureBinary))
|
|
31
|
-
.map((byte) => byte.toString(16).padStart(2, '0'))
|
|
32
|
-
.join('');
|
|
33
|
-
return hmacSubtle;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default generateSignature;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
ROOT_URL,
|
|
3
|
-
EMAIL_WEBSITE_URL,
|
|
4
|
-
DATATRANS_WEBHOOK_PATH = '/payment/datatrans/webhook',
|
|
5
|
-
DATATRANS_SUCCESS_PATH = '/datatrans/success',
|
|
6
|
-
DATATRANS_ERROR_PATH = '/datatrans/error',
|
|
7
|
-
DATATRANS_CANCEL_PATH = '/datatrans/cancel',
|
|
8
|
-
DATATRANS_RETURN_PATH = '/datatrans/return',
|
|
9
|
-
} = process.env;
|
|
10
|
-
|
|
11
|
-
interface Paths {
|
|
12
|
-
postUrl: string;
|
|
13
|
-
cancelUrl: string;
|
|
14
|
-
successUrl: string;
|
|
15
|
-
errorUrl: string;
|
|
16
|
-
returnUrl: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default (): Paths => ({
|
|
20
|
-
postUrl: `${ROOT_URL}${DATATRANS_WEBHOOK_PATH}`,
|
|
21
|
-
successUrl: `${EMAIL_WEBSITE_URL}${DATATRANS_SUCCESS_PATH}`,
|
|
22
|
-
cancelUrl: `${EMAIL_WEBSITE_URL}${DATATRANS_CANCEL_PATH}`,
|
|
23
|
-
errorUrl: `${EMAIL_WEBSITE_URL}${DATATRANS_ERROR_PATH}`,
|
|
24
|
-
returnUrl: `${EMAIL_WEBSITE_URL}${DATATRANS_RETURN_PATH}`,
|
|
25
|
-
});
|