@cedros/pay-react 1.0.4 → 1.1.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 +297 -39
- package/dist/CedrosContext-DUT3cLZg.mjs +2474 -0
- package/dist/CedrosContext-efFL4kQz.js +11 -0
- package/dist/admin/index.d.ts +9 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/plugin.d.ts +9 -0
- package/dist/admin/plugin.d.ts.map +1 -0
- package/dist/admin/types.d.ts +115 -0
- package/dist/admin/types.d.ts.map +1 -0
- package/dist/components/CedrosPay.d.ts.map +1 -1
- package/dist/components/CreditsButton.d.ts +42 -0
- package/dist/components/CreditsButton.d.ts.map +1 -0
- package/dist/components/CreditsSubscribeButton.d.ts +55 -0
- package/dist/components/CreditsSubscribeButton.d.ts.map +1 -0
- package/dist/components/CryptoButton.d.ts.map +1 -1
- package/dist/components/CryptoSubscribeButton.d.ts +50 -0
- package/dist/components/CryptoSubscribeButton.d.ts.map +1 -0
- package/dist/components/PaymentModal.d.ts +8 -2
- package/dist/components/PaymentModal.d.ts.map +1 -1
- package/dist/components/PurchaseButton.d.ts +14 -3
- package/dist/components/PurchaseButton.d.ts.map +1 -1
- package/dist/components/SubscribeButton.d.ts +55 -0
- package/dist/components/SubscribeButton.d.ts.map +1 -0
- package/dist/components/SubscriptionManagementPanel.d.ts +67 -0
- package/dist/components/SubscriptionManagementPanel.d.ts.map +1 -0
- package/dist/components/admin/AISettingsSection.d.ts +3 -0
- package/dist/components/admin/AISettingsSection.d.ts.map +1 -0
- package/dist/components/admin/AdminAuthManager.d.ts +95 -0
- package/dist/components/admin/AdminAuthManager.d.ts.map +1 -0
- package/dist/components/admin/CedrosPayAdminDashboard.d.ts +40 -0
- package/dist/components/admin/CedrosPayAdminDashboard.d.ts.map +1 -0
- package/dist/components/admin/ConfigEditor.d.ts +13 -0
- package/dist/components/admin/ConfigEditor.d.ts.map +1 -0
- package/dist/components/admin/CouponsSection.d.ts +3 -0
- package/dist/components/admin/CouponsSection.d.ts.map +1 -0
- package/dist/components/admin/Dropdown.d.ts +29 -0
- package/dist/components/admin/Dropdown.d.ts.map +1 -0
- package/dist/components/admin/FAQSection.d.ts +3 -0
- package/dist/components/admin/FAQSection.d.ts.map +1 -0
- package/dist/components/admin/MessagingSection.d.ts +10 -0
- package/dist/components/admin/MessagingSection.d.ts.map +1 -0
- package/dist/components/admin/OverviewSection.d.ts +3 -0
- package/dist/components/admin/OverviewSection.d.ts.map +1 -0
- package/dist/components/admin/PaymentSettingsSection.d.ts +3 -0
- package/dist/components/admin/PaymentSettingsSection.d.ts.map +1 -0
- package/dist/components/admin/ProductVariationsEditor.d.ts +14 -0
- package/dist/components/admin/ProductVariationsEditor.d.ts.map +1 -0
- package/dist/components/admin/ProductsSection.d.ts +3 -0
- package/dist/components/admin/ProductsSection.d.ts.map +1 -0
- package/dist/components/admin/RefundsSection.d.ts +3 -0
- package/dist/components/admin/RefundsSection.d.ts.map +1 -0
- package/dist/components/admin/SettingsSection.d.ts +10 -0
- package/dist/components/admin/SettingsSection.d.ts.map +1 -0
- package/dist/components/admin/SingleCategorySettings.d.ts +21 -0
- package/dist/components/admin/SingleCategorySettings.d.ts.map +1 -0
- package/dist/components/admin/StatsBar.d.ts +19 -0
- package/dist/components/admin/StatsBar.d.ts.map +1 -0
- package/dist/components/admin/StorefrontSection.d.ts +3 -0
- package/dist/components/admin/StorefrontSection.d.ts.map +1 -0
- package/dist/components/admin/SubscriptionsSection.d.ts +3 -0
- package/dist/components/admin/SubscriptionsSection.d.ts.map +1 -0
- package/dist/components/admin/TransactionsSection.d.ts +3 -0
- package/dist/components/admin/TransactionsSection.d.ts.map +1 -0
- package/dist/components/admin/VariantInventoryGrid.d.ts +19 -0
- package/dist/components/admin/VariantInventoryGrid.d.ts.map +1 -0
- package/dist/components/admin/VariationTypeEditor.d.ts +15 -0
- package/dist/components/admin/VariationTypeEditor.d.ts.map +1 -0
- package/dist/components/admin/configApi.d.ts +104 -0
- package/dist/components/admin/configApi.d.ts.map +1 -0
- package/dist/components/admin/icons.d.ts +50 -0
- package/dist/components/admin/icons.d.ts.map +1 -0
- package/dist/components/admin/index.d.ts +16 -0
- package/dist/components/admin/index.d.ts.map +1 -0
- package/dist/components/admin/sections-more.d.ts +12 -0
- package/dist/components/admin/sections-more.d.ts.map +1 -0
- package/dist/components/admin/sections.d.ts +12 -0
- package/dist/components/admin/sections.d.ts.map +1 -0
- package/dist/components/admin/types.d.ts +324 -0
- package/dist/components/admin/types.d.ts.map +1 -0
- package/dist/components/admin/useAdminAuth.d.ts +50 -0
- package/dist/components/admin/useAdminAuth.d.ts.map +1 -0
- package/dist/components/admin/useAutosave.d.ts +56 -0
- package/dist/components/admin/useAutosave.d.ts.map +1 -0
- package/dist/components/admin/useProductVariations.d.ts +56 -0
- package/dist/components/admin/useProductVariations.d.ts.map +1 -0
- package/dist/components/subscriptionPanelStyles.d.ts +12 -0
- package/dist/components/subscriptionPanelStyles.d.ts.map +1 -0
- package/dist/context/CedrosContext.d.ts +6 -0
- package/dist/context/CedrosContext.d.ts.map +1 -1
- package/dist/context/ThemeContext.d.ts +6 -0
- package/dist/context/ThemeContext.d.ts.map +1 -1
- package/dist/crypto-only.d.ts +1 -1
- package/dist/crypto-only.d.ts.map +1 -1
- package/dist/crypto-only.js +1 -1
- package/dist/crypto-only.mjs +16 -17
- package/dist/ecommerce/__tests__/cartCheckoutRequirements.test.d.ts +2 -0
- package/dist/ecommerce/__tests__/cartCheckoutRequirements.test.d.ts.map +1 -0
- package/dist/ecommerce/__tests__/cartProviderPersistence.test.d.ts +2 -0
- package/dist/ecommerce/__tests__/cartProviderPersistence.test.d.ts.map +1 -0
- package/dist/ecommerce/__tests__/cartReducer.test.d.ts +2 -0
- package/dist/ecommerce/__tests__/cartReducer.test.d.ts.map +1 -0
- package/dist/ecommerce/__tests__/cartServerMerge.test.d.ts +2 -0
- package/dist/ecommerce/__tests__/cartServerMerge.test.d.ts.map +1 -0
- package/dist/ecommerce/__tests__/checkoutPaymentMethods.test.d.ts +2 -0
- package/dist/ecommerce/__tests__/checkoutPaymentMethods.test.d.ts.map +1 -0
- package/dist/ecommerce/__tests__/checkoutReturn.test.d.ts +2 -0
- package/dist/ecommerce/__tests__/checkoutReturn.test.d.ts.map +1 -0
- package/dist/ecommerce/__tests__/checkoutSchema.test.d.ts +2 -0
- package/dist/ecommerce/__tests__/checkoutSchema.test.d.ts.map +1 -0
- package/dist/ecommerce/__tests__/mockAdapter.test.d.ts +2 -0
- package/dist/ecommerce/__tests__/mockAdapter.test.d.ts.map +1 -0
- package/dist/ecommerce/adapters/CommerceAdapter.d.ts +235 -0
- package/dist/ecommerce/adapters/CommerceAdapter.d.ts.map +1 -0
- package/dist/ecommerce/adapters/mock/mockAdapter.d.ts +3 -0
- package/dist/ecommerce/adapters/mock/mockAdapter.d.ts.map +1 -0
- package/dist/ecommerce/adapters/paywall/paywallAdapter.d.ts +6 -0
- package/dist/ecommerce/adapters/paywall/paywallAdapter.d.ts.map +1 -0
- package/dist/ecommerce/components/cart/CartLineItem.d.ts +12 -0
- package/dist/ecommerce/components/cart/CartLineItem.d.ts.map +1 -0
- package/dist/ecommerce/components/cart/CartPageContent.d.ts +6 -0
- package/dist/ecommerce/components/cart/CartPageContent.d.ts.map +1 -0
- package/dist/ecommerce/components/cart/CartPanel.d.ts +5 -0
- package/dist/ecommerce/components/cart/CartPanel.d.ts.map +1 -0
- package/dist/ecommerce/components/cart/CartSidebar.d.ts +11 -0
- package/dist/ecommerce/components/cart/CartSidebar.d.ts.map +1 -0
- package/dist/ecommerce/components/cart/CartSummary.d.ts +13 -0
- package/dist/ecommerce/components/cart/CartSummary.d.ts.map +1 -0
- package/dist/ecommerce/components/cart/PromoCodeInput.d.ts +6 -0
- package/dist/ecommerce/components/cart/PromoCodeInput.d.ts.map +1 -0
- package/dist/ecommerce/components/catalog/Breadcrumbs.d.ts +9 -0
- package/dist/ecommerce/components/catalog/Breadcrumbs.d.ts.map +1 -0
- package/dist/ecommerce/components/catalog/CategoryNav.d.ts +8 -0
- package/dist/ecommerce/components/catalog/CategoryNav.d.ts.map +1 -0
- package/dist/ecommerce/components/catalog/FilterPanel.d.ts +29 -0
- package/dist/ecommerce/components/catalog/FilterPanel.d.ts.map +1 -0
- package/dist/ecommerce/components/catalog/Price.d.ts +9 -0
- package/dist/ecommerce/components/catalog/Price.d.ts.map +1 -0
- package/dist/ecommerce/components/catalog/ProductCard.d.ts +14 -0
- package/dist/ecommerce/components/catalog/ProductCard.d.ts.map +1 -0
- package/dist/ecommerce/components/catalog/ProductGallery.d.ts +6 -0
- package/dist/ecommerce/components/catalog/ProductGallery.d.ts.map +1 -0
- package/dist/ecommerce/components/catalog/ProductGrid.d.ts +20 -0
- package/dist/ecommerce/components/catalog/ProductGrid.d.ts.map +1 -0
- package/dist/ecommerce/components/catalog/QuantitySelector.d.ts +8 -0
- package/dist/ecommerce/components/catalog/QuantitySelector.d.ts.map +1 -0
- package/dist/ecommerce/components/catalog/QuickViewDialog.d.ts +10 -0
- package/dist/ecommerce/components/catalog/QuickViewDialog.d.ts.map +1 -0
- package/dist/ecommerce/components/catalog/SearchInput.d.ts +7 -0
- package/dist/ecommerce/components/catalog/SearchInput.d.ts.map +1 -0
- package/dist/ecommerce/components/catalog/VariantSelector.d.ts +19 -0
- package/dist/ecommerce/components/catalog/VariantSelector.d.ts.map +1 -0
- package/dist/ecommerce/components/chat/ShopChatPanel.d.ts +4 -0
- package/dist/ecommerce/components/chat/ShopChatPanel.d.ts.map +1 -0
- package/dist/ecommerce/components/checkout/AddressForm.d.ts +9 -0
- package/dist/ecommerce/components/checkout/AddressForm.d.ts.map +1 -0
- package/dist/ecommerce/components/checkout/CheckoutCancelPage.d.ts +24 -0
- package/dist/ecommerce/components/checkout/CheckoutCancelPage.d.ts.map +1 -0
- package/dist/ecommerce/components/checkout/CheckoutForm.d.ts +4 -0
- package/dist/ecommerce/components/checkout/CheckoutForm.d.ts.map +1 -0
- package/dist/ecommerce/components/checkout/CheckoutLayout.d.ts +6 -0
- package/dist/ecommerce/components/checkout/CheckoutLayout.d.ts.map +1 -0
- package/dist/ecommerce/components/checkout/CheckoutReceipt.d.ts +8 -0
- package/dist/ecommerce/components/checkout/CheckoutReceipt.d.ts.map +1 -0
- package/dist/ecommerce/components/checkout/CheckoutSuccessPage.d.ts +29 -0
- package/dist/ecommerce/components/checkout/CheckoutSuccessPage.d.ts.map +1 -0
- package/dist/ecommerce/components/checkout/InventoryVerificationDialog.d.ts +19 -0
- package/dist/ecommerce/components/checkout/InventoryVerificationDialog.d.ts.map +1 -0
- package/dist/ecommerce/components/checkout/OrderReview.d.ts +4 -0
- package/dist/ecommerce/components/checkout/OrderReview.d.ts.map +1 -0
- package/dist/ecommerce/components/checkout/PaymentStep.d.ts +15 -0
- package/dist/ecommerce/components/checkout/PaymentStep.d.ts.map +1 -0
- package/dist/ecommerce/components/checkout/ShippingMethodSelector.d.ts +9 -0
- package/dist/ecommerce/components/checkout/ShippingMethodSelector.d.ts.map +1 -0
- package/dist/ecommerce/components/faq/FAQItem.d.ts +29 -0
- package/dist/ecommerce/components/faq/FAQItem.d.ts.map +1 -0
- package/dist/ecommerce/components/faq/FAQItem.test.d.ts +7 -0
- package/dist/ecommerce/components/faq/FAQItem.test.d.ts.map +1 -0
- package/dist/ecommerce/components/faq/FAQList.d.ts +15 -0
- package/dist/ecommerce/components/faq/FAQList.d.ts.map +1 -0
- package/dist/ecommerce/components/faq/index.d.ts +3 -0
- package/dist/ecommerce/components/faq/index.d.ts.map +1 -0
- package/dist/ecommerce/components/general/EmptyState.d.ts +8 -0
- package/dist/ecommerce/components/general/EmptyState.d.ts.map +1 -0
- package/dist/ecommerce/components/general/ErrorBoundary.d.ts +16 -0
- package/dist/ecommerce/components/general/ErrorBoundary.d.ts.map +1 -0
- package/dist/ecommerce/components/general/ErrorState.d.ts +7 -0
- package/dist/ecommerce/components/general/ErrorState.d.ts.map +1 -0
- package/dist/ecommerce/components/general/toast.d.ts +19 -0
- package/dist/ecommerce/components/general/toast.d.ts.map +1 -0
- package/dist/ecommerce/components/orders/OrderCard.d.ts +7 -0
- package/dist/ecommerce/components/orders/OrderCard.d.ts.map +1 -0
- package/dist/ecommerce/components/orders/OrderDetails.d.ts +7 -0
- package/dist/ecommerce/components/orders/OrderDetails.d.ts.map +1 -0
- package/dist/ecommerce/components/orders/OrderList.d.ts +7 -0
- package/dist/ecommerce/components/orders/OrderList.d.ts.map +1 -0
- package/dist/ecommerce/components/ui/accordion.d.ts +7 -0
- package/dist/ecommerce/components/ui/accordion.d.ts.map +1 -0
- package/dist/ecommerce/components/ui/badge.d.ts +10 -0
- package/dist/ecommerce/components/ui/badge.d.ts.map +1 -0
- package/dist/ecommerce/components/ui/button.d.ts +12 -0
- package/dist/ecommerce/components/ui/button.d.ts.map +1 -0
- package/dist/ecommerce/components/ui/card.d.ts +8 -0
- package/dist/ecommerce/components/ui/card.d.ts.map +1 -0
- package/dist/ecommerce/components/ui/dialog.d.ts +13 -0
- package/dist/ecommerce/components/ui/dialog.d.ts.map +1 -0
- package/dist/ecommerce/components/ui/input.d.ts +5 -0
- package/dist/ecommerce/components/ui/input.d.ts.map +1 -0
- package/dist/ecommerce/components/ui/label.d.ts +3 -0
- package/dist/ecommerce/components/ui/label.d.ts.map +1 -0
- package/dist/ecommerce/components/ui/select.d.ts +9 -0
- package/dist/ecommerce/components/ui/select.d.ts.map +1 -0
- package/dist/ecommerce/components/ui/separator.d.ts +4 -0
- package/dist/ecommerce/components/ui/separator.d.ts.map +1 -0
- package/dist/ecommerce/components/ui/sheet.d.ts +21 -0
- package/dist/ecommerce/components/ui/sheet.d.ts.map +1 -0
- package/dist/ecommerce/components/ui/skeleton.d.ts +3 -0
- package/dist/ecommerce/components/ui/skeleton.d.ts.map +1 -0
- package/dist/ecommerce/components/ui/tabs.d.ts +7 -0
- package/dist/ecommerce/components/ui/tabs.d.ts.map +1 -0
- package/dist/ecommerce/components/ui/textarea.d.ts +5 -0
- package/dist/ecommerce/components/ui/textarea.d.ts.map +1 -0
- package/dist/ecommerce/config/context.d.ts +13 -0
- package/dist/ecommerce/config/context.d.ts.map +1 -0
- package/dist/ecommerce/config/types.d.ts +48 -0
- package/dist/ecommerce/config/types.d.ts.map +1 -0
- package/dist/ecommerce/hooks/checkoutReturn.d.ts +3 -0
- package/dist/ecommerce/hooks/checkoutReturn.d.ts.map +1 -0
- package/dist/ecommerce/hooks/useAIRelatedProducts.d.ts +33 -0
- package/dist/ecommerce/hooks/useAIRelatedProducts.d.ts.map +1 -0
- package/dist/ecommerce/hooks/useCartInventory.d.ts +42 -0
- package/dist/ecommerce/hooks/useCartInventory.d.ts.map +1 -0
- package/dist/ecommerce/hooks/useCatalogUrlState.d.ts +15 -0
- package/dist/ecommerce/hooks/useCatalogUrlState.d.ts.map +1 -0
- package/dist/ecommerce/hooks/useCategories.d.ts +7 -0
- package/dist/ecommerce/hooks/useCategories.d.ts.map +1 -0
- package/dist/ecommerce/hooks/useCheckoutResultFromUrl.d.ts +4 -0
- package/dist/ecommerce/hooks/useCheckoutResultFromUrl.d.ts.map +1 -0
- package/dist/ecommerce/hooks/useHoldExpiry.d.ts +34 -0
- package/dist/ecommerce/hooks/useHoldExpiry.d.ts.map +1 -0
- package/dist/ecommerce/hooks/useInventoryVerification.d.ts +41 -0
- package/dist/ecommerce/hooks/useInventoryVerification.d.ts.map +1 -0
- package/dist/ecommerce/hooks/useOrders.d.ts +7 -0
- package/dist/ecommerce/hooks/useOrders.d.ts.map +1 -0
- package/dist/ecommerce/hooks/usePaymentMethodsConfig.d.ts +6 -0
- package/dist/ecommerce/hooks/usePaymentMethodsConfig.d.ts.map +1 -0
- package/dist/ecommerce/hooks/useProduct.d.ts +7 -0
- package/dist/ecommerce/hooks/useProduct.d.ts.map +1 -0
- package/dist/ecommerce/hooks/useProducts.d.ts +8 -0
- package/dist/ecommerce/hooks/useProducts.d.ts.map +1 -0
- package/dist/ecommerce/hooks/useShippingMethods.d.ts +10 -0
- package/dist/ecommerce/hooks/useShippingMethods.d.ts.map +1 -0
- package/dist/ecommerce/hooks/useStorefrontSettings.d.ts +32 -0
- package/dist/ecommerce/hooks/useStorefrontSettings.d.ts.map +1 -0
- package/dist/ecommerce/hooks/useSubscriptionData.d.ts +8 -0
- package/dist/ecommerce/hooks/useSubscriptionData.d.ts.map +1 -0
- package/dist/ecommerce/index.d.ts +98 -0
- package/dist/ecommerce/index.d.ts.map +1 -0
- package/dist/ecommerce/integrations/cedros-pay/useCedrosPayCheckoutAdapter.d.ts +10 -0
- package/dist/ecommerce/integrations/cedros-pay/useCedrosPayCheckoutAdapter.d.ts.map +1 -0
- package/dist/ecommerce/state/cart/CartProvider.d.ts +27 -0
- package/dist/ecommerce/state/cart/CartProvider.d.ts.map +1 -0
- package/dist/ecommerce/state/cart/cartReducer.d.ts +35 -0
- package/dist/ecommerce/state/cart/cartReducer.d.ts.map +1 -0
- package/dist/ecommerce/state/checkout/checkoutSchema.d.ts +21 -0
- package/dist/ecommerce/state/checkout/checkoutSchema.d.ts.map +1 -0
- package/dist/ecommerce/state/checkout/useCheckout.d.ts +34 -0
- package/dist/ecommerce/state/checkout/useCheckout.d.ts.map +1 -0
- package/dist/ecommerce/templates/CartTemplate.d.ts +5 -0
- package/dist/ecommerce/templates/CartTemplate.d.ts.map +1 -0
- package/dist/ecommerce/templates/CategoryTemplate.d.ts +11 -0
- package/dist/ecommerce/templates/CategoryTemplate.d.ts.map +1 -0
- package/dist/ecommerce/templates/CheckoutTemplate.d.ts +9 -0
- package/dist/ecommerce/templates/CheckoutTemplate.d.ts.map +1 -0
- package/dist/ecommerce/templates/ProductTemplate.d.ts +11 -0
- package/dist/ecommerce/templates/ProductTemplate.d.ts.map +1 -0
- package/dist/ecommerce/templates/PurchaseHistoryTemplate.d.ts +6 -0
- package/dist/ecommerce/templates/PurchaseHistoryTemplate.d.ts.map +1 -0
- package/dist/ecommerce/templates/ReceiptTemplate.d.ts +19 -0
- package/dist/ecommerce/templates/ReceiptTemplate.d.ts.map +1 -0
- package/dist/ecommerce/templates/ShopTemplate.d.ts +15 -0
- package/dist/ecommerce/templates/ShopTemplate.d.ts.map +1 -0
- package/dist/ecommerce/templates/SubscriptionTemplate.d.ts +15 -0
- package/dist/ecommerce/templates/SubscriptionTemplate.d.ts.map +1 -0
- package/dist/ecommerce/testing/adapterContract.d.ts +11 -0
- package/dist/ecommerce/testing/adapterContract.d.ts.map +1 -0
- package/dist/ecommerce/types.d.ts +164 -0
- package/dist/ecommerce/types.d.ts.map +1 -0
- package/dist/ecommerce/utils/cartCheckoutRequirements.d.ts +18 -0
- package/dist/ecommerce/utils/cartCheckoutRequirements.d.ts.map +1 -0
- package/dist/ecommerce/utils/cartItemMetadata.d.ts +3 -0
- package/dist/ecommerce/utils/cartItemMetadata.d.ts.map +1 -0
- package/dist/ecommerce/utils/cn.d.ts +3 -0
- package/dist/ecommerce/utils/cn.d.ts.map +1 -0
- package/dist/ecommerce/utils/money.d.ts +6 -0
- package/dist/ecommerce/utils/money.d.ts.map +1 -0
- package/dist/ecommerce/utils/storage.d.ts +5 -0
- package/dist/ecommerce/utils/storage.d.ts.map +1 -0
- package/dist/en-BXheDBal.mjs +19 -0
- package/dist/en-Yikrt96u.js +1 -0
- package/dist/hooks/useCreditsPayment.d.ts +64 -0
- package/dist/hooks/useCreditsPayment.d.ts.map +1 -0
- package/dist/hooks/useCreditsSubscription.d.ts +42 -0
- package/dist/hooks/useCreditsSubscription.d.ts.map +1 -0
- package/dist/hooks/useCryptoSubscription.d.ts +42 -0
- package/dist/hooks/useCryptoSubscription.d.ts.map +1 -0
- package/dist/hooks/usePaymentMode.d.ts.map +1 -1
- package/dist/hooks/useStripeCheckout.d.ts +1 -0
- package/dist/hooks/useStripeCheckout.d.ts.map +1 -1
- package/dist/hooks/useSubscription.d.ts +42 -0
- package/dist/hooks/useSubscription.d.ts.map +1 -0
- package/dist/hooks/useSubscriptionManagement.d.ts +92 -0
- package/dist/hooks/useSubscriptionManagement.d.ts.map +1 -0
- package/dist/hooks/useX402Payment.d.ts +1 -0
- package/dist/hooks/useX402Payment.d.ts.map +1 -1
- package/dist/i18n/index.d.ts +7 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/index-D2d_ukkR.mjs +26838 -0
- package/dist/index-DGkSHjb1.js +136 -0
- package/dist/index.d.ts +20 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +79 -625
- package/dist/magic-string.es-B81Zo59j.js +10 -0
- package/dist/magic-string.es-uPKorP4O.mjs +663 -0
- package/dist/managers/CreditsManager.d.ts +151 -0
- package/dist/managers/CreditsManager.d.ts.map +1 -0
- package/dist/managers/ManagerCache.d.ts +6 -0
- package/dist/managers/ManagerCache.d.ts.map +1 -1
- package/dist/managers/RouteDiscoveryManager.d.ts.map +1 -1
- package/dist/managers/StripeManager.d.ts.map +1 -1
- package/dist/managers/SubscriptionChangeManager.d.ts +42 -0
- package/dist/managers/SubscriptionChangeManager.d.ts.map +1 -0
- package/dist/managers/SubscriptionManager.d.ts +113 -0
- package/dist/managers/SubscriptionManager.d.ts.map +1 -0
- package/dist/managers/X402Manager.d.ts.map +1 -1
- package/dist/pay-react.css +1 -1
- package/dist/sections-6IcZ6JeN.js +1 -0
- package/dist/sections-a0Dz-MMz.mjs +10 -0
- package/dist/stripe-only.d.ts +1 -1
- package/dist/stripe-only.d.ts.map +1 -1
- package/dist/stripe-only.js +1 -1
- package/dist/stripe-only.mjs +12 -13
- package/dist/styles-C4-_hbgr.js +1 -0
- package/dist/styles-QcAsIVWl.mjs +1909 -0
- package/dist/telemetry.js +1 -1
- package/dist/telemetry.mjs +1 -1
- package/dist/testing/index.js +147 -1
- package/dist/testing/index.mjs +10555 -103
- package/dist/types/componentOptions.d.ts +14 -4
- package/dist/types/componentOptions.d.ts.map +1 -1
- package/dist/types/errors.d.ts +26 -4
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/index.d.ts +116 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/subscription.d.ts +300 -0
- package/dist/types/subscription.d.ts.map +1 -0
- package/dist/utils/cartHelpers.d.ts +3 -0
- package/dist/utils/cartHelpers.d.ts.map +1 -1
- package/dist/utils/cspHelper.d.ts +7 -1
- package/dist/utils/cspHelper.d.ts.map +1 -1
- package/dist/utils/csvHelpers.d.ts +62 -0
- package/dist/utils/csvHelpers.d.ts.map +1 -0
- package/dist/utils/csvHelpers.test.d.ts +2 -0
- package/dist/utils/csvHelpers.test.d.ts.map +1 -0
- package/dist/utils/dateHelpers.d.ts +24 -0
- package/dist/utils/dateHelpers.d.ts.map +1 -0
- package/dist/utils/eventEmitter.d.ts +1 -1
- package/dist/utils/eventEmitter.d.ts.map +1 -1
- package/dist/utils/fetchWithTimeout.d.ts +3 -3
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/tokenMintValidator.d.ts +10 -6
- package/dist/utils/tokenMintValidator.d.ts.map +1 -1
- package/dist/utils/uuid.d.ts.map +1 -1
- package/dist/uuid-C5B8o31X.js +1 -0
- package/dist/uuid-_z3jSatJ.mjs +17 -0
- package/package.json +25 -9
- package/dist/CedrosContext-B3iCqN6e.js +0 -11
- package/dist/CedrosContext-vX9uqZKp.mjs +0 -1796
- package/dist/en-CSsJl3nf.mjs +0 -19
- package/dist/en-D-uY3ltT.js +0 -1
- package/dist/styles-61pRysGe.js +0 -1
- package/dist/styles-DI2LPVdQ.mjs +0 -1625
- package/dist/utils/uuid-shim.d.ts +0 -9
- package/dist/utils/uuid-shim.d.ts.map +0 -1
- package/dist/uuid-C0iMjdcc.js +0 -1
- package/dist/uuid-UlzrVY8Y.mjs +0 -17
- package/dist/walletDetection-JZR3UCOa.mjs +0 -27
- package/dist/walletDetection-bNmV5ItZ.js +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,627 +1,81 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import { clusterApiUrl as ye } from "@solana/web3.js";
|
|
9
|
-
function Se(t) {
|
|
10
|
-
switch (t) {
|
|
11
|
-
case "mainnet-beta":
|
|
12
|
-
return "https://api.mainnet-beta.solana.com";
|
|
13
|
-
case "devnet":
|
|
14
|
-
return "https://api.devnet.solana.com";
|
|
15
|
-
case "testnet":
|
|
16
|
-
return "https://api.testnet.solana.com";
|
|
17
|
-
default:
|
|
18
|
-
return "https://api.mainnet-beta.solana.com";
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function ge(t) {
|
|
22
|
-
try {
|
|
23
|
-
const s = new URL(t);
|
|
24
|
-
return `${s.protocol}//${s.host}`;
|
|
25
|
-
} catch {
|
|
26
|
-
return t;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function Ce(t = {}) {
|
|
30
|
-
const {
|
|
31
|
-
solanaCluster: s = "mainnet-beta",
|
|
32
|
-
solanaEndpoint: r,
|
|
33
|
-
customRpcProviders: o = [],
|
|
34
|
-
allowUnsafeScripts: n = !1,
|
|
35
|
-
additionalScriptSrc: e = [],
|
|
36
|
-
additionalConnectSrc: h = [],
|
|
37
|
-
additionalFrameSrc: m = [],
|
|
38
|
-
includeStripe: y = !0
|
|
39
|
-
} = t, l = ["'self'"];
|
|
40
|
-
n && l.push("'unsafe-inline'", "'unsafe-eval'"), y && l.push("https://js.stripe.com"), l.push(...e);
|
|
41
|
-
const i = ["'self'"];
|
|
42
|
-
y && i.push("https://api.stripe.com", "https://*.stripe.com");
|
|
43
|
-
const b = Se(s);
|
|
44
|
-
if (i.push(b), i.push("https://*.solana.com"), r) {
|
|
45
|
-
const P = ge(r);
|
|
46
|
-
i.includes(P) || i.push(P);
|
|
47
|
-
}
|
|
48
|
-
o.forEach((P) => {
|
|
49
|
-
i.includes(P) || i.push(P);
|
|
50
|
-
}), i.push(...h);
|
|
51
|
-
const g = ["'self'"];
|
|
52
|
-
return y && g.push("https://js.stripe.com", "https://checkout.stripe.com"), g.push(...m), {
|
|
53
|
-
scriptSrc: l,
|
|
54
|
-
connectSrc: i,
|
|
55
|
-
frameSrc: g
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function Pe(t, s = "header") {
|
|
59
|
-
const { scriptSrc: r, connectSrc: o, frameSrc: n } = t;
|
|
60
|
-
switch (s) {
|
|
61
|
-
case "header":
|
|
62
|
-
case "meta":
|
|
63
|
-
case "nextjs":
|
|
64
|
-
case "nginx": {
|
|
65
|
-
const e = [];
|
|
66
|
-
return r.length > 0 && e.push(`script-src ${r.join(" ")}`), o.length > 0 && e.push(`connect-src ${o.join(" ")}`), n.length > 0 && e.push(`frame-src ${n.join(" ")}`), e.join("; ");
|
|
67
|
-
}
|
|
68
|
-
case "helmet": {
|
|
69
|
-
const e = {};
|
|
70
|
-
return r.length > 0 && (e.scriptSrc = r), o.length > 0 && (e.connectSrc = o), n.length > 0 && (e.frameSrc = n), e;
|
|
71
|
-
}
|
|
72
|
-
case "directives":
|
|
73
|
-
return { scriptSrc: r, connectSrc: o, frameSrc: n };
|
|
74
|
-
default:
|
|
75
|
-
throw new Error(`Unknown CSP format: ${s}`);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function xe(t = {}, s = "header") {
|
|
79
|
-
const r = Ce(t);
|
|
80
|
-
return Pe(r, s);
|
|
81
|
-
}
|
|
82
|
-
const Ue = {
|
|
83
|
-
HELIUS: "https://*.helius-rpc.com",
|
|
84
|
-
QUICKNODE: "https://*.quicknode.pro",
|
|
85
|
-
ALCHEMY: "https://*.alchemy.com",
|
|
86
|
-
ANKR: "https://rpc.ankr.com",
|
|
87
|
-
TRITON: "https://*.rpcpool.com"
|
|
88
|
-
}, qe = {
|
|
89
|
-
/**
|
|
90
|
-
* Mainnet production with custom RPC (recommended)
|
|
91
|
-
*/
|
|
92
|
-
MAINNET_CUSTOM_RPC: (t) => ({
|
|
93
|
-
solanaCluster: "mainnet-beta",
|
|
94
|
-
solanaEndpoint: t,
|
|
95
|
-
allowUnsafeScripts: !1
|
|
96
|
-
}),
|
|
97
|
-
/**
|
|
98
|
-
* Mainnet with Next.js (requires unsafe-inline/eval)
|
|
99
|
-
*/
|
|
100
|
-
MAINNET_NEXTJS: (t) => ({
|
|
101
|
-
solanaCluster: "mainnet-beta",
|
|
102
|
-
solanaEndpoint: t,
|
|
103
|
-
allowUnsafeScripts: !0
|
|
104
|
-
}),
|
|
105
|
-
/**
|
|
106
|
-
* Devnet for testing
|
|
107
|
-
*/
|
|
108
|
-
DEVNET: () => ({
|
|
109
|
-
solanaCluster: "devnet",
|
|
110
|
-
allowUnsafeScripts: !0
|
|
111
|
-
}),
|
|
112
|
-
/**
|
|
113
|
-
* Crypto-only payments (no Stripe)
|
|
114
|
-
*/
|
|
115
|
-
CRYPTO_ONLY: (t) => ({
|
|
116
|
-
solanaCluster: "mainnet-beta",
|
|
117
|
-
solanaEndpoint: t,
|
|
118
|
-
includeStripe: !1
|
|
119
|
-
}),
|
|
120
|
-
/**
|
|
121
|
-
* Stripe-only payments (no Solana)
|
|
122
|
-
*/
|
|
123
|
-
STRIPE_ONLY: () => ({
|
|
124
|
-
solanaCluster: "mainnet-beta",
|
|
125
|
-
includeStripe: !0,
|
|
126
|
-
// Don't include Solana RPC endpoints
|
|
127
|
-
customRpcProviders: []
|
|
128
|
-
})
|
|
129
|
-
}, ve = ({
|
|
130
|
-
resource: t,
|
|
131
|
-
items: s,
|
|
132
|
-
label: r,
|
|
133
|
-
cardLabel: o,
|
|
134
|
-
cryptoLabel: n,
|
|
135
|
-
showCard: e = !0,
|
|
136
|
-
showCrypto: h = !0,
|
|
137
|
-
onPaymentAttempt: m,
|
|
138
|
-
onPaymentSuccess: y,
|
|
139
|
-
onPaymentError: l,
|
|
140
|
-
onStripeSuccess: i,
|
|
141
|
-
onCryptoSuccess: b,
|
|
142
|
-
onStripeError: g,
|
|
143
|
-
onCryptoError: P,
|
|
144
|
-
customerEmail: u,
|
|
145
|
-
successUrl: c,
|
|
146
|
-
cancelUrl: a,
|
|
147
|
-
metadata: S,
|
|
148
|
-
couponCode: v,
|
|
149
|
-
autoDetectWallets: C = !0,
|
|
150
|
-
testPageUrl: w,
|
|
151
|
-
hideMessages: A = !1,
|
|
152
|
-
renderModal: N
|
|
153
|
-
}) => {
|
|
154
|
-
const T = z(), [D, d] = O(!1), { status: F, processPayment: H, processCartCheckout: W } = ne(), { isCartMode: R, effectiveResource: I } = V(t, s), { t: L } = ae(), X = r || L("ui.purchase"), J = o || L("ui.card"), Z = n || L("ui.usdc_solana"), $ = k(async () => {
|
|
155
|
-
if (C && e) {
|
|
156
|
-
const { detectSolanaWallets: p } = await import("./walletDetection-JZR3UCOa.mjs");
|
|
157
|
-
if (!p()) {
|
|
158
|
-
const x = R ? void 0 : I, U = R && s ? Y(s) : void 0;
|
|
159
|
-
ce("stripe", x, U), m && m("stripe"), ie("stripe", x, U);
|
|
160
|
-
let f;
|
|
161
|
-
R && s ? f = await W(
|
|
162
|
-
s,
|
|
163
|
-
c,
|
|
164
|
-
a,
|
|
165
|
-
S,
|
|
166
|
-
u,
|
|
167
|
-
v
|
|
168
|
-
) : I && (f = await H(
|
|
169
|
-
I,
|
|
170
|
-
c,
|
|
171
|
-
a,
|
|
172
|
-
S,
|
|
173
|
-
u,
|
|
174
|
-
v
|
|
175
|
-
)), f && f.success && f.transactionId ? (le("stripe", f.transactionId, x, U), i ? i(f.transactionId) : y && y(f.transactionId)) : f && !f.success && f.error && (ue("stripe", f.error, x, U), g ? g(f.error) : l && l(f.error));
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
d(!0);
|
|
180
|
-
}, [C, e, R, s, I, W, H, c, a, S, u, v, y, l, i, g, m]), B = G(() => R && s ? `purchase-cart-${s.map((p) => p.resource).join("-")}` : `purchase-${I || "unknown"}`, [R, s, I]), ee = G(
|
|
181
|
-
() => de(B, $),
|
|
182
|
-
[B, $]
|
|
183
|
-
), _ = F === "loading", K = {
|
|
184
|
-
isOpen: D,
|
|
185
|
-
onClose: () => d(!1),
|
|
186
|
-
resource: R ? void 0 : I,
|
|
187
|
-
items: R ? s : void 0,
|
|
188
|
-
cardLabel: J,
|
|
189
|
-
cryptoLabel: Z,
|
|
190
|
-
showCard: e,
|
|
191
|
-
showCrypto: h,
|
|
192
|
-
onPaymentAttempt: m,
|
|
193
|
-
onPaymentSuccess: (p) => {
|
|
194
|
-
d(!1), y?.(p);
|
|
195
|
-
},
|
|
196
|
-
onPaymentError: (p) => {
|
|
197
|
-
d(!1), l?.(p);
|
|
198
|
-
},
|
|
199
|
-
onStripeSuccess: (p) => {
|
|
200
|
-
d(!1), i?.(p);
|
|
201
|
-
},
|
|
202
|
-
onCryptoSuccess: (p) => {
|
|
203
|
-
d(!1), b?.(p);
|
|
204
|
-
},
|
|
205
|
-
onStripeError: (p) => {
|
|
206
|
-
d(!1), g?.(p);
|
|
207
|
-
},
|
|
208
|
-
onCryptoError: (p) => {
|
|
209
|
-
d(!1), P?.(p);
|
|
210
|
-
},
|
|
211
|
-
customerEmail: u,
|
|
212
|
-
successUrl: c,
|
|
213
|
-
cancelUrl: a,
|
|
214
|
-
metadata: S,
|
|
215
|
-
couponCode: v,
|
|
216
|
-
testPageUrl: w,
|
|
217
|
-
hideMessages: A
|
|
218
|
-
};
|
|
219
|
-
return /* @__PURE__ */ q("div", { className: T.unstyled ? "" : T.className, style: T.unstyled ? {} : T.style, children: [
|
|
220
|
-
/* @__PURE__ */ E(
|
|
221
|
-
"button",
|
|
222
|
-
{
|
|
223
|
-
onClick: ee,
|
|
224
|
-
disabled: _,
|
|
225
|
-
className: T.unstyled ? "" : "cedros-theme__button cedros-theme__stripe",
|
|
226
|
-
style: {
|
|
227
|
-
width: "100%",
|
|
228
|
-
cursor: _ ? "not-allowed" : "pointer",
|
|
229
|
-
opacity: _ ? 0.6 : 1
|
|
230
|
-
},
|
|
231
|
-
type: "button",
|
|
232
|
-
children: _ ? L("ui.processing") : X
|
|
233
|
-
}
|
|
234
|
-
),
|
|
235
|
-
N ? N(K) : /* @__PURE__ */ E(pe, { ...K })
|
|
236
|
-
] });
|
|
237
|
-
};
|
|
238
|
-
function Oe(t) {
|
|
239
|
-
const { resource: s, items: r, checkout: o = {}, display: n = {}, callbacks: e = {}, advanced: h = {} } = t, { config: m, walletPool: y } = Q(), l = z(), { isCartMode: i } = V(s, r), b = M.useMemo(() => ({
|
|
240
|
-
marginTop: "0.5rem",
|
|
241
|
-
fontSize: "0.875rem",
|
|
242
|
-
color: l.tokens.surfaceText,
|
|
243
|
-
opacity: 0.7,
|
|
244
|
-
textAlign: "center"
|
|
245
|
-
}), [l.tokens.surfaceText]), g = M.useMemo(
|
|
246
|
-
() => h.wallets && h.wallets.length > 0 ? h.wallets : y.getAdapters(),
|
|
247
|
-
[h.wallets, y]
|
|
248
|
-
), P = M.useMemo(
|
|
249
|
-
() => r ? Y(r) : 0,
|
|
250
|
-
[r]
|
|
251
|
-
), u = M.useMemo(
|
|
252
|
-
() => e.onPaymentSuccess ? (d) => e.onPaymentSuccess({ transactionId: d, method: "stripe" }) : void 0,
|
|
253
|
-
[e.onPaymentSuccess]
|
|
254
|
-
), c = M.useMemo(
|
|
255
|
-
() => e.onPaymentSuccess ? (d) => e.onPaymentSuccess({ transactionId: d, method: "crypto" }) : void 0,
|
|
256
|
-
[e.onPaymentSuccess]
|
|
257
|
-
), a = M.useMemo(
|
|
258
|
-
() => e.onPaymentError ? (d) => e.onPaymentError({ message: d, method: "stripe" }) : void 0,
|
|
259
|
-
[e.onPaymentError]
|
|
260
|
-
), S = M.useMemo(
|
|
261
|
-
() => e.onPaymentError ? (d) => e.onPaymentError({ message: d, method: "crypto" }) : void 0,
|
|
262
|
-
[e.onPaymentError]
|
|
263
|
-
), v = m.solanaEndpoint ?? ye(m.solanaCluster);
|
|
264
|
-
if (!s && (!r || r.length === 0))
|
|
265
|
-
return he().error('CedrosPay: Must provide either "resource" or "items" prop'), /* @__PURE__ */ E("div", { className: n.className, style: { color: l.tokens.errorText }, children: "Configuration error: No resource or items provided" });
|
|
266
|
-
const C = n.showCard ?? !0, w = n.showCrypto ?? !0, A = n.showPurchaseButton ?? !1, N = n.layout ?? "vertical", T = n.hideMessages ?? !1, D = h.autoDetectWallets ?? !0;
|
|
267
|
-
return /* @__PURE__ */ E("div", { className: l.unstyled ? n.className : l.className, style: l.unstyled ? {} : l.style, children: /* @__PURE__ */ E(se, { endpoint: v, children: /* @__PURE__ */ E(re, { wallets: g, autoConnect: !1, children: /* @__PURE__ */ E("div", { className: l.unstyled ? n.className : `cedros-theme__pay ${n.className || ""}`, children: /* @__PURE__ */ q("div", { className: l.unstyled ? "" : `cedros-theme__pay-content cedros-theme__pay-content--${N}`, children: [
|
|
268
|
-
A ? /* @__PURE__ */ E(
|
|
269
|
-
ve,
|
|
270
|
-
{
|
|
271
|
-
resource: i ? void 0 : s || r?.[0]?.resource,
|
|
272
|
-
items: i ? r : void 0,
|
|
273
|
-
label: n.purchaseLabel,
|
|
274
|
-
cardLabel: n.cardLabel,
|
|
275
|
-
cryptoLabel: n.cryptoLabel,
|
|
276
|
-
showCard: C,
|
|
277
|
-
showCrypto: w,
|
|
278
|
-
onPaymentAttempt: e.onPaymentAttempt,
|
|
279
|
-
onPaymentSuccess: u,
|
|
280
|
-
onPaymentError: a,
|
|
281
|
-
onStripeSuccess: u,
|
|
282
|
-
onCryptoSuccess: c,
|
|
283
|
-
onStripeError: a,
|
|
284
|
-
onCryptoError: S,
|
|
285
|
-
customerEmail: o.customerEmail,
|
|
286
|
-
successUrl: o.successUrl,
|
|
287
|
-
cancelUrl: o.cancelUrl,
|
|
288
|
-
metadata: o.metadata,
|
|
289
|
-
couponCode: o.couponCode,
|
|
290
|
-
autoDetectWallets: D,
|
|
291
|
-
testPageUrl: h.testPageUrl,
|
|
292
|
-
hideMessages: T,
|
|
293
|
-
renderModal: n.renderModal
|
|
294
|
-
}
|
|
295
|
-
) : /* @__PURE__ */ q(te, { children: [
|
|
296
|
-
C && /* @__PURE__ */ E(
|
|
297
|
-
me,
|
|
298
|
-
{
|
|
299
|
-
resource: i ? void 0 : s || r?.[0]?.resource,
|
|
300
|
-
items: i ? r : void 0,
|
|
301
|
-
customerEmail: o.customerEmail,
|
|
302
|
-
successUrl: o.successUrl,
|
|
303
|
-
cancelUrl: o.cancelUrl,
|
|
304
|
-
metadata: o.metadata,
|
|
305
|
-
couponCode: o.couponCode,
|
|
306
|
-
label: n.cardLabel,
|
|
307
|
-
onAttempt: e.onPaymentAttempt,
|
|
308
|
-
onSuccess: u,
|
|
309
|
-
onError: a
|
|
310
|
-
}
|
|
311
|
-
),
|
|
312
|
-
w && /* @__PURE__ */ E(
|
|
313
|
-
fe,
|
|
314
|
-
{
|
|
315
|
-
resource: i ? void 0 : s || r?.[0]?.resource,
|
|
316
|
-
items: i ? r : void 0,
|
|
317
|
-
metadata: o.metadata,
|
|
318
|
-
couponCode: o.couponCode,
|
|
319
|
-
label: n.cryptoLabel,
|
|
320
|
-
onAttempt: e.onPaymentAttempt,
|
|
321
|
-
onSuccess: c,
|
|
322
|
-
onError: S,
|
|
323
|
-
testPageUrl: h.testPageUrl,
|
|
324
|
-
hideMessages: T
|
|
325
|
-
}
|
|
326
|
-
)
|
|
327
|
-
] }),
|
|
328
|
-
i && r && r.length > 1 && !T && /* @__PURE__ */ q("div", { style: b, children: [
|
|
329
|
-
"Checking out ",
|
|
330
|
-
P,
|
|
331
|
-
" items"
|
|
332
|
-
] })
|
|
333
|
-
] }) }) }) }) });
|
|
334
|
-
}
|
|
335
|
-
function Ae() {
|
|
336
|
-
const { x402Manager: t, walletManager: s } = Q(), { publicKey: r, signTransaction: o } = oe(), [n, e] = O({
|
|
337
|
-
status: "idle",
|
|
338
|
-
error: null,
|
|
339
|
-
transactionId: null
|
|
340
|
-
}), [h, m] = O(null), [y, l] = O(null), i = k(
|
|
341
|
-
async (u) => {
|
|
342
|
-
try {
|
|
343
|
-
e((a) => ({ ...a, status: "loading" }));
|
|
344
|
-
const c = await t.requestQuote({ resource: u });
|
|
345
|
-
if (!t.validateRequirement(c))
|
|
346
|
-
throw new Error("Invalid refund requirement received from server");
|
|
347
|
-
return m(c), e((a) => ({ ...a, status: "idle" })), c;
|
|
348
|
-
} catch (c) {
|
|
349
|
-
const a = j(c, "Failed to fetch refund requirement");
|
|
350
|
-
throw e({
|
|
351
|
-
status: "error",
|
|
352
|
-
error: a,
|
|
353
|
-
transactionId: null
|
|
354
|
-
}), c;
|
|
355
|
-
}
|
|
356
|
-
},
|
|
357
|
-
[t]
|
|
358
|
-
), b = k(
|
|
359
|
-
async (u, c) => {
|
|
360
|
-
if (!r || !o)
|
|
361
|
-
throw new Error("Wallet not connected");
|
|
362
|
-
try {
|
|
363
|
-
e({
|
|
364
|
-
status: "loading",
|
|
365
|
-
error: null,
|
|
366
|
-
transactionId: null
|
|
367
|
-
});
|
|
368
|
-
const a = await t.requestQuote({ resource: u, couponCode: c });
|
|
369
|
-
if (!t.validateRequirement(a))
|
|
370
|
-
throw new Error("Invalid refund requirement received");
|
|
371
|
-
m(a);
|
|
372
|
-
const S = await s.buildTransaction({
|
|
373
|
-
requirement: a,
|
|
374
|
-
payerPublicKey: r
|
|
375
|
-
}), v = await s.signTransaction({
|
|
376
|
-
transaction: S,
|
|
377
|
-
signTransaction: o
|
|
378
|
-
}), C = s.buildPaymentPayload({
|
|
379
|
-
requirement: a,
|
|
380
|
-
signedTx: v,
|
|
381
|
-
payerPublicKey: r
|
|
382
|
-
}), w = await t.submitPayment({
|
|
383
|
-
resource: u,
|
|
384
|
-
payload: C,
|
|
385
|
-
couponCode: c,
|
|
386
|
-
metadata: void 0,
|
|
387
|
-
// no metadata for refunds
|
|
388
|
-
resourceType: "refund"
|
|
389
|
-
});
|
|
390
|
-
return w.settlement && l(w.settlement), e({
|
|
391
|
-
status: "success",
|
|
392
|
-
error: null,
|
|
393
|
-
transactionId: w.transactionId || v.signature
|
|
394
|
-
}), w;
|
|
395
|
-
} catch (a) {
|
|
396
|
-
const S = j(a, "Refund payment failed");
|
|
397
|
-
throw e({
|
|
398
|
-
status: "error",
|
|
399
|
-
error: S,
|
|
400
|
-
transactionId: null
|
|
401
|
-
}), a;
|
|
402
|
-
}
|
|
403
|
-
},
|
|
404
|
-
[r, o, t, s]
|
|
405
|
-
), g = k(
|
|
406
|
-
async (u) => {
|
|
407
|
-
if (!r || !o)
|
|
408
|
-
throw new Error("Wallet not connected");
|
|
409
|
-
try {
|
|
410
|
-
e({
|
|
411
|
-
status: "loading",
|
|
412
|
-
error: null,
|
|
413
|
-
transactionId: null
|
|
414
|
-
});
|
|
415
|
-
const c = await t.requestQuote({ resource: u });
|
|
416
|
-
if (!t.validateRequirement(c))
|
|
417
|
-
throw new Error("Invalid refund requirement received");
|
|
418
|
-
m(c);
|
|
419
|
-
const { transaction: a } = await t.buildGaslessTransaction({
|
|
420
|
-
resourceId: u,
|
|
421
|
-
userWallet: r.toString(),
|
|
422
|
-
feePayer: c.extra.feePayer
|
|
423
|
-
}), S = s.deserializeTransaction(a), v = await s.partiallySignTransaction({
|
|
424
|
-
transaction: S,
|
|
425
|
-
signTransaction: o
|
|
426
|
-
}), C = await t.submitGaslessTransaction({
|
|
427
|
-
resource: u,
|
|
428
|
-
partialTx: v,
|
|
429
|
-
couponCode: void 0,
|
|
430
|
-
// no couponCode
|
|
431
|
-
metadata: void 0,
|
|
432
|
-
// no metadata
|
|
433
|
-
resourceType: "refund",
|
|
434
|
-
requirement: c
|
|
435
|
-
});
|
|
436
|
-
return C.settlement && l(C.settlement), e({
|
|
437
|
-
status: "success",
|
|
438
|
-
error: null,
|
|
439
|
-
transactionId: C.transactionId || "gasless-refund-tx"
|
|
440
|
-
}), C;
|
|
441
|
-
} catch (c) {
|
|
442
|
-
const a = j(c, "Gasless refund payment failed");
|
|
443
|
-
throw e({
|
|
444
|
-
status: "error",
|
|
445
|
-
error: a,
|
|
446
|
-
transactionId: null
|
|
447
|
-
}), c;
|
|
448
|
-
}
|
|
449
|
-
},
|
|
450
|
-
[r, o, t, s]
|
|
451
|
-
), P = k(() => {
|
|
452
|
-
e({
|
|
453
|
-
status: "idle",
|
|
454
|
-
error: null,
|
|
455
|
-
transactionId: null
|
|
456
|
-
}), m(null), l(null);
|
|
457
|
-
}, []);
|
|
458
|
-
return {
|
|
459
|
-
state: n,
|
|
460
|
-
requirement: h,
|
|
461
|
-
settlement: y,
|
|
462
|
-
fetchRefundQuote: i,
|
|
463
|
-
processRefund: b,
|
|
464
|
-
processGaslessRefund: g,
|
|
465
|
-
reset: P
|
|
466
|
-
};
|
|
467
|
-
}
|
|
468
|
-
function Ee() {
|
|
469
|
-
if (typeof window > "u")
|
|
470
|
-
return {
|
|
471
|
-
passed: !0,
|
|
472
|
-
severity: "info",
|
|
473
|
-
message: "HTTPS check skipped (SSR environment)"
|
|
474
|
-
};
|
|
475
|
-
const t = window.location.protocol === "https:", s = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
|
|
476
|
-
return t || s ? {
|
|
477
|
-
passed: !0,
|
|
478
|
-
severity: "info",
|
|
479
|
-
message: "HTTPS enforced"
|
|
480
|
-
} : {
|
|
481
|
-
passed: !1,
|
|
482
|
-
severity: "error",
|
|
483
|
-
message: "Page not served over HTTPS",
|
|
484
|
-
recommendation: "Enable HTTPS for all payment pages. Stripe.js requires HTTPS in production."
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
function we() {
|
|
488
|
-
return typeof document > "u" ? {
|
|
489
|
-
passed: !0,
|
|
490
|
-
severity: "info",
|
|
491
|
-
message: "CSP check skipped (SSR environment)"
|
|
492
|
-
} : document.querySelector('meta[http-equiv="Content-Security-Policy"]') ? {
|
|
493
|
-
passed: !0,
|
|
494
|
-
severity: "info",
|
|
495
|
-
message: "Content Security Policy detected"
|
|
496
|
-
} : {
|
|
497
|
-
passed: !1,
|
|
498
|
-
severity: "warning",
|
|
499
|
-
message: "No Content Security Policy detected",
|
|
500
|
-
recommendation: "Configure CSP headers to protect against XSS and CDN compromise. Use generateCSP() helper from @cedros/pay-react."
|
|
501
|
-
};
|
|
502
|
-
}
|
|
503
|
-
function Te() {
|
|
504
|
-
return process.env.NODE_ENV === "development" || typeof window < "u" && window.location.hostname === "localhost" ? {
|
|
505
|
-
passed: !0,
|
|
506
|
-
severity: "info",
|
|
507
|
-
message: "Running in development mode (some security checks relaxed)"
|
|
508
|
-
} : {
|
|
509
|
-
passed: !0,
|
|
510
|
-
severity: "info",
|
|
511
|
-
message: "Running in production mode"
|
|
512
|
-
};
|
|
513
|
-
}
|
|
514
|
-
function Re() {
|
|
515
|
-
return {
|
|
516
|
-
passed: !0,
|
|
517
|
-
severity: "info",
|
|
518
|
-
message: "Stripe.js loaded via @stripe/stripe-js package (CSP recommended, not SRI)",
|
|
519
|
-
recommendation: "Ensure CSP script-src includes https://js.stripe.com"
|
|
520
|
-
};
|
|
521
|
-
}
|
|
522
|
-
function be() {
|
|
523
|
-
return typeof window > "u" ? {
|
|
524
|
-
passed: !0,
|
|
525
|
-
severity: "info",
|
|
526
|
-
message: "Mixed content check skipped (SSR environment)"
|
|
527
|
-
} : window.location.protocol === "https:" ? {
|
|
528
|
-
passed: !0,
|
|
529
|
-
severity: "info",
|
|
530
|
-
message: "Mixed content protection active (HTTPS page)"
|
|
531
|
-
} : {
|
|
532
|
-
passed: !0,
|
|
533
|
-
severity: "info",
|
|
534
|
-
message: "Mixed content check skipped (HTTP page)"
|
|
535
|
-
};
|
|
536
|
-
}
|
|
537
|
-
function De() {
|
|
538
|
-
const t = [
|
|
539
|
-
Ee(),
|
|
540
|
-
we(),
|
|
541
|
-
Te(),
|
|
542
|
-
Re(),
|
|
543
|
-
be()
|
|
544
|
-
], s = t.some((e) => e.severity === "error" && !e.passed), r = t.some((e) => e.severity === "warning" && !e.passed);
|
|
545
|
-
let o, n;
|
|
546
|
-
return s ? (o = "vulnerable", n = "Security issues detected. Review errors and apply recommendations.") : r ? (o = "warnings", n = "Minor security warnings detected. Consider applying recommendations.") : (o = "secure", n = "All security checks passed."), {
|
|
547
|
-
checks: t,
|
|
548
|
-
overallStatus: o,
|
|
549
|
-
summary: n
|
|
550
|
-
};
|
|
551
|
-
}
|
|
552
|
-
function je(t) {
|
|
553
|
-
process.env.NODE_ENV !== "production" && (console.group("🔒 Cedros Pay Security Report"), console.log(`Status: ${t.overallStatus.toUpperCase()}`), console.log(`Summary: ${t.summary}`), console.log(""), t.checks.forEach((s) => {
|
|
554
|
-
const r = s.passed ? "✅" : s.severity === "error" ? "❌" : "⚠️";
|
|
555
|
-
console.log(`${r} ${s.message}`), s.recommendation && console.log(` → ${s.recommendation}`);
|
|
556
|
-
}), console.groupEnd());
|
|
557
|
-
}
|
|
558
|
-
const He = {
|
|
559
|
-
CSP: "Use generateCSP() from @cedros/pay-react to generate Content Security Policy headers",
|
|
560
|
-
HTTPS: "Always serve payment pages over HTTPS in production",
|
|
561
|
-
PACKAGE_UPDATES: "Keep @stripe/stripe-js and @cedros/pay-react updated for security patches",
|
|
562
|
-
AUDIT: "Run npm audit regularly to check for known vulnerabilities",
|
|
563
|
-
MONITORING: "Monitor Stripe security advisories and apply updates promptly",
|
|
564
|
-
NO_SRI: "Do NOT use SRI hashes for Stripe.js - use CSP instead"
|
|
565
|
-
};
|
|
1
|
+
import { q as i, a as n, b as c, g as u, f as C, d as l, p as m, s as S, e as P, h as d, c as E, t as p, o as R, m as g, n as y, r as b, k as T, j as B, u as L, i as f, l as _, v as h } from "./index-D2d_ukkR.mjs";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
import { n as v, C as M, m as I, l as A, L as D, b as O, R as W, o as x, W as z, k as N, d as U, c as V, p as j, g as G, r as Y, u as q, a as F, v as K } from "./CedrosContext-DUT3cLZg.mjs";
|
|
5
|
+
import "@solana/web3.js";
|
|
6
|
+
import "@solana/wallet-adapter-react";
|
|
7
|
+
import { C as w, r as H, l as J, E as Q, b as Z, P as $, a as aa, S as ea, d as sa, D as ta, z as ra, i as oa, g as ia, e as na, h as ca, t as ua, s as Ca, v as la, f as ma, B as Sa, F as Pa, k as da, j as Ea, A as pa, p as Ra, y as ga, x as ya, G as ba, c as Ta, u as Ba, n as La, m as fa } from "./styles-QcAsIVWl.mjs";
|
|
566
8
|
export {
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
9
|
+
w as CEDROS_EVENTS,
|
|
10
|
+
v as CIRCUIT_BREAKER_PRESETS,
|
|
11
|
+
i as CSP_PRESETS,
|
|
12
|
+
n as CedrosPay,
|
|
13
|
+
c as CedrosPayAdminDashboard,
|
|
14
|
+
M as CedrosProvider,
|
|
15
|
+
I as CircuitBreakerOpenError,
|
|
16
|
+
A as CircuitState,
|
|
17
|
+
H as CreditsButton,
|
|
18
|
+
u as CreditsSubscribeButton,
|
|
19
|
+
J as CryptoButton,
|
|
20
|
+
C as CryptoSubscribeButton,
|
|
21
|
+
Q as ERROR_CATEGORIES,
|
|
22
|
+
D as LogLevel,
|
|
23
|
+
O as Logger,
|
|
24
|
+
Z as PaymentMethodBadge,
|
|
25
|
+
$ as PaymentModal,
|
|
26
|
+
aa as ProductPrice,
|
|
27
|
+
l as PurchaseButton,
|
|
28
|
+
W as RATE_LIMITER_PRESETS,
|
|
29
|
+
x as RETRY_PRESETS,
|
|
30
|
+
m as RPC_PROVIDERS,
|
|
31
|
+
S as SECURITY_RECOMMENDATIONS,
|
|
32
|
+
ea as StripeButton,
|
|
33
|
+
P as SubscribeButton,
|
|
34
|
+
d as SubscriptionManagementPanel,
|
|
35
|
+
z as WalletPool,
|
|
36
|
+
sa as calculateDiscountPercentage,
|
|
37
|
+
E as cedrosPayPlugin,
|
|
38
|
+
N as createCircuitBreaker,
|
|
39
|
+
U as createLogger,
|
|
40
|
+
V as createRateLimiter,
|
|
41
|
+
ta as createTranslator,
|
|
42
|
+
j as createWalletPool,
|
|
43
|
+
ra as detectLocale,
|
|
44
|
+
p as ecommerce,
|
|
45
|
+
oa as emitPaymentError,
|
|
46
|
+
ia as emitPaymentProcessing,
|
|
47
|
+
na as emitPaymentStart,
|
|
48
|
+
ca as emitPaymentSuccess,
|
|
49
|
+
ua as emitWalletConnect,
|
|
50
|
+
Ca as emitWalletConnected,
|
|
51
|
+
la as emitWalletError,
|
|
52
|
+
R as formatCSP,
|
|
53
|
+
ma as formatCouponCodes,
|
|
54
|
+
g as generateCSP,
|
|
55
|
+
y as generateCSPDirectives,
|
|
56
|
+
Sa as getAvailableLocales,
|
|
57
|
+
Pa as getLocalizedError,
|
|
58
|
+
G as getLogger,
|
|
59
|
+
da as getUserErrorMessage,
|
|
60
|
+
Ea as isRetryableError,
|
|
61
|
+
pa as loadLocale,
|
|
62
|
+
b as logSecurityReport,
|
|
63
|
+
Ra as parseCouponCodes,
|
|
64
|
+
Y as retryWithBackoff,
|
|
65
|
+
ga as stackCheckoutCoupons,
|
|
66
|
+
q as useCedrosContext,
|
|
67
|
+
F as useCedrosTheme,
|
|
68
|
+
ya as useCreditsPayment,
|
|
69
|
+
T as useCreditsSubscription,
|
|
70
|
+
B as useCryptoSubscription,
|
|
71
|
+
ba as useLocalizedError,
|
|
72
|
+
Ta as usePaymentMode,
|
|
73
|
+
L as useRefundVerification,
|
|
74
|
+
Ba as useStripeCheckout,
|
|
75
|
+
f as useSubscription,
|
|
76
|
+
_ as useSubscriptionManagement,
|
|
77
|
+
La as useTranslation,
|
|
78
|
+
fa as useX402Payment,
|
|
79
|
+
K as validateConfig,
|
|
80
|
+
h as validateSecurity
|
|
627
81
|
};
|