@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,135 +0,0 @@
|
|
|
1
|
-
import { Context } from '@unchainedshop/api';
|
|
2
|
-
import { createLogger } from '@unchainedshop/logger';
|
|
3
|
-
import { stripe } from './stripe.js';
|
|
4
|
-
|
|
5
|
-
const logger = createLogger('unchained:stripe:handler');
|
|
6
|
-
|
|
7
|
-
export const WebhookEventTypes = {
|
|
8
|
-
PAYMENT_INTENT_SUCCEEDED: 'payment_intent.succeeded',
|
|
9
|
-
SETUP_INTENT_SUCCEEDED: 'setup_intent.succeeded',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const stripeHandler = async (request, response) => {
|
|
13
|
-
const resolvedContext = request.unchainedContext as Context;
|
|
14
|
-
const { modules, services } = resolvedContext;
|
|
15
|
-
|
|
16
|
-
let event;
|
|
17
|
-
|
|
18
|
-
try {
|
|
19
|
-
const sig = request.headers['stripe-signature'];
|
|
20
|
-
if (!sig) {
|
|
21
|
-
throw new Error('stripe-signature header was not provided for webhook');
|
|
22
|
-
}
|
|
23
|
-
if (!process.env.STRIPE_ENDPOINT_SECRET) {
|
|
24
|
-
throw new Error('env STRIPE_ENDPOINT_SECRET is required for webhook handling');
|
|
25
|
-
}
|
|
26
|
-
event = stripe.webhooks.constructEvent(request.body, sig, process.env.STRIPE_ENDPOINT_SECRET);
|
|
27
|
-
} catch (err) {
|
|
28
|
-
logger.error(`Error constructing event: ${err.message}`);
|
|
29
|
-
response.status(400).send({
|
|
30
|
-
message: err.message,
|
|
31
|
-
name: err.name,
|
|
32
|
-
});
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (!Object.values(WebhookEventTypes).includes(event.type)) {
|
|
37
|
-
logger.info(`unhandled event type`, {
|
|
38
|
-
type: event.type,
|
|
39
|
-
});
|
|
40
|
-
response.status(200).send({
|
|
41
|
-
ignored: true,
|
|
42
|
-
message: `Unhandled event type: ${event.type}. Supported types: ${Object.values(WebhookEventTypes).join(', ')}`,
|
|
43
|
-
});
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const environmentInMetadata = event.data?.object?.metadata?.environment || '';
|
|
48
|
-
const environmentInEnv = process.env.STRIPE_WEBHOOK_ENVIRONMENT || '';
|
|
49
|
-
if (environmentInMetadata !== environmentInEnv) {
|
|
50
|
-
logger.info(`unhandled event environment`, {
|
|
51
|
-
type: event.type,
|
|
52
|
-
environment: environmentInMetadata,
|
|
53
|
-
});
|
|
54
|
-
response.status(200).send({
|
|
55
|
-
ignored: true,
|
|
56
|
-
message: `Unhandled event environment: ${environmentInMetadata}. Supported environment: ${environmentInEnv}`,
|
|
57
|
-
});
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
logger.info(`Processing event`, {
|
|
62
|
-
type: event.type,
|
|
63
|
-
});
|
|
64
|
-
try {
|
|
65
|
-
if (event.type === WebhookEventTypes.PAYMENT_INTENT_SUCCEEDED) {
|
|
66
|
-
const paymentIntent = event.data.object;
|
|
67
|
-
const { orderPaymentId } = paymentIntent.metadata || {};
|
|
68
|
-
|
|
69
|
-
logger.info(`checkout with orderPaymentId: ${orderPaymentId}`, {
|
|
70
|
-
type: event.type,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
await modules.orders.payments.logEvent(orderPaymentId, event);
|
|
74
|
-
const orderPayment = await modules.orders.payments.findOrderPayment({
|
|
75
|
-
orderPaymentId,
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
if (!orderPayment) {
|
|
79
|
-
throw new Error(`order payment not found with orderPaymentId: ${orderPaymentId}`);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const order = await services.orders.checkoutOrder(orderPayment.orderId, {
|
|
83
|
-
paymentContext: {
|
|
84
|
-
paymentIntentId: paymentIntent.id,
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
if (!order) throw new Error(`Order with id ${orderPayment.orderId} not found`);
|
|
89
|
-
|
|
90
|
-
logger.info(`checkout successful`, {
|
|
91
|
-
orderPaymentId,
|
|
92
|
-
orderId: order._id,
|
|
93
|
-
type: event.type,
|
|
94
|
-
});
|
|
95
|
-
response.status(200).send({
|
|
96
|
-
message: 'checkout successful',
|
|
97
|
-
orderId: order._id,
|
|
98
|
-
});
|
|
99
|
-
} else if (event.type === WebhookEventTypes.SETUP_INTENT_SUCCEEDED) {
|
|
100
|
-
const setupIntent = event.data.object;
|
|
101
|
-
const { paymentProviderId, userId } = setupIntent.metadata || {};
|
|
102
|
-
|
|
103
|
-
logger.info(`registered payment credential with paymentProviderId: ${paymentProviderId}`, {
|
|
104
|
-
type: event.type,
|
|
105
|
-
userId,
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
const paymentCredentials = await services.orders.registerPaymentCredentials(paymentProviderId, {
|
|
109
|
-
transactionContext: {
|
|
110
|
-
setupIntentId: setupIntent.id,
|
|
111
|
-
},
|
|
112
|
-
userId,
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
logger.info(`payment credentials registration successful`, {
|
|
116
|
-
userId,
|
|
117
|
-
paymentProviderId,
|
|
118
|
-
paymentCredentialsId: paymentCredentials?._id,
|
|
119
|
-
type: event.type,
|
|
120
|
-
});
|
|
121
|
-
response.status(200).send({
|
|
122
|
-
message: 'payment credentials registration successful',
|
|
123
|
-
paymentCredentialsId: paymentCredentials?._id,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
} catch (error) {
|
|
127
|
-
logger.error(error, {
|
|
128
|
-
type: event.type,
|
|
129
|
-
});
|
|
130
|
-
response.status(500).send({
|
|
131
|
-
message: error.message,
|
|
132
|
-
name: error.name,
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
};
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { Context } from '@unchainedshop/api';
|
|
2
|
-
import { createLogger } from '@unchainedshop/logger';
|
|
3
|
-
import { FastifyRequest, RouteHandlerMethod } from 'fastify';
|
|
4
|
-
import { stripe } from './stripe.js';
|
|
5
|
-
|
|
6
|
-
const logger = createLogger('unchained:stripe:handler');
|
|
7
|
-
|
|
8
|
-
export const WebhookEventTypes = {
|
|
9
|
-
PAYMENT_INTENT_SUCCEEDED: 'payment_intent.succeeded',
|
|
10
|
-
SETUP_INTENT_SUCCEEDED: 'setup_intent.succeeded',
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const stripeHandler: RouteHandlerMethod = async (
|
|
14
|
-
req: FastifyRequest & {
|
|
15
|
-
unchainedContext: Context;
|
|
16
|
-
},
|
|
17
|
-
reply,
|
|
18
|
-
) => {
|
|
19
|
-
const resolvedContext = req.unchainedContext as Context;
|
|
20
|
-
const { modules, services } = resolvedContext;
|
|
21
|
-
|
|
22
|
-
let event;
|
|
23
|
-
|
|
24
|
-
try {
|
|
25
|
-
const sig = req.headers['stripe-signature'];
|
|
26
|
-
if (!process.env.STRIPE_ENDPOINT_SECRET) {
|
|
27
|
-
throw new Error('env STRIPE_ENDPOINT_SECRET is required for webhook handling');
|
|
28
|
-
}
|
|
29
|
-
if (!sig) {
|
|
30
|
-
throw new Error('stripe-signature header was not provided for webhook');
|
|
31
|
-
}
|
|
32
|
-
event = stripe.webhooks.constructEvent(req.body as string, sig, process.env.STRIPE_ENDPOINT_SECRET);
|
|
33
|
-
} catch (err) {
|
|
34
|
-
logger.error(`Error constructing event: ${err.message}`);
|
|
35
|
-
reply.status(400);
|
|
36
|
-
return reply.send({
|
|
37
|
-
success: false,
|
|
38
|
-
message: err.message,
|
|
39
|
-
name: err.name,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (!Object.values(WebhookEventTypes).includes(event.type)) {
|
|
44
|
-
logger.info(`unhandled event type`, {
|
|
45
|
-
type: event.type,
|
|
46
|
-
});
|
|
47
|
-
reply.status(200);
|
|
48
|
-
return reply.send({
|
|
49
|
-
success: false,
|
|
50
|
-
ignored: true,
|
|
51
|
-
name: 'UNHANDLED_EVENT_TYPE',
|
|
52
|
-
message: `Unhandled event type: ${event.type}. Supported types: ${Object.values(WebhookEventTypes).join(', ')}`,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const environmentInMetadata = event.data?.object?.metadata?.environment || '';
|
|
57
|
-
const environmentInEnv = process.env.STRIPE_WEBHOOK_ENVIRONMENT || '';
|
|
58
|
-
if (environmentInMetadata !== environmentInEnv) {
|
|
59
|
-
logger.info(`unhandled event environment`, {
|
|
60
|
-
type: event.type,
|
|
61
|
-
environment: environmentInMetadata,
|
|
62
|
-
});
|
|
63
|
-
reply.status(200);
|
|
64
|
-
return reply.send({
|
|
65
|
-
success: false,
|
|
66
|
-
ignored: true,
|
|
67
|
-
name: 'UNHANDLED_EVENT_ENVIRONMENT',
|
|
68
|
-
message: `Unhandled event environment: ${environmentInMetadata}. Supported environment: ${environmentInEnv}`,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
logger.info(`Processing event`, {
|
|
73
|
-
type: event.type,
|
|
74
|
-
});
|
|
75
|
-
try {
|
|
76
|
-
if (event.type === WebhookEventTypes.PAYMENT_INTENT_SUCCEEDED) {
|
|
77
|
-
const paymentIntent = event.data.object;
|
|
78
|
-
const { orderPaymentId } = paymentIntent.metadata || {};
|
|
79
|
-
|
|
80
|
-
logger.info(`checkout with orderPaymentId: ${orderPaymentId}`, {
|
|
81
|
-
type: event.type,
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
await modules.orders.payments.logEvent(orderPaymentId, event);
|
|
85
|
-
const orderPayment = await modules.orders.payments.findOrderPayment({
|
|
86
|
-
orderPaymentId,
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
if (!orderPayment) {
|
|
90
|
-
throw new Error(`order payment not found with orderPaymentId: ${orderPaymentId}`);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const order = await services.orders.checkoutOrder(orderPayment.orderId, {
|
|
94
|
-
paymentContext: {
|
|
95
|
-
paymentIntentId: paymentIntent.id,
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
if (!order) throw new Error(`Order with id ${orderPayment.orderId} not found`);
|
|
100
|
-
|
|
101
|
-
logger.info(`checkout successful`, {
|
|
102
|
-
orderPaymentId,
|
|
103
|
-
orderId: order._id,
|
|
104
|
-
type: event.type,
|
|
105
|
-
});
|
|
106
|
-
reply.status(200);
|
|
107
|
-
return reply.send({
|
|
108
|
-
success: true,
|
|
109
|
-
orderId: order._id,
|
|
110
|
-
});
|
|
111
|
-
} else if (event.type === WebhookEventTypes.SETUP_INTENT_SUCCEEDED) {
|
|
112
|
-
const setupIntent = event.data.object;
|
|
113
|
-
const { paymentProviderId, userId } = setupIntent.metadata || {};
|
|
114
|
-
|
|
115
|
-
logger.info(`registered payment credential with paymentProviderId: ${paymentProviderId}`, {
|
|
116
|
-
type: event.type,
|
|
117
|
-
userId,
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
const paymentCredentials = await services.orders.registerPaymentCredentials(paymentProviderId, {
|
|
121
|
-
transactionContext: {
|
|
122
|
-
setupIntentId: setupIntent.id,
|
|
123
|
-
},
|
|
124
|
-
userId,
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
logger.info(`payment credentials registration successful`, {
|
|
128
|
-
userId,
|
|
129
|
-
paymentProviderId,
|
|
130
|
-
paymentCredentialsId: paymentCredentials?._id,
|
|
131
|
-
type: event.type,
|
|
132
|
-
});
|
|
133
|
-
reply.status(200);
|
|
134
|
-
return reply.send({
|
|
135
|
-
success: true,
|
|
136
|
-
message: 'payment credentials registration successful',
|
|
137
|
-
paymentCredentialsId: paymentCredentials?._id,
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
} catch (error) {
|
|
141
|
-
logger.error(error, {
|
|
142
|
-
type: event.type,
|
|
143
|
-
});
|
|
144
|
-
reply.status(500);
|
|
145
|
-
return reply.send({
|
|
146
|
-
success: false,
|
|
147
|
-
message: error.message,
|
|
148
|
-
name: error.name,
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
};
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { createLogger } from '@unchainedshop/logger';
|
|
2
|
-
import { stripe, createOrderPaymentIntent, createRegistrationIntent } from './stripe.js';
|
|
3
|
-
import {
|
|
4
|
-
OrderPricingSheet,
|
|
5
|
-
IPaymentAdapter,
|
|
6
|
-
PaymentAdapter,
|
|
7
|
-
PaymentDirector,
|
|
8
|
-
PaymentError,
|
|
9
|
-
} from '@unchainedshop/core';
|
|
10
|
-
|
|
11
|
-
const logger = createLogger('unchained:stripe');
|
|
12
|
-
|
|
13
|
-
const Stripe: IPaymentAdapter = {
|
|
14
|
-
...PaymentAdapter,
|
|
15
|
-
|
|
16
|
-
key: 'shop.unchained.payment.stripe',
|
|
17
|
-
label: 'Stripe',
|
|
18
|
-
version: '2.0.0',
|
|
19
|
-
|
|
20
|
-
typeSupported(type) {
|
|
21
|
-
return type === 'GENERIC';
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
actions: (config, context) => {
|
|
25
|
-
const { modules } = context;
|
|
26
|
-
|
|
27
|
-
const descriptorPrefix = config.find(({ key }) => key === 'descriptorPrefix')?.value || '';
|
|
28
|
-
|
|
29
|
-
const assertUserData = async (forcedUserId) => {
|
|
30
|
-
const userId = forcedUserId || context?.userId;
|
|
31
|
-
const user = await modules.users.findUserById(userId);
|
|
32
|
-
if (!user) throw new Error('User not found');
|
|
33
|
-
const email = modules.users.primaryEmail(user)?.address;
|
|
34
|
-
const name = user.profile?.displayName || user.username || email;
|
|
35
|
-
return {
|
|
36
|
-
email,
|
|
37
|
-
name,
|
|
38
|
-
userId,
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
const adapterActions = {
|
|
42
|
-
...PaymentAdapter.actions(config, context),
|
|
43
|
-
|
|
44
|
-
configurationError() {
|
|
45
|
-
if (!stripe) return PaymentError.INCOMPLETE_CONFIGURATION;
|
|
46
|
-
return null;
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
isActive: () => {
|
|
50
|
-
if (adapterActions.configurationError() === null) return true;
|
|
51
|
-
return false;
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
isPayLaterAllowed() {
|
|
55
|
-
return false;
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
validate: async ({ token }) => {
|
|
59
|
-
const paymentMethod = await stripe.paymentMethods.retrieve(token);
|
|
60
|
-
return !!paymentMethod;
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
register: async ({ setupIntentId }) => {
|
|
64
|
-
if (!setupIntentId) {
|
|
65
|
-
throw new Error('You have to provide a setupIntentId');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const setupIntent = await stripe.setupIntents.retrieve(setupIntentId);
|
|
69
|
-
if (setupIntent.status === 'succeeded') {
|
|
70
|
-
return {
|
|
71
|
-
token: setupIntent.payment_method,
|
|
72
|
-
customer: setupIntent.customer,
|
|
73
|
-
// payment_method_options: setupIntent.payment_method_options,
|
|
74
|
-
payment_method_types: setupIntent.payment_method_types,
|
|
75
|
-
usage: setupIntent.usage,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
logger.warn('Registration declined', setupIntentId);
|
|
80
|
-
return null;
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
sign: async (transactionContext = {}) => {
|
|
84
|
-
const { orderPayment, order, paymentProvider } = context;
|
|
85
|
-
const { userId, name, email } = await assertUserData(order?.userId);
|
|
86
|
-
if (orderPayment) {
|
|
87
|
-
if (!order) throw new Error('order not found in context');
|
|
88
|
-
const pricing = OrderPricingSheet({
|
|
89
|
-
calculation: order?.calculation,
|
|
90
|
-
currencyCode: order?.currencyCode,
|
|
91
|
-
});
|
|
92
|
-
const paymentIntent = await createOrderPaymentIntent(
|
|
93
|
-
{ userId, name, email, order, orderPayment, pricing, descriptorPrefix },
|
|
94
|
-
transactionContext,
|
|
95
|
-
);
|
|
96
|
-
return paymentIntent.client_secret;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const paymentIntent = await createRegistrationIntent(
|
|
100
|
-
{ userId, name, email, paymentProviderId: paymentProvider._id, descriptorPrefix },
|
|
101
|
-
transactionContext,
|
|
102
|
-
);
|
|
103
|
-
return paymentIntent.client_secret;
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
charge: async ({ paymentIntentId, paymentCredentials }) => {
|
|
107
|
-
if (!paymentIntentId && !paymentCredentials) {
|
|
108
|
-
throw new Error('You have to provide paymentIntentId or paymentCredentials');
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const { order, orderPayment } = context;
|
|
112
|
-
|
|
113
|
-
if (!order) throw new Error('order not found in context');
|
|
114
|
-
if (!orderPayment) throw new Error('orderPayment not found in context');
|
|
115
|
-
|
|
116
|
-
const { userId, name, email } = await assertUserData(order?.userId);
|
|
117
|
-
const pricing = OrderPricingSheet({
|
|
118
|
-
calculation: order.calculation,
|
|
119
|
-
currencyCode: order.currencyCode,
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
const paymentIntentObject = paymentIntentId
|
|
123
|
-
? await stripe.paymentIntents.retrieve(paymentIntentId)
|
|
124
|
-
: await createOrderPaymentIntent(
|
|
125
|
-
{ userId, name, email, orderPayment, order, pricing, descriptorPrefix },
|
|
126
|
-
{
|
|
127
|
-
customer: paymentCredentials.meta?.customer,
|
|
128
|
-
confirm: true,
|
|
129
|
-
payment_method: paymentCredentials.token,
|
|
130
|
-
payment_method_types: paymentCredentials.meta?.payment_method_types,
|
|
131
|
-
// payment_method_options: paymentCredentials.meta?.payment_method_options, // eslint-disable-line
|
|
132
|
-
},
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
const { currencyCode, amount } = pricing.total({ useNetPrice: false });
|
|
136
|
-
|
|
137
|
-
if (
|
|
138
|
-
paymentIntentObject.currency !== currencyCode.toLowerCase() ||
|
|
139
|
-
paymentIntentObject.amount !== Math.round(amount)
|
|
140
|
-
) {
|
|
141
|
-
throw new Error('The price has changed since the intent has been created');
|
|
142
|
-
}
|
|
143
|
-
if (paymentIntentObject.metadata?.orderPaymentId !== orderPayment?._id) {
|
|
144
|
-
throw new Error('The order payment is different from the initiating intent');
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (paymentIntentObject.status === 'succeeded') {
|
|
148
|
-
return paymentIntentObject;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
logger.info('Charge postponed because paymentIntent has wrong status', {
|
|
152
|
-
orderPaymentId: paymentIntentObject.id,
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
return false;
|
|
156
|
-
},
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
return adapterActions;
|
|
160
|
-
},
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
PaymentDirector.registerAdapter(Stripe);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
## Test Webhooks:
|
|
2
|
-
|
|
3
|
-
```
|
|
4
|
-
brew install stripe/stripe-cli/stripe
|
|
5
|
-
stripe login --api-key sk_....
|
|
6
|
-
stripe listen --forward-to http://localhost:4010/payment/stripe
|
|
7
|
-
stripe trigger payment_intent.succeeded
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
## Configure the Payment Statements:
|
|
11
|
-
|
|
12
|
-
Payment Provider configuration: `[{ key: "descriptorPrefix", value: "Book Shop" }]`
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import type { Stripe } from 'stripe';
|
|
2
|
-
import type { IOrderPricingSheet } from '@unchainedshop/core';
|
|
3
|
-
import { Order, OrderPayment } from '@unchainedshop/core-orders';
|
|
4
|
-
import { createLogger } from '@unchainedshop/logger';
|
|
5
|
-
|
|
6
|
-
const logger = createLogger('unchained:stripe');
|
|
7
|
-
|
|
8
|
-
const { STRIPE_SECRET, STRIPE_WEBHOOK_ENVIRONMENT, EMAIL_WEBSITE_NAME } = process.env;
|
|
9
|
-
|
|
10
|
-
export let stripe: Stripe;
|
|
11
|
-
const environment = STRIPE_WEBHOOK_ENVIRONMENT ?? null;
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
if (!STRIPE_SECRET) {
|
|
15
|
-
logger.warn('STRIPE_SECRET is not set, skipping initialization');
|
|
16
|
-
}
|
|
17
|
-
const { default: Stripe } = await import('stripe');
|
|
18
|
-
stripe = new Stripe(STRIPE_SECRET as string, {
|
|
19
|
-
apiVersion: '2025-11-17.clover',
|
|
20
|
-
});
|
|
21
|
-
} catch {
|
|
22
|
-
logger.warn(`optional peer npm package 'stripe' not installed, stripe adapter will not work`);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const upsertCustomer = async ({ userId, name, email }): Promise<string> => {
|
|
26
|
-
try {
|
|
27
|
-
const { data } = await stripe.customers.search({ query: `metadata["userId"]:"${userId}"` });
|
|
28
|
-
const existingCustomer = data[0];
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
existingCustomer.name !== name ||
|
|
32
|
-
existingCustomer.email !== email ||
|
|
33
|
-
existingCustomer.metadata.environment !== environment
|
|
34
|
-
) {
|
|
35
|
-
const updatedCustomer = await stripe.customers.update(existingCustomer.id, {
|
|
36
|
-
metadata: {
|
|
37
|
-
userId,
|
|
38
|
-
environment,
|
|
39
|
-
},
|
|
40
|
-
name,
|
|
41
|
-
email,
|
|
42
|
-
});
|
|
43
|
-
return updatedCustomer.id;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return existingCustomer.id;
|
|
47
|
-
} catch {
|
|
48
|
-
const customer = await stripe.customers.create({
|
|
49
|
-
metadata: {
|
|
50
|
-
userId,
|
|
51
|
-
environment: STRIPE_WEBHOOK_ENVIRONMENT ?? null,
|
|
52
|
-
},
|
|
53
|
-
name,
|
|
54
|
-
email,
|
|
55
|
-
});
|
|
56
|
-
return customer.id;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export const createRegistrationIntent = async (
|
|
61
|
-
{
|
|
62
|
-
userId,
|
|
63
|
-
name,
|
|
64
|
-
email,
|
|
65
|
-
paymentProviderId,
|
|
66
|
-
descriptorPrefix,
|
|
67
|
-
}: {
|
|
68
|
-
userId: string;
|
|
69
|
-
name: string;
|
|
70
|
-
email: string;
|
|
71
|
-
paymentProviderId: string;
|
|
72
|
-
descriptorPrefix?: string;
|
|
73
|
-
},
|
|
74
|
-
options: Record<string, any> = {},
|
|
75
|
-
) => {
|
|
76
|
-
const customer = options?.customer || (await upsertCustomer({ userId, name, email }));
|
|
77
|
-
const description =
|
|
78
|
-
`${options?.description || descriptorPrefix || EMAIL_WEBSITE_NAME || 'Unchained'}`.trim();
|
|
79
|
-
|
|
80
|
-
const setupIntent = await stripe.setupIntents.create({
|
|
81
|
-
description,
|
|
82
|
-
customer,
|
|
83
|
-
metadata: {
|
|
84
|
-
userId,
|
|
85
|
-
paymentProviderId,
|
|
86
|
-
environment,
|
|
87
|
-
},
|
|
88
|
-
usage: 'off_session',
|
|
89
|
-
...options,
|
|
90
|
-
});
|
|
91
|
-
return setupIntent;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export const createOrderPaymentIntent = async (
|
|
95
|
-
{
|
|
96
|
-
userId,
|
|
97
|
-
name,
|
|
98
|
-
email,
|
|
99
|
-
order,
|
|
100
|
-
orderPayment,
|
|
101
|
-
pricing,
|
|
102
|
-
descriptorPrefix,
|
|
103
|
-
}: {
|
|
104
|
-
userId: string;
|
|
105
|
-
name: string;
|
|
106
|
-
email: string;
|
|
107
|
-
order: Order;
|
|
108
|
-
orderPayment: OrderPayment;
|
|
109
|
-
pricing: IOrderPricingSheet;
|
|
110
|
-
descriptorPrefix?: string;
|
|
111
|
-
},
|
|
112
|
-
options: Record<string, any> = {},
|
|
113
|
-
) => {
|
|
114
|
-
const description =
|
|
115
|
-
`${options?.description || descriptorPrefix || EMAIL_WEBSITE_NAME || 'Unchained'}`.trim();
|
|
116
|
-
const customer = options?.customer || (await upsertCustomer({ userId, name, email }));
|
|
117
|
-
|
|
118
|
-
const { currencyCode, amount } = pricing.total({ useNetPrice: false });
|
|
119
|
-
|
|
120
|
-
const paymentIntent = await stripe.paymentIntents.create({
|
|
121
|
-
amount: Math.round(amount),
|
|
122
|
-
currency: currencyCode.toLowerCase(),
|
|
123
|
-
description,
|
|
124
|
-
statement_descriptor_suffix: `${order._id.substring(0, 4)}..${order._id.substring(order._id.length - 4)}`,
|
|
125
|
-
setup_future_usage: 'off_session', // Verify your integration in this guide by including this parameter
|
|
126
|
-
customer,
|
|
127
|
-
receipt_email: order.contact?.emailAddress,
|
|
128
|
-
metadata: {
|
|
129
|
-
orderPaymentId: orderPayment._id,
|
|
130
|
-
orderId: order._id,
|
|
131
|
-
userId,
|
|
132
|
-
environment,
|
|
133
|
-
},
|
|
134
|
-
...options,
|
|
135
|
-
});
|
|
136
|
-
return paymentIntent;
|
|
137
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import express from 'express';
|
|
2
|
-
import { UnchainedCore } from '@unchainedshop/core';
|
|
3
|
-
|
|
4
|
-
import connectCryptoToExpress from './crypto-express.js';
|
|
5
|
-
import connectBaseToExpress from './base-express.js';
|
|
6
|
-
|
|
7
|
-
import { datatransHandler } from '../payment/datatrans-v2/handler-express.js';
|
|
8
|
-
import { stripeHandler } from '../payment/stripe/handler-express.js';
|
|
9
|
-
import { postfinanceCheckoutHandler } from '../payment/postfinance-checkout/handler-express.js';
|
|
10
|
-
import { appleIAPHandler } from '../payment/apple-iap/handler-express.js';
|
|
11
|
-
import { payrexxHandler } from '../payment/payrexx/handler-express.js';
|
|
12
|
-
import { saferpayHandler } from '../payment/saferpay/handler-express.js';
|
|
13
|
-
import { configureGenerateOrderAutoscheduling } from '../worker/enrollment-order-generator.js';
|
|
14
|
-
|
|
15
|
-
const {
|
|
16
|
-
STRIPE_WEBHOOK_PATH = '/payment/stripe',
|
|
17
|
-
PAYREXX_WEBHOOK_PATH = '/payment/payrexx',
|
|
18
|
-
PFCHECKOUT_WEBHOOK_PATH = '/payment/postfinance-checkout',
|
|
19
|
-
DATATRANS_WEBHOOK_PATH = '/payment/datatrans/webhook',
|
|
20
|
-
APPLE_IAP_WEBHOOK_PATH = '/payment/apple-iap',
|
|
21
|
-
SAFERPAY_WEBHOOK_PATH = '/payment/saferpay/webhook',
|
|
22
|
-
} = process.env;
|
|
23
|
-
|
|
24
|
-
export default (app: express.Express, { unchainedAPI }: { unchainedAPI: UnchainedCore }) => {
|
|
25
|
-
connectBaseToExpress(app);
|
|
26
|
-
connectCryptoToExpress(app, unchainedAPI);
|
|
27
|
-
|
|
28
|
-
app.use(STRIPE_WEBHOOK_PATH, express.raw({ type: 'application/json' }), stripeHandler);
|
|
29
|
-
app.use(PFCHECKOUT_WEBHOOK_PATH, express.json(), postfinanceCheckoutHandler);
|
|
30
|
-
|
|
31
|
-
app.use(
|
|
32
|
-
DATATRANS_WEBHOOK_PATH,
|
|
33
|
-
express.text({
|
|
34
|
-
type: 'application/json',
|
|
35
|
-
}),
|
|
36
|
-
datatransHandler,
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
app.use(
|
|
40
|
-
APPLE_IAP_WEBHOOK_PATH,
|
|
41
|
-
express.json({
|
|
42
|
-
strict: false,
|
|
43
|
-
}),
|
|
44
|
-
appleIAPHandler,
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
app.use(PAYREXX_WEBHOOK_PATH, express.json({ type: 'application/json' }), payrexxHandler);
|
|
48
|
-
app.use(SAFERPAY_WEBHOOK_PATH, saferpayHandler);
|
|
49
|
-
|
|
50
|
-
configureGenerateOrderAutoscheduling();
|
|
51
|
-
};
|