@commercelayer/react-components 4.20.0 → 4.21.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +3 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.cts +3266 -0
- package/lib/index.d.ts +3266 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -0
- package/package.json +27 -166
- package/lib/cjs/components/ExternalFunction.d.ts +0 -7
- package/lib/cjs/components/ExternalFunction.js +0 -2
- package/lib/cjs/components/MetadataInput.d.ts +0 -5
- package/lib/cjs/components/MetadataInput.js +0 -2
- package/lib/cjs/components/SubmitButton.d.ts +0 -10
- package/lib/cjs/components/SubmitButton.js +0 -2
- package/lib/cjs/components/addresses/Address.d.ts +0 -31
- package/lib/cjs/components/addresses/Address.js +0 -2
- package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +0 -34
- package/lib/cjs/components/addresses/AddressCountrySelector.js +0 -2
- package/lib/cjs/components/addresses/AddressField.d.ts +0 -61
- package/lib/cjs/components/addresses/AddressField.js +0 -2
- package/lib/cjs/components/addresses/AddressInput.d.ts +0 -34
- package/lib/cjs/components/addresses/AddressInput.js +0 -2
- package/lib/cjs/components/addresses/AddressInputSelect.d.ts +0 -29
- package/lib/cjs/components/addresses/AddressInputSelect.js +0 -2
- package/lib/cjs/components/addresses/AddressStateSelector.d.ts +0 -36
- package/lib/cjs/components/addresses/AddressStateSelector.js +0 -2
- package/lib/cjs/components/addresses/AddressesContainer.d.ts +0 -40
- package/lib/cjs/components/addresses/AddressesContainer.js +0 -2
- package/lib/cjs/components/addresses/AddressesEmpty.d.ts +0 -26
- package/lib/cjs/components/addresses/AddressesEmpty.js +0 -2
- package/lib/cjs/components/addresses/BillingAddressContainer.d.ts +0 -6
- package/lib/cjs/components/addresses/BillingAddressContainer.js +0 -2
- package/lib/cjs/components/addresses/BillingAddressForm.d.ts +0 -34
- package/lib/cjs/components/addresses/BillingAddressForm.js +0 -2
- package/lib/cjs/components/addresses/SaveAddressesButton.d.ts +0 -18
- package/lib/cjs/components/addresses/SaveAddressesButton.js +0 -2
- package/lib/cjs/components/addresses/ShippingAddressContainer.d.ts +0 -7
- package/lib/cjs/components/addresses/ShippingAddressContainer.js +0 -2
- package/lib/cjs/components/addresses/ShippingAddressForm.d.ts +0 -31
- package/lib/cjs/components/addresses/ShippingAddressForm.js +0 -2
- package/lib/cjs/components/auth/CommerceLayer.d.ts +0 -25
- package/lib/cjs/components/auth/CommerceLayer.js +0 -2
- package/lib/cjs/components/customers/CustomerAddressForm.d.ts +0 -13
- package/lib/cjs/components/customers/CustomerAddressForm.js +0 -2
- package/lib/cjs/components/customers/CustomerContainer.d.ts +0 -38
- package/lib/cjs/components/customers/CustomerContainer.js +0 -2
- package/lib/cjs/components/customers/CustomerField.d.ts +0 -25
- package/lib/cjs/components/customers/CustomerField.js +0 -2
- package/lib/cjs/components/customers/CustomerInput.d.ts +0 -11
- package/lib/cjs/components/customers/CustomerInput.js +0 -2
- package/lib/cjs/components/customers/CustomerPaymentSource.d.ts +0 -11
- package/lib/cjs/components/customers/CustomerPaymentSource.js +0 -2
- package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.d.ts +0 -14
- package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.js +0 -2
- package/lib/cjs/components/customers/MyAccountLink.d.ts +0 -38
- package/lib/cjs/components/customers/MyAccountLink.js +0 -2
- package/lib/cjs/components/customers/MyIdentityLink.d.ts +0 -59
- package/lib/cjs/components/customers/MyIdentityLink.js +0 -2
- package/lib/cjs/components/customers/SaveCustomerButton.d.ts +0 -12
- package/lib/cjs/components/customers/SaveCustomerButton.js +0 -2
- package/lib/cjs/components/errors/Errors.d.ts +0 -31
- package/lib/cjs/components/errors/Errors.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCard.d.ts +0 -10
- package/lib/cjs/components/gift_cards/GiftCard.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardContainer.d.ts +0 -6
- package/lib/cjs/components/gift_cards/GiftCardContainer.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +0 -7
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +0 -7
- package/lib/cjs/components/gift_cards/GiftCardInput.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.d.ts +0 -16
- package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.d.ts +0 -15
- package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +0 -11
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +0 -20
- package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.d.ts +0 -10
- package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardRecipientInput.d.ts +0 -0
- package/lib/cjs/components/gift_cards/GiftCardRecipientInput.js +0 -2
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +0 -36
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.js +0 -2
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +0 -10
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.js +0 -2
- package/lib/cjs/components/line_items/LineItem.d.ts +0 -8
- package/lib/cjs/components/line_items/LineItem.js +0 -2
- package/lib/cjs/components/line_items/LineItemAmount.d.ts +0 -7
- package/lib/cjs/components/line_items/LineItemAmount.js +0 -2
- package/lib/cjs/components/line_items/LineItemCode.d.ts +0 -13
- package/lib/cjs/components/line_items/LineItemCode.js +0 -2
- package/lib/cjs/components/line_items/LineItemField.d.ts +0 -14
- package/lib/cjs/components/line_items/LineItemField.js +0 -2
- package/lib/cjs/components/line_items/LineItemImage.d.ts +0 -17
- package/lib/cjs/components/line_items/LineItemImage.js +0 -2
- package/lib/cjs/components/line_items/LineItemName.d.ts +0 -12
- package/lib/cjs/components/line_items/LineItemName.js +0 -2
- package/lib/cjs/components/line_items/LineItemOption.d.ts +0 -19
- package/lib/cjs/components/line_items/LineItemOption.js +0 -2
- package/lib/cjs/components/line_items/LineItemOptions.d.ts +0 -16
- package/lib/cjs/components/line_items/LineItemOptions.js +0 -2
- package/lib/cjs/components/line_items/LineItemQuantity.d.ts +0 -21
- package/lib/cjs/components/line_items/LineItemQuantity.js +0 -2
- package/lib/cjs/components/line_items/LineItemRemoveLink.d.ts +0 -14
- package/lib/cjs/components/line_items/LineItemRemoveLink.js +0 -2
- package/lib/cjs/components/line_items/LineItemsContainer.d.ts +0 -9
- package/lib/cjs/components/line_items/LineItemsContainer.js +0 -2
- package/lib/cjs/components/line_items/LineItemsCount.d.ts +0 -12
- package/lib/cjs/components/line_items/LineItemsCount.js +0 -2
- package/lib/cjs/components/line_items/LineItemsEmpty.d.ts +0 -12
- package/lib/cjs/components/line_items/LineItemsEmpty.js +0 -2
- package/lib/cjs/components/orders/AddToCartButton.d.ts +0 -95
- package/lib/cjs/components/orders/AddToCartButton.js +0 -2
- package/lib/cjs/components/orders/AdjustmentAmount.d.ts +0 -4
- package/lib/cjs/components/orders/AdjustmentAmount.js +0 -2
- package/lib/cjs/components/orders/CartLink.d.ts +0 -47
- package/lib/cjs/components/orders/CartLink.js +0 -2
- package/lib/cjs/components/orders/CheckoutLink.d.ts +0 -28
- package/lib/cjs/components/orders/CheckoutLink.js +0 -2
- package/lib/cjs/components/orders/DiscountAmount.d.ts +0 -4
- package/lib/cjs/components/orders/DiscountAmount.js +0 -2
- package/lib/cjs/components/orders/GiftCardAmount.d.ts +0 -4
- package/lib/cjs/components/orders/GiftCardAmount.js +0 -2
- package/lib/cjs/components/orders/HostedCart.d.ts +0 -58
- package/lib/cjs/components/orders/HostedCart.js +0 -2
- package/lib/cjs/components/orders/OrderContainer.d.ts +0 -58
- package/lib/cjs/components/orders/OrderContainer.js +0 -2
- package/lib/cjs/components/orders/OrderList.d.ts +0 -83
- package/lib/cjs/components/orders/OrderList.js +0 -2
- package/lib/cjs/components/orders/OrderListEmpty.d.ts +0 -17
- package/lib/cjs/components/orders/OrderListEmpty.js +0 -2
- package/lib/cjs/components/orders/OrderListPaginationButtons.d.ts +0 -48
- package/lib/cjs/components/orders/OrderListPaginationButtons.js +0 -2
- package/lib/cjs/components/orders/OrderListPaginationInfo.d.ts +0 -29
- package/lib/cjs/components/orders/OrderListPaginationInfo.js +0 -2
- package/lib/cjs/components/orders/OrderListRow.d.ts +0 -29
- package/lib/cjs/components/orders/OrderListRow.js +0 -2
- package/lib/cjs/components/orders/OrderNumber.d.ts +0 -5
- package/lib/cjs/components/orders/OrderNumber.js +0 -2
- package/lib/cjs/components/orders/OrderStorage.d.ts +0 -31
- package/lib/cjs/components/orders/OrderStorage.js +0 -2
- package/lib/cjs/components/orders/PaymentMethodAmount.d.ts +0 -4
- package/lib/cjs/components/orders/PaymentMethodAmount.js +0 -2
- package/lib/cjs/components/orders/PlaceOrderButton.d.ts +0 -35
- package/lib/cjs/components/orders/PlaceOrderButton.js +0 -2
- package/lib/cjs/components/orders/PlaceOrderContainer.d.ts +0 -8
- package/lib/cjs/components/orders/PlaceOrderContainer.js +0 -2
- package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.d.ts +0 -4
- package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.js +0 -2
- package/lib/cjs/components/orders/ShippingAmount.d.ts +0 -4
- package/lib/cjs/components/orders/ShippingAmount.js +0 -2
- package/lib/cjs/components/orders/SubTotalAmount.d.ts +0 -4
- package/lib/cjs/components/orders/SubTotalAmount.js +0 -2
- package/lib/cjs/components/orders/TaxesAmount.d.ts +0 -4
- package/lib/cjs/components/orders/TaxesAmount.js +0 -2
- package/lib/cjs/components/orders/TotalAmount.d.ts +0 -4
- package/lib/cjs/components/orders/TotalAmount.js +0 -2
- package/lib/cjs/components/parcels/ParcelField.d.ts +0 -14
- package/lib/cjs/components/parcels/ParcelField.js +0 -2
- package/lib/cjs/components/parcels/ParcelLineItem.d.ts +0 -7
- package/lib/cjs/components/parcels/ParcelLineItem.js +0 -2
- package/lib/cjs/components/parcels/ParcelLineItemField.d.ts +0 -14
- package/lib/cjs/components/parcels/ParcelLineItemField.js +0 -2
- package/lib/cjs/components/parcels/ParcelLineItemsCount.d.ts +0 -18
- package/lib/cjs/components/parcels/ParcelLineItemsCount.js +0 -2
- package/lib/cjs/components/parcels/Parcels.d.ts +0 -7
- package/lib/cjs/components/parcels/Parcels.js +0 -2
- package/lib/cjs/components/parcels/ParcelsCount.d.ts +0 -18
- package/lib/cjs/components/parcels/ParcelsCount.js +0 -2
- package/lib/cjs/components/payment_gateways/AdyenGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/AdyenGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/BraintreeGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/BraintreeGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/CheckoutComGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/CheckoutComGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/ExternalGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/ExternalGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/KlarnaGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/KlarnaGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +0 -16
- package/lib/cjs/components/payment_gateways/PaymentGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/PaypalGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/PaypalGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/StripeGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/StripeGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/WireTransferGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/WireTransferGateway.js +0 -2
- package/lib/cjs/components/payment_methods/PaymentMethod.d.ts +0 -45
- package/lib/cjs/components/payment_methods/PaymentMethod.js +0 -2
- package/lib/cjs/components/payment_methods/PaymentMethodName.d.ts +0 -10
- package/lib/cjs/components/payment_methods/PaymentMethodName.js +0 -2
- package/lib/cjs/components/payment_methods/PaymentMethodPrice.d.ts +0 -8
- package/lib/cjs/components/payment_methods/PaymentMethodPrice.js +0 -2
- package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.d.ts +0 -17
- package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.js +0 -2
- package/lib/cjs/components/payment_methods/PaymentMethodsContainer.d.ts +0 -8
- package/lib/cjs/components/payment_methods/PaymentMethodsContainer.js +0 -2
- package/lib/cjs/components/payment_source/AdyenPayment.d.ts +0 -54
- package/lib/cjs/components/payment_source/AdyenPayment.js +0 -2
- package/lib/cjs/components/payment_source/BraintreePayment.d.ts +0 -32
- package/lib/cjs/components/payment_source/BraintreePayment.js +0 -2
- package/lib/cjs/components/payment_source/CheckoutComPayment.d.ts +0 -23
- package/lib/cjs/components/payment_source/CheckoutComPayment.js +0 -2
- package/lib/cjs/components/payment_source/ExternalPayment.d.ts +0 -24
- package/lib/cjs/components/payment_source/ExternalPayment.js +0 -2
- package/lib/cjs/components/payment_source/KlarnaPayment.d.ts +0 -10
- package/lib/cjs/components/payment_source/KlarnaPayment.js +0 -2
- package/lib/cjs/components/payment_source/PaymentSource.d.ts +0 -19
- package/lib/cjs/components/payment_source/PaymentSource.js +0 -2
- package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.d.ts +0 -15
- package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.js +0 -2
- package/lib/cjs/components/payment_source/PaymentSourceBrandName.d.ts +0 -12
- package/lib/cjs/components/payment_source/PaymentSourceBrandName.js +0 -2
- package/lib/cjs/components/payment_source/PaymentSourceDetail.d.ts +0 -15
- package/lib/cjs/components/payment_source/PaymentSourceDetail.js +0 -2
- package/lib/cjs/components/payment_source/PaymentSourceEditButton.d.ts +0 -10
- package/lib/cjs/components/payment_source/PaymentSourceEditButton.js +0 -2
- package/lib/cjs/components/payment_source/PaypalPayment.d.ts +0 -12
- package/lib/cjs/components/payment_source/PaypalPayment.js +0 -2
- package/lib/cjs/components/payment_source/StripeExpressPayment.d.ts +0 -6
- package/lib/cjs/components/payment_source/StripeExpressPayment.js +0 -2
- package/lib/cjs/components/payment_source/StripePayment.d.ts +0 -21
- package/lib/cjs/components/payment_source/StripePayment.js +0 -2
- package/lib/cjs/components/payment_source/WireTransferPayment.d.ts +0 -12
- package/lib/cjs/components/payment_source/WireTransferPayment.js +0 -2
- package/lib/cjs/components/prices/Price.d.ts +0 -35
- package/lib/cjs/components/prices/Price.js +0 -2
- package/lib/cjs/components/prices/PricesContainer.d.ts +0 -41
- package/lib/cjs/components/prices/PricesContainer.js +0 -2
- package/lib/cjs/components/shipments/Shipment.d.ts +0 -10
- package/lib/cjs/components/shipments/Shipment.js +0 -2
- package/lib/cjs/components/shipments/ShipmentField.d.ts +0 -12
- package/lib/cjs/components/shipments/ShipmentField.js +0 -2
- package/lib/cjs/components/shipments/ShipmentsContainer.d.ts +0 -6
- package/lib/cjs/components/shipments/ShipmentsContainer.js +0 -2
- package/lib/cjs/components/shipments/ShipmentsCount.d.ts +0 -18
- package/lib/cjs/components/shipments/ShipmentsCount.js +0 -2
- package/lib/cjs/components/shipping_methods/ShippingMethod.d.ts +0 -8
- package/lib/cjs/components/shipping_methods/ShippingMethod.js +0 -2
- package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +0 -11
- package/lib/cjs/components/shipping_methods/ShippingMethodName.js +0 -2
- package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +0 -20
- package/lib/cjs/components/shipping_methods/ShippingMethodPrice.js +0 -2
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.d.ts +0 -17
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.js +0 -2
- package/lib/cjs/components/skus/AvailabilityContainer.d.ts +0 -34
- package/lib/cjs/components/skus/AvailabilityContainer.js +0 -2
- package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +0 -52
- package/lib/cjs/components/skus/AvailabilityTemplate.js +0 -2
- package/lib/cjs/components/skus/DeliveryLeadTime.d.ts +0 -10
- package/lib/cjs/components/skus/DeliveryLeadTime.js +0 -2
- package/lib/cjs/components/skus/SkuField.d.ts +0 -25
- package/lib/cjs/components/skus/SkuField.js +0 -2
- package/lib/cjs/components/skus/SkuList.d.ts +0 -10
- package/lib/cjs/components/skus/SkuList.js +0 -2
- package/lib/cjs/components/skus/SkuListsContainer.d.ts +0 -6
- package/lib/cjs/components/skus/SkuListsContainer.js +0 -2
- package/lib/cjs/components/skus/Skus.d.ts +0 -18
- package/lib/cjs/components/skus/Skus.js +0 -2
- package/lib/cjs/components/skus/SkusContainer.d.ts +0 -31
- package/lib/cjs/components/skus/SkusContainer.js +0 -2
- package/lib/cjs/components/stock_transfers/StockTransfer.d.ts +0 -7
- package/lib/cjs/components/stock_transfers/StockTransfer.js +0 -2
- package/lib/cjs/components/stock_transfers/StockTransferField.d.ts +0 -10
- package/lib/cjs/components/stock_transfers/StockTransferField.js +0 -2
- package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +0 -26
- package/lib/cjs/components/utils/AddressCardsTemplate.js +0 -2
- package/lib/cjs/components/utils/BaseField.d.ts +0 -8
- package/lib/cjs/components/utils/BaseField.js +0 -2
- package/lib/cjs/components/utils/BaseInput.d.ts +0 -5
- package/lib/cjs/components/utils/BaseInput.js +0 -2
- package/lib/cjs/components/utils/BaseOrderPrice.d.ts +0 -6
- package/lib/cjs/components/utils/BaseOrderPrice.js +0 -2
- package/lib/cjs/components/utils/BaseSelect.d.ts +0 -5
- package/lib/cjs/components/utils/BaseSelect.js +0 -2
- package/lib/cjs/components/utils/ErrorBoundary.d.ts +0 -14
- package/lib/cjs/components/utils/ErrorBoundary.js +0 -2
- package/lib/cjs/components/utils/GenericFieldComponent.d.ts +0 -58
- package/lib/cjs/components/utils/GenericFieldComponent.js +0 -2
- package/lib/cjs/components/utils/Parent.d.ts +0 -6
- package/lib/cjs/components/utils/Parent.js +0 -2
- package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +0 -41
- package/lib/cjs/components/utils/PaymentCardsTemplate.js +0 -2
- package/lib/cjs/components/utils/PriceTemplate.d.ts +0 -8
- package/lib/cjs/components/utils/PriceTemplate.js +0 -2
- package/lib/cjs/components/utils/getAllErrors.d.ts +0 -16
- package/lib/cjs/components/utils/getAllErrors.js +0 -2
- package/lib/cjs/config/currency.d.ts +0 -5
- package/lib/cjs/config/currency.js +0 -2
- package/lib/cjs/context/AddressChildrenContext.d.ts +0 -6
- package/lib/cjs/context/AddressChildrenContext.js +0 -2
- package/lib/cjs/context/AddressContext.d.ts +0 -18
- package/lib/cjs/context/AddressContext.js +0 -2
- package/lib/cjs/context/AvailabilityContext.d.ts +0 -2
- package/lib/cjs/context/AvailabilityContext.js +0 -2
- package/lib/cjs/context/BillingAddressContext.d.ts +0 -9
- package/lib/cjs/context/BillingAddressContext.js +0 -2
- package/lib/cjs/context/BillingAddressFormContext.d.ts +0 -22
- package/lib/cjs/context/BillingAddressFormContext.js +0 -2
- package/lib/cjs/context/CommerceLayerContext.d.ts +0 -6
- package/lib/cjs/context/CommerceLayerContext.js +0 -2
- package/lib/cjs/context/CouponAndGiftCardFormContext.d.ts +0 -8
- package/lib/cjs/context/CouponAndGiftCardFormContext.js +0 -2
- package/lib/cjs/context/CustomerAddressFormContext.d.ts +0 -17
- package/lib/cjs/context/CustomerAddressFormContext.js +0 -2
- package/lib/cjs/context/CustomerContext.d.ts +0 -29
- package/lib/cjs/context/CustomerContext.js +0 -2
- package/lib/cjs/context/CustomerPaymentSourceContext.d.ts +0 -11
- package/lib/cjs/context/CustomerPaymentSourceContext.js +0 -2
- package/lib/cjs/context/ExternalFunctionContext.d.ts +0 -11
- package/lib/cjs/context/ExternalFunctionContext.js +0 -2
- package/lib/cjs/context/GiftCardContext.d.ts +0 -10
- package/lib/cjs/context/GiftCardContext.js +0 -2
- package/lib/cjs/context/InStockSubscriptionContext.d.ts +0 -6
- package/lib/cjs/context/InStockSubscriptionContext.js +0 -2
- package/lib/cjs/context/LineItemChildrenContext.d.ts +0 -8
- package/lib/cjs/context/LineItemChildrenContext.js +0 -2
- package/lib/cjs/context/LineItemContext.d.ts +0 -7
- package/lib/cjs/context/LineItemContext.js +0 -2
- package/lib/cjs/context/LineItemOptionChildrenContext.d.ts +0 -9
- package/lib/cjs/context/LineItemOptionChildrenContext.js +0 -2
- package/lib/cjs/context/OrderContext.d.ts +0 -28
- package/lib/cjs/context/OrderContext.js +0 -2
- package/lib/cjs/context/OrderListChildrenContext.d.ts +0 -73
- package/lib/cjs/context/OrderListChildrenContext.js +0 -2
- package/lib/cjs/context/OrderListPaginationContext.d.ts +0 -15
- package/lib/cjs/context/OrderListPaginationContext.js +0 -2
- package/lib/cjs/context/OrderStorageContext.d.ts +0 -10
- package/lib/cjs/context/OrderStorageContext.js +0 -2
- package/lib/cjs/context/ParcelChildrenContext.d.ts +0 -6
- package/lib/cjs/context/ParcelChildrenContext.js +0 -2
- package/lib/cjs/context/ParcelLineItemChildrenContext.d.ts +0 -6
- package/lib/cjs/context/ParcelLineItemChildrenContext.js +0 -2
- package/lib/cjs/context/PaymentMethodChildrenContext.d.ts +0 -10
- package/lib/cjs/context/PaymentMethodChildrenContext.js +0 -2
- package/lib/cjs/context/PaymentMethodContext.d.ts +0 -13
- package/lib/cjs/context/PaymentMethodContext.js +0 -2
- package/lib/cjs/context/PaymentSourceContext.d.ts +0 -14
- package/lib/cjs/context/PaymentSourceContext.js +0 -2
- package/lib/cjs/context/PlaceOrderContext.d.ts +0 -12
- package/lib/cjs/context/PlaceOrderContext.js +0 -2
- package/lib/cjs/context/PricesContext.d.ts +0 -6
- package/lib/cjs/context/PricesContext.js +0 -2
- package/lib/cjs/context/ShipmentChildrenContext.d.ts +0 -13
- package/lib/cjs/context/ShipmentChildrenContext.js +0 -2
- package/lib/cjs/context/ShipmentContext.d.ts +0 -10
- package/lib/cjs/context/ShipmentContext.js +0 -2
- package/lib/cjs/context/ShippingAddressContext.d.ts +0 -9
- package/lib/cjs/context/ShippingAddressContext.js +0 -2
- package/lib/cjs/context/ShippingAddressFormContext.d.ts +0 -3
- package/lib/cjs/context/ShippingAddressFormContext.js +0 -2
- package/lib/cjs/context/ShippingMethodChildrenContext.d.ts +0 -9
- package/lib/cjs/context/ShippingMethodChildrenContext.js +0 -2
- package/lib/cjs/context/SkuChildrenContext.d.ts +0 -8
- package/lib/cjs/context/SkuChildrenContext.js +0 -2
- package/lib/cjs/context/SkuContext.d.ts +0 -8
- package/lib/cjs/context/SkuContext.js +0 -2
- package/lib/cjs/context/SkuListsContext.d.ts +0 -5
- package/lib/cjs/context/SkuListsContext.js +0 -2
- package/lib/cjs/context/StockTransferChildrenContext.d.ts +0 -6
- package/lib/cjs/context/StockTransferChildrenContext.js +0 -2
- package/lib/cjs/hooks/useCommerceLayer.d.ts +0 -12
- package/lib/cjs/hooks/useCommerceLayer.js +0 -2
- package/lib/cjs/hooks/useCustomerContainer.d.ts +0 -12
- package/lib/cjs/hooks/useCustomerContainer.js +0 -2
- package/lib/cjs/hooks/useOrderContainer.d.ts +0 -16
- package/lib/cjs/hooks/useOrderContainer.js +0 -2
- package/lib/cjs/index.d.ts +0 -107
- package/lib/cjs/index.js +0 -2
- package/lib/cjs/reducers/AddressReducer.d.ts +0 -80
- package/lib/cjs/reducers/AddressReducer.js +0 -2
- package/lib/cjs/reducers/AvailabilityReducer.d.ts +0 -53
- package/lib/cjs/reducers/AvailabilityReducer.js +0 -2
- package/lib/cjs/reducers/BillingAddressReducer.d.ts +0 -31
- package/lib/cjs/reducers/BillingAddressReducer.js +0 -2
- package/lib/cjs/reducers/CustomerReducer.d.ts +0 -183
- package/lib/cjs/reducers/CustomerReducer.js +0 -2
- package/lib/cjs/reducers/GiftCardReducer.d.ts +0 -66
- package/lib/cjs/reducers/GiftCardReducer.js +0 -2
- package/lib/cjs/reducers/InStockSubscriptionReducer.d.ts +0 -33
- package/lib/cjs/reducers/InStockSubscriptionReducer.js +0 -2
- package/lib/cjs/reducers/LineItemReducer.d.ts +0 -47
- package/lib/cjs/reducers/LineItemReducer.js +0 -2
- package/lib/cjs/reducers/OrderReducer.d.ts +0 -157
- package/lib/cjs/reducers/OrderReducer.js +0 -2
- package/lib/cjs/reducers/PaymentMethodReducer.d.ts +0 -161
- package/lib/cjs/reducers/PaymentMethodReducer.js +0 -2
- package/lib/cjs/reducers/PlaceOrderReducer.d.ts +0 -72
- package/lib/cjs/reducers/PlaceOrderReducer.js +0 -2
- package/lib/cjs/reducers/PriceReducer.d.ts +0 -35
- package/lib/cjs/reducers/PriceReducer.js +0 -2
- package/lib/cjs/reducers/ShipmentReducer.d.ts +0 -41
- package/lib/cjs/reducers/ShipmentReducer.js +0 -2
- package/lib/cjs/reducers/ShippingAddressReducer.d.ts +0 -32
- package/lib/cjs/reducers/ShippingAddressReducer.js +0 -2
- package/lib/cjs/reducers/SkuListsReducer.d.ts +0 -21
- package/lib/cjs/reducers/SkuListsReducer.js +0 -2
- package/lib/cjs/reducers/SkuReducer.d.ts +0 -21
- package/lib/cjs/reducers/SkuReducer.js +0 -2
- package/lib/cjs/typings/errors.d.ts +0 -15
- package/lib/cjs/typings/errors.js +0 -2
- package/lib/cjs/typings/globals.d.ts +0 -6
- package/lib/cjs/typings/globals.js +0 -2
- package/lib/cjs/typings/index.d.ts +0 -117
- package/lib/cjs/typings/index.js +0 -2
- package/lib/cjs/utils/PropsType.d.ts +0 -33
- package/lib/cjs/utils/PropsType.js +0 -2
- package/lib/cjs/utils/addressesManager.d.ts +0 -64
- package/lib/cjs/utils/addressesManager.js +0 -2
- package/lib/cjs/utils/baseReducer.d.ts +0 -3
- package/lib/cjs/utils/baseReducer.js +0 -2
- package/lib/cjs/utils/browserInfo.d.ts +0 -12
- package/lib/cjs/utils/browserInfo.js +0 -2
- package/lib/cjs/utils/canPlaceOrder.d.ts +0 -5
- package/lib/cjs/utils/canPlaceOrder.js +0 -2
- package/lib/cjs/utils/checkIncludeResource.d.ts +0 -8
- package/lib/cjs/utils/checkIncludeResource.js +0 -2
- package/lib/cjs/utils/compareObjAttribute.d.ts +0 -7
- package/lib/cjs/utils/compareObjAttribute.js +0 -2
- package/lib/cjs/utils/countryStateCity.d.ts +0 -801
- package/lib/cjs/utils/countryStateCity.js +0 -2
- package/lib/cjs/utils/customMessages.d.ts +0 -2
- package/lib/cjs/utils/customMessages.js +0 -2
- package/lib/cjs/utils/customerOrderOptions.d.ts +0 -3
- package/lib/cjs/utils/customerOrderOptions.js +0 -2
- package/lib/cjs/utils/events.d.ts +0 -5
- package/lib/cjs/utils/events.js +0 -2
- package/lib/cjs/utils/expressPaymentHelper.d.ts +0 -92
- package/lib/cjs/utils/expressPaymentHelper.js +0 -2
- package/lib/cjs/utils/filterChildren.d.ts +0 -12
- package/lib/cjs/utils/filterChildren.js +0 -2
- package/lib/cjs/utils/formCleaner.d.ts +0 -4
- package/lib/cjs/utils/formCleaner.js +0 -2
- package/lib/cjs/utils/getAmount.d.ts +0 -7
- package/lib/cjs/utils/getAmount.js +0 -2
- package/lib/cjs/utils/getApplicationLink.d.ts +0 -35
- package/lib/cjs/utils/getApplicationLink.js +0 -2
- package/lib/cjs/utils/getCardDetails.d.ts +0 -16
- package/lib/cjs/utils/getCardDetails.js +0 -2
- package/lib/cjs/utils/getCustomerIdByToken.d.ts +0 -6
- package/lib/cjs/utils/getCustomerIdByToken.js +0 -2
- package/lib/cjs/utils/getDomain.d.ts +0 -4
- package/lib/cjs/utils/getDomain.js +0 -2
- package/lib/cjs/utils/getErrors.d.ts +0 -19
- package/lib/cjs/utils/getErrors.js +0 -2
- package/lib/cjs/utils/getLineItemsCount.d.ts +0 -10
- package/lib/cjs/utils/getLineItemsCount.js +0 -2
- package/lib/cjs/utils/getLoaderComponent.d.ts +0 -3
- package/lib/cjs/utils/getLoaderComponent.js +0 -2
- package/lib/cjs/utils/getPaymentAttributes.d.ts +0 -17
- package/lib/cjs/utils/getPaymentAttributes.js +0 -2
- package/lib/cjs/utils/getPrices.d.ts +0 -6
- package/lib/cjs/utils/getPrices.js +0 -2
- package/lib/cjs/utils/getPublicIp.d.ts +0 -1
- package/lib/cjs/utils/getPublicIp.js +0 -2
- package/lib/cjs/utils/getSdk.d.ts +0 -3
- package/lib/cjs/utils/getSdk.js +0 -2
- package/lib/cjs/utils/getSkus.d.ts +0 -3
- package/lib/cjs/utils/getSkus.js +0 -2
- package/lib/cjs/utils/hasSubscriptions.d.ts +0 -7
- package/lib/cjs/utils/hasSubscriptions.js +0 -2
- package/lib/cjs/utils/hooks/useCustomContext.d.ts +0 -21
- package/lib/cjs/utils/hooks/useCustomContext.js +0 -2
- package/lib/cjs/utils/hooks/useExternalScript.d.ts +0 -1
- package/lib/cjs/utils/hooks/useExternalScript.js +0 -2
- package/lib/cjs/utils/icons.d.ts +0 -2
- package/lib/cjs/utils/icons.js +0 -2
- package/lib/cjs/utils/isDate.d.ts +0 -1
- package/lib/cjs/utils/isDate.js +0 -2
- package/lib/cjs/utils/isEmpty.d.ts +0 -1
- package/lib/cjs/utils/isEmpty.js +0 -2
- package/lib/cjs/utils/isGuestToken.d.ts +0 -6
- package/lib/cjs/utils/isGuestToken.js +0 -2
- package/lib/cjs/utils/isJSON.d.ts +0 -1
- package/lib/cjs/utils/isJSON.js +0 -2
- package/lib/cjs/utils/jwt.d.ts +0 -27
- package/lib/cjs/utils/jwt.js +0 -2
- package/lib/cjs/utils/localStorage.d.ts +0 -11
- package/lib/cjs/utils/localStorage.js +0 -2
- package/lib/cjs/utils/omit.d.ts +0 -1
- package/lib/cjs/utils/omit.js +0 -2
- package/lib/cjs/utils/organization.d.ts +0 -18
- package/lib/cjs/utils/organization.js +0 -2
- package/lib/cjs/utils/payment-methods/sortPaymentMethods.d.ts +0 -2
- package/lib/cjs/utils/payment-methods/sortPaymentMethods.js +0 -2
- package/lib/cjs/utils/pick.d.ts +0 -1
- package/lib/cjs/utils/pick.js +0 -2
- package/lib/cjs/utils/placeholderImages.d.ts +0 -2
- package/lib/cjs/utils/placeholderImages.js +0 -2
- package/lib/cjs/utils/promisify.d.ts +0 -1
- package/lib/cjs/utils/promisify.js +0 -2
- package/lib/cjs/utils/replace.d.ts +0 -2
- package/lib/cjs/utils/replace.js +0 -2
- package/lib/cjs/utils/scrollbarWidth.d.ts +0 -1
- package/lib/cjs/utils/scrollbarWidth.js +0 -2
- package/lib/cjs/utils/shipments.d.ts +0 -3
- package/lib/cjs/utils/shipments.js +0 -2
- package/lib/cjs/utils/snakeToCamelCase.d.ts +0 -5
- package/lib/cjs/utils/snakeToCamelCase.js +0 -2
- package/lib/cjs/utils/stripe/retrievePaymentIntent.d.ts +0 -14
- package/lib/cjs/utils/stripe/retrievePaymentIntent.js +0 -2
- package/lib/cjs/utils/triggerAttributeHelper.d.ts +0 -31
- package/lib/cjs/utils/triggerAttributeHelper.js +0 -2
- package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +0 -8
- package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.js +0 -2
- package/lib/cjs/utils/validateFormFields.d.ts +0 -16
- package/lib/cjs/utils/validateFormFields.js +0 -2
- package/lib/esm/components/ExternalFunction.d.ts +0 -7
- package/lib/esm/components/ExternalFunction.js +0 -2
- package/lib/esm/components/MetadataInput.d.ts +0 -5
- package/lib/esm/components/MetadataInput.js +0 -2
- package/lib/esm/components/SubmitButton.d.ts +0 -10
- package/lib/esm/components/SubmitButton.js +0 -2
- package/lib/esm/components/addresses/Address.d.ts +0 -31
- package/lib/esm/components/addresses/Address.js +0 -2
- package/lib/esm/components/addresses/AddressCountrySelector.d.ts +0 -34
- package/lib/esm/components/addresses/AddressCountrySelector.js +0 -2
- package/lib/esm/components/addresses/AddressField.d.ts +0 -61
- package/lib/esm/components/addresses/AddressField.js +0 -2
- package/lib/esm/components/addresses/AddressInput.d.ts +0 -34
- package/lib/esm/components/addresses/AddressInput.js +0 -2
- package/lib/esm/components/addresses/AddressInputSelect.d.ts +0 -29
- package/lib/esm/components/addresses/AddressInputSelect.js +0 -2
- package/lib/esm/components/addresses/AddressStateSelector.d.ts +0 -36
- package/lib/esm/components/addresses/AddressStateSelector.js +0 -2
- package/lib/esm/components/addresses/AddressesContainer.d.ts +0 -40
- package/lib/esm/components/addresses/AddressesContainer.js +0 -2
- package/lib/esm/components/addresses/AddressesEmpty.d.ts +0 -26
- package/lib/esm/components/addresses/AddressesEmpty.js +0 -2
- package/lib/esm/components/addresses/BillingAddressContainer.d.ts +0 -6
- package/lib/esm/components/addresses/BillingAddressContainer.js +0 -2
- package/lib/esm/components/addresses/BillingAddressForm.d.ts +0 -34
- package/lib/esm/components/addresses/BillingAddressForm.js +0 -2
- package/lib/esm/components/addresses/SaveAddressesButton.d.ts +0 -18
- package/lib/esm/components/addresses/SaveAddressesButton.js +0 -2
- package/lib/esm/components/addresses/ShippingAddressContainer.d.ts +0 -7
- package/lib/esm/components/addresses/ShippingAddressContainer.js +0 -2
- package/lib/esm/components/addresses/ShippingAddressForm.d.ts +0 -31
- package/lib/esm/components/addresses/ShippingAddressForm.js +0 -2
- package/lib/esm/components/auth/CommerceLayer.d.ts +0 -25
- package/lib/esm/components/auth/CommerceLayer.js +0 -2
- package/lib/esm/components/customers/CustomerAddressForm.d.ts +0 -13
- package/lib/esm/components/customers/CustomerAddressForm.js +0 -2
- package/lib/esm/components/customers/CustomerContainer.d.ts +0 -38
- package/lib/esm/components/customers/CustomerContainer.js +0 -2
- package/lib/esm/components/customers/CustomerField.d.ts +0 -25
- package/lib/esm/components/customers/CustomerField.js +0 -2
- package/lib/esm/components/customers/CustomerInput.d.ts +0 -11
- package/lib/esm/components/customers/CustomerInput.js +0 -2
- package/lib/esm/components/customers/CustomerPaymentSource.d.ts +0 -11
- package/lib/esm/components/customers/CustomerPaymentSource.js +0 -2
- package/lib/esm/components/customers/CustomerPaymentSourceEmpty.d.ts +0 -14
- package/lib/esm/components/customers/CustomerPaymentSourceEmpty.js +0 -2
- package/lib/esm/components/customers/MyAccountLink.d.ts +0 -38
- package/lib/esm/components/customers/MyAccountLink.js +0 -2
- package/lib/esm/components/customers/MyIdentityLink.d.ts +0 -59
- package/lib/esm/components/customers/MyIdentityLink.js +0 -2
- package/lib/esm/components/customers/SaveCustomerButton.d.ts +0 -12
- package/lib/esm/components/customers/SaveCustomerButton.js +0 -2
- package/lib/esm/components/errors/Errors.d.ts +0 -31
- package/lib/esm/components/errors/Errors.js +0 -2
- package/lib/esm/components/gift_cards/GiftCard.d.ts +0 -10
- package/lib/esm/components/gift_cards/GiftCard.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardContainer.d.ts +0 -6
- package/lib/esm/components/gift_cards/GiftCardContainer.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +0 -7
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardInput.d.ts +0 -7
- package/lib/esm/components/gift_cards/GiftCardInput.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponCode.d.ts +0 -16
- package/lib/esm/components/gift_cards/GiftCardOrCouponCode.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponForm.d.ts +0 -15
- package/lib/esm/components/gift_cards/GiftCardOrCouponForm.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +0 -11
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +0 -20
- package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.d.ts +0 -10
- package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardRecipientInput.d.ts +0 -0
- package/lib/esm/components/gift_cards/GiftCardRecipientInput.js +0 -2
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +0 -36
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.js +0 -2
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +0 -10
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.js +0 -2
- package/lib/esm/components/line_items/LineItem.d.ts +0 -8
- package/lib/esm/components/line_items/LineItem.js +0 -2
- package/lib/esm/components/line_items/LineItemAmount.d.ts +0 -7
- package/lib/esm/components/line_items/LineItemAmount.js +0 -2
- package/lib/esm/components/line_items/LineItemCode.d.ts +0 -13
- package/lib/esm/components/line_items/LineItemCode.js +0 -2
- package/lib/esm/components/line_items/LineItemField.d.ts +0 -14
- package/lib/esm/components/line_items/LineItemField.js +0 -2
- package/lib/esm/components/line_items/LineItemImage.d.ts +0 -17
- package/lib/esm/components/line_items/LineItemImage.js +0 -2
- package/lib/esm/components/line_items/LineItemName.d.ts +0 -12
- package/lib/esm/components/line_items/LineItemName.js +0 -2
- package/lib/esm/components/line_items/LineItemOption.d.ts +0 -19
- package/lib/esm/components/line_items/LineItemOption.js +0 -2
- package/lib/esm/components/line_items/LineItemOptions.d.ts +0 -16
- package/lib/esm/components/line_items/LineItemOptions.js +0 -2
- package/lib/esm/components/line_items/LineItemQuantity.d.ts +0 -21
- package/lib/esm/components/line_items/LineItemQuantity.js +0 -2
- package/lib/esm/components/line_items/LineItemRemoveLink.d.ts +0 -14
- package/lib/esm/components/line_items/LineItemRemoveLink.js +0 -2
- package/lib/esm/components/line_items/LineItemsContainer.d.ts +0 -9
- package/lib/esm/components/line_items/LineItemsContainer.js +0 -2
- package/lib/esm/components/line_items/LineItemsCount.d.ts +0 -12
- package/lib/esm/components/line_items/LineItemsCount.js +0 -2
- package/lib/esm/components/line_items/LineItemsEmpty.d.ts +0 -12
- package/lib/esm/components/line_items/LineItemsEmpty.js +0 -2
- package/lib/esm/components/orders/AddToCartButton.d.ts +0 -95
- package/lib/esm/components/orders/AddToCartButton.js +0 -2
- package/lib/esm/components/orders/AdjustmentAmount.d.ts +0 -4
- package/lib/esm/components/orders/AdjustmentAmount.js +0 -2
- package/lib/esm/components/orders/CartLink.d.ts +0 -47
- package/lib/esm/components/orders/CartLink.js +0 -2
- package/lib/esm/components/orders/CheckoutLink.d.ts +0 -28
- package/lib/esm/components/orders/CheckoutLink.js +0 -2
- package/lib/esm/components/orders/DiscountAmount.d.ts +0 -4
- package/lib/esm/components/orders/DiscountAmount.js +0 -2
- package/lib/esm/components/orders/GiftCardAmount.d.ts +0 -4
- package/lib/esm/components/orders/GiftCardAmount.js +0 -2
- package/lib/esm/components/orders/HostedCart.d.ts +0 -58
- package/lib/esm/components/orders/HostedCart.js +0 -2
- package/lib/esm/components/orders/OrderContainer.d.ts +0 -58
- package/lib/esm/components/orders/OrderContainer.js +0 -2
- package/lib/esm/components/orders/OrderList.d.ts +0 -83
- package/lib/esm/components/orders/OrderList.js +0 -2
- package/lib/esm/components/orders/OrderListEmpty.d.ts +0 -17
- package/lib/esm/components/orders/OrderListEmpty.js +0 -2
- package/lib/esm/components/orders/OrderListPaginationButtons.d.ts +0 -48
- package/lib/esm/components/orders/OrderListPaginationButtons.js +0 -2
- package/lib/esm/components/orders/OrderListPaginationInfo.d.ts +0 -29
- package/lib/esm/components/orders/OrderListPaginationInfo.js +0 -2
- package/lib/esm/components/orders/OrderListRow.d.ts +0 -29
- package/lib/esm/components/orders/OrderListRow.js +0 -2
- package/lib/esm/components/orders/OrderNumber.d.ts +0 -5
- package/lib/esm/components/orders/OrderNumber.js +0 -2
- package/lib/esm/components/orders/OrderStorage.d.ts +0 -31
- package/lib/esm/components/orders/OrderStorage.js +0 -2
- package/lib/esm/components/orders/PaymentMethodAmount.d.ts +0 -4
- package/lib/esm/components/orders/PaymentMethodAmount.js +0 -2
- package/lib/esm/components/orders/PlaceOrderButton.d.ts +0 -35
- package/lib/esm/components/orders/PlaceOrderButton.js +0 -2
- package/lib/esm/components/orders/PlaceOrderContainer.d.ts +0 -8
- package/lib/esm/components/orders/PlaceOrderContainer.js +0 -2
- package/lib/esm/components/orders/PrivacyAndTermsCheckbox.d.ts +0 -4
- package/lib/esm/components/orders/PrivacyAndTermsCheckbox.js +0 -2
- package/lib/esm/components/orders/ShippingAmount.d.ts +0 -4
- package/lib/esm/components/orders/ShippingAmount.js +0 -2
- package/lib/esm/components/orders/SubTotalAmount.d.ts +0 -4
- package/lib/esm/components/orders/SubTotalAmount.js +0 -2
- package/lib/esm/components/orders/TaxesAmount.d.ts +0 -4
- package/lib/esm/components/orders/TaxesAmount.js +0 -2
- package/lib/esm/components/orders/TotalAmount.d.ts +0 -4
- package/lib/esm/components/orders/TotalAmount.js +0 -2
- package/lib/esm/components/parcels/ParcelField.d.ts +0 -14
- package/lib/esm/components/parcels/ParcelField.js +0 -2
- package/lib/esm/components/parcels/ParcelLineItem.d.ts +0 -7
- package/lib/esm/components/parcels/ParcelLineItem.js +0 -2
- package/lib/esm/components/parcels/ParcelLineItemField.d.ts +0 -14
- package/lib/esm/components/parcels/ParcelLineItemField.js +0 -2
- package/lib/esm/components/parcels/ParcelLineItemsCount.d.ts +0 -18
- package/lib/esm/components/parcels/ParcelLineItemsCount.js +0 -2
- package/lib/esm/components/parcels/Parcels.d.ts +0 -7
- package/lib/esm/components/parcels/Parcels.js +0 -2
- package/lib/esm/components/parcels/ParcelsCount.d.ts +0 -18
- package/lib/esm/components/parcels/ParcelsCount.js +0 -2
- package/lib/esm/components/payment_gateways/AdyenGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/AdyenGateway.js +0 -2
- package/lib/esm/components/payment_gateways/BraintreeGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/BraintreeGateway.js +0 -2
- package/lib/esm/components/payment_gateways/CheckoutComGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/CheckoutComGateway.js +0 -2
- package/lib/esm/components/payment_gateways/ExternalGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/ExternalGateway.js +0 -2
- package/lib/esm/components/payment_gateways/KlarnaGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/KlarnaGateway.js +0 -2
- package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +0 -16
- package/lib/esm/components/payment_gateways/PaymentGateway.js +0 -2
- package/lib/esm/components/payment_gateways/PaypalGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/PaypalGateway.js +0 -2
- package/lib/esm/components/payment_gateways/StripeGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/StripeGateway.js +0 -2
- package/lib/esm/components/payment_gateways/WireTransferGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/WireTransferGateway.js +0 -2
- package/lib/esm/components/payment_methods/PaymentMethod.d.ts +0 -45
- package/lib/esm/components/payment_methods/PaymentMethod.js +0 -2
- package/lib/esm/components/payment_methods/PaymentMethodName.d.ts +0 -10
- package/lib/esm/components/payment_methods/PaymentMethodName.js +0 -2
- package/lib/esm/components/payment_methods/PaymentMethodPrice.d.ts +0 -8
- package/lib/esm/components/payment_methods/PaymentMethodPrice.js +0 -2
- package/lib/esm/components/payment_methods/PaymentMethodRadioButton.d.ts +0 -17
- package/lib/esm/components/payment_methods/PaymentMethodRadioButton.js +0 -2
- package/lib/esm/components/payment_methods/PaymentMethodsContainer.d.ts +0 -8
- package/lib/esm/components/payment_methods/PaymentMethodsContainer.js +0 -2
- package/lib/esm/components/payment_source/AdyenPayment.d.ts +0 -54
- package/lib/esm/components/payment_source/AdyenPayment.js +0 -2
- package/lib/esm/components/payment_source/BraintreePayment.d.ts +0 -32
- package/lib/esm/components/payment_source/BraintreePayment.js +0 -2
- package/lib/esm/components/payment_source/CheckoutComPayment.d.ts +0 -23
- package/lib/esm/components/payment_source/CheckoutComPayment.js +0 -2
- package/lib/esm/components/payment_source/ExternalPayment.d.ts +0 -24
- package/lib/esm/components/payment_source/ExternalPayment.js +0 -2
- package/lib/esm/components/payment_source/KlarnaPayment.d.ts +0 -10
- package/lib/esm/components/payment_source/KlarnaPayment.js +0 -2
- package/lib/esm/components/payment_source/PaymentSource.d.ts +0 -19
- package/lib/esm/components/payment_source/PaymentSource.js +0 -2
- package/lib/esm/components/payment_source/PaymentSourceBrandIcon.d.ts +0 -15
- package/lib/esm/components/payment_source/PaymentSourceBrandIcon.js +0 -2
- package/lib/esm/components/payment_source/PaymentSourceBrandName.d.ts +0 -12
- package/lib/esm/components/payment_source/PaymentSourceBrandName.js +0 -2
- package/lib/esm/components/payment_source/PaymentSourceDetail.d.ts +0 -15
- package/lib/esm/components/payment_source/PaymentSourceDetail.js +0 -2
- package/lib/esm/components/payment_source/PaymentSourceEditButton.d.ts +0 -10
- package/lib/esm/components/payment_source/PaymentSourceEditButton.js +0 -2
- package/lib/esm/components/payment_source/PaypalPayment.d.ts +0 -12
- package/lib/esm/components/payment_source/PaypalPayment.js +0 -2
- package/lib/esm/components/payment_source/StripeExpressPayment.d.ts +0 -6
- package/lib/esm/components/payment_source/StripeExpressPayment.js +0 -2
- package/lib/esm/components/payment_source/StripePayment.d.ts +0 -21
- package/lib/esm/components/payment_source/StripePayment.js +0 -2
- package/lib/esm/components/payment_source/WireTransferPayment.d.ts +0 -12
- package/lib/esm/components/payment_source/WireTransferPayment.js +0 -2
- package/lib/esm/components/prices/Price.d.ts +0 -35
- package/lib/esm/components/prices/Price.js +0 -2
- package/lib/esm/components/prices/PricesContainer.d.ts +0 -41
- package/lib/esm/components/prices/PricesContainer.js +0 -2
- package/lib/esm/components/shipments/Shipment.d.ts +0 -10
- package/lib/esm/components/shipments/Shipment.js +0 -2
- package/lib/esm/components/shipments/ShipmentField.d.ts +0 -12
- package/lib/esm/components/shipments/ShipmentField.js +0 -2
- package/lib/esm/components/shipments/ShipmentsContainer.d.ts +0 -6
- package/lib/esm/components/shipments/ShipmentsContainer.js +0 -2
- package/lib/esm/components/shipments/ShipmentsCount.d.ts +0 -18
- package/lib/esm/components/shipments/ShipmentsCount.js +0 -2
- package/lib/esm/components/shipping_methods/ShippingMethod.d.ts +0 -8
- package/lib/esm/components/shipping_methods/ShippingMethod.js +0 -2
- package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +0 -11
- package/lib/esm/components/shipping_methods/ShippingMethodName.js +0 -2
- package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +0 -20
- package/lib/esm/components/shipping_methods/ShippingMethodPrice.js +0 -2
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.d.ts +0 -17
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.js +0 -2
- package/lib/esm/components/skus/AvailabilityContainer.d.ts +0 -34
- package/lib/esm/components/skus/AvailabilityContainer.js +0 -2
- package/lib/esm/components/skus/AvailabilityTemplate.d.ts +0 -52
- package/lib/esm/components/skus/AvailabilityTemplate.js +0 -2
- package/lib/esm/components/skus/DeliveryLeadTime.d.ts +0 -10
- package/lib/esm/components/skus/DeliveryLeadTime.js +0 -2
- package/lib/esm/components/skus/SkuField.d.ts +0 -25
- package/lib/esm/components/skus/SkuField.js +0 -2
- package/lib/esm/components/skus/SkuList.d.ts +0 -10
- package/lib/esm/components/skus/SkuList.js +0 -2
- package/lib/esm/components/skus/SkuListsContainer.d.ts +0 -6
- package/lib/esm/components/skus/SkuListsContainer.js +0 -2
- package/lib/esm/components/skus/Skus.d.ts +0 -18
- package/lib/esm/components/skus/Skus.js +0 -2
- package/lib/esm/components/skus/SkusContainer.d.ts +0 -31
- package/lib/esm/components/skus/SkusContainer.js +0 -2
- package/lib/esm/components/stock_transfers/StockTransfer.d.ts +0 -7
- package/lib/esm/components/stock_transfers/StockTransfer.js +0 -2
- package/lib/esm/components/stock_transfers/StockTransferField.d.ts +0 -10
- package/lib/esm/components/stock_transfers/StockTransferField.js +0 -2
- package/lib/esm/components/utils/AddressCardsTemplate.d.ts +0 -26
- package/lib/esm/components/utils/AddressCardsTemplate.js +0 -2
- package/lib/esm/components/utils/BaseField.d.ts +0 -8
- package/lib/esm/components/utils/BaseField.js +0 -2
- package/lib/esm/components/utils/BaseInput.d.ts +0 -5
- package/lib/esm/components/utils/BaseInput.js +0 -2
- package/lib/esm/components/utils/BaseOrderPrice.d.ts +0 -6
- package/lib/esm/components/utils/BaseOrderPrice.js +0 -2
- package/lib/esm/components/utils/BaseSelect.d.ts +0 -5
- package/lib/esm/components/utils/BaseSelect.js +0 -2
- package/lib/esm/components/utils/ErrorBoundary.d.ts +0 -14
- package/lib/esm/components/utils/ErrorBoundary.js +0 -2
- package/lib/esm/components/utils/GenericFieldComponent.d.ts +0 -58
- package/lib/esm/components/utils/GenericFieldComponent.js +0 -2
- package/lib/esm/components/utils/Parent.d.ts +0 -6
- package/lib/esm/components/utils/Parent.js +0 -2
- package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +0 -41
- package/lib/esm/components/utils/PaymentCardsTemplate.js +0 -2
- package/lib/esm/components/utils/PriceTemplate.d.ts +0 -8
- package/lib/esm/components/utils/PriceTemplate.js +0 -2
- package/lib/esm/components/utils/getAllErrors.d.ts +0 -16
- package/lib/esm/components/utils/getAllErrors.js +0 -2
- package/lib/esm/config/currency.d.ts +0 -5
- package/lib/esm/config/currency.js +0 -2
- package/lib/esm/context/AddressChildrenContext.d.ts +0 -6
- package/lib/esm/context/AddressChildrenContext.js +0 -2
- package/lib/esm/context/AddressContext.d.ts +0 -18
- package/lib/esm/context/AddressContext.js +0 -2
- package/lib/esm/context/AvailabilityContext.d.ts +0 -2
- package/lib/esm/context/AvailabilityContext.js +0 -2
- package/lib/esm/context/BillingAddressContext.d.ts +0 -9
- package/lib/esm/context/BillingAddressContext.js +0 -2
- package/lib/esm/context/BillingAddressFormContext.d.ts +0 -22
- package/lib/esm/context/BillingAddressFormContext.js +0 -2
- package/lib/esm/context/CommerceLayerContext.d.ts +0 -6
- package/lib/esm/context/CommerceLayerContext.js +0 -2
- package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +0 -8
- package/lib/esm/context/CouponAndGiftCardFormContext.js +0 -2
- package/lib/esm/context/CustomerAddressFormContext.d.ts +0 -17
- package/lib/esm/context/CustomerAddressFormContext.js +0 -2
- package/lib/esm/context/CustomerContext.d.ts +0 -29
- package/lib/esm/context/CustomerContext.js +0 -2
- package/lib/esm/context/CustomerPaymentSourceContext.d.ts +0 -11
- package/lib/esm/context/CustomerPaymentSourceContext.js +0 -2
- package/lib/esm/context/ExternalFunctionContext.d.ts +0 -11
- package/lib/esm/context/ExternalFunctionContext.js +0 -2
- package/lib/esm/context/GiftCardContext.d.ts +0 -10
- package/lib/esm/context/GiftCardContext.js +0 -2
- package/lib/esm/context/InStockSubscriptionContext.d.ts +0 -6
- package/lib/esm/context/InStockSubscriptionContext.js +0 -2
- package/lib/esm/context/LineItemChildrenContext.d.ts +0 -8
- package/lib/esm/context/LineItemChildrenContext.js +0 -2
- package/lib/esm/context/LineItemContext.d.ts +0 -7
- package/lib/esm/context/LineItemContext.js +0 -2
- package/lib/esm/context/LineItemOptionChildrenContext.d.ts +0 -9
- package/lib/esm/context/LineItemOptionChildrenContext.js +0 -2
- package/lib/esm/context/OrderContext.d.ts +0 -28
- package/lib/esm/context/OrderContext.js +0 -2
- package/lib/esm/context/OrderListChildrenContext.d.ts +0 -73
- package/lib/esm/context/OrderListChildrenContext.js +0 -2
- package/lib/esm/context/OrderListPaginationContext.d.ts +0 -15
- package/lib/esm/context/OrderListPaginationContext.js +0 -2
- package/lib/esm/context/OrderStorageContext.d.ts +0 -10
- package/lib/esm/context/OrderStorageContext.js +0 -2
- package/lib/esm/context/ParcelChildrenContext.d.ts +0 -6
- package/lib/esm/context/ParcelChildrenContext.js +0 -2
- package/lib/esm/context/ParcelLineItemChildrenContext.d.ts +0 -6
- package/lib/esm/context/ParcelLineItemChildrenContext.js +0 -2
- package/lib/esm/context/PaymentMethodChildrenContext.d.ts +0 -10
- package/lib/esm/context/PaymentMethodChildrenContext.js +0 -2
- package/lib/esm/context/PaymentMethodContext.d.ts +0 -13
- package/lib/esm/context/PaymentMethodContext.js +0 -2
- package/lib/esm/context/PaymentSourceContext.d.ts +0 -14
- package/lib/esm/context/PaymentSourceContext.js +0 -2
- package/lib/esm/context/PlaceOrderContext.d.ts +0 -12
- package/lib/esm/context/PlaceOrderContext.js +0 -2
- package/lib/esm/context/PricesContext.d.ts +0 -6
- package/lib/esm/context/PricesContext.js +0 -2
- package/lib/esm/context/ShipmentChildrenContext.d.ts +0 -13
- package/lib/esm/context/ShipmentChildrenContext.js +0 -2
- package/lib/esm/context/ShipmentContext.d.ts +0 -10
- package/lib/esm/context/ShipmentContext.js +0 -2
- package/lib/esm/context/ShippingAddressContext.d.ts +0 -9
- package/lib/esm/context/ShippingAddressContext.js +0 -2
- package/lib/esm/context/ShippingAddressFormContext.d.ts +0 -3
- package/lib/esm/context/ShippingAddressFormContext.js +0 -2
- package/lib/esm/context/ShippingMethodChildrenContext.d.ts +0 -9
- package/lib/esm/context/ShippingMethodChildrenContext.js +0 -2
- package/lib/esm/context/SkuChildrenContext.d.ts +0 -8
- package/lib/esm/context/SkuChildrenContext.js +0 -2
- package/lib/esm/context/SkuContext.d.ts +0 -8
- package/lib/esm/context/SkuContext.js +0 -2
- package/lib/esm/context/SkuListsContext.d.ts +0 -5
- package/lib/esm/context/SkuListsContext.js +0 -2
- package/lib/esm/context/StockTransferChildrenContext.d.ts +0 -6
- package/lib/esm/context/StockTransferChildrenContext.js +0 -2
- package/lib/esm/hooks/useCommerceLayer.d.ts +0 -12
- package/lib/esm/hooks/useCommerceLayer.js +0 -2
- package/lib/esm/hooks/useCustomerContainer.d.ts +0 -12
- package/lib/esm/hooks/useCustomerContainer.js +0 -2
- package/lib/esm/hooks/useOrderContainer.d.ts +0 -16
- package/lib/esm/hooks/useOrderContainer.js +0 -2
- package/lib/esm/index.d.ts +0 -107
- package/lib/esm/index.js +0 -2
- package/lib/esm/reducers/AddressReducer.d.ts +0 -80
- package/lib/esm/reducers/AddressReducer.js +0 -2
- package/lib/esm/reducers/AvailabilityReducer.d.ts +0 -53
- package/lib/esm/reducers/AvailabilityReducer.js +0 -2
- package/lib/esm/reducers/BillingAddressReducer.d.ts +0 -31
- package/lib/esm/reducers/BillingAddressReducer.js +0 -2
- package/lib/esm/reducers/CustomerReducer.d.ts +0 -183
- package/lib/esm/reducers/CustomerReducer.js +0 -2
- package/lib/esm/reducers/GiftCardReducer.d.ts +0 -66
- package/lib/esm/reducers/GiftCardReducer.js +0 -2
- package/lib/esm/reducers/InStockSubscriptionReducer.d.ts +0 -33
- package/lib/esm/reducers/InStockSubscriptionReducer.js +0 -2
- package/lib/esm/reducers/LineItemReducer.d.ts +0 -47
- package/lib/esm/reducers/LineItemReducer.js +0 -2
- package/lib/esm/reducers/OrderReducer.d.ts +0 -157
- package/lib/esm/reducers/OrderReducer.js +0 -2
- package/lib/esm/reducers/PaymentMethodReducer.d.ts +0 -161
- package/lib/esm/reducers/PaymentMethodReducer.js +0 -2
- package/lib/esm/reducers/PlaceOrderReducer.d.ts +0 -72
- package/lib/esm/reducers/PlaceOrderReducer.js +0 -2
- package/lib/esm/reducers/PriceReducer.d.ts +0 -35
- package/lib/esm/reducers/PriceReducer.js +0 -2
- package/lib/esm/reducers/ShipmentReducer.d.ts +0 -41
- package/lib/esm/reducers/ShipmentReducer.js +0 -2
- package/lib/esm/reducers/ShippingAddressReducer.d.ts +0 -32
- package/lib/esm/reducers/ShippingAddressReducer.js +0 -2
- package/lib/esm/reducers/SkuListsReducer.d.ts +0 -21
- package/lib/esm/reducers/SkuListsReducer.js +0 -2
- package/lib/esm/reducers/SkuReducer.d.ts +0 -21
- package/lib/esm/reducers/SkuReducer.js +0 -2
- package/lib/esm/typings/errors.d.ts +0 -15
- package/lib/esm/typings/errors.js +0 -2
- package/lib/esm/typings/globals.d.ts +0 -6
- package/lib/esm/typings/globals.js +0 -2
- package/lib/esm/typings/index.d.ts +0 -117
- package/lib/esm/typings/index.js +0 -2
- package/lib/esm/utils/PropsType.d.ts +0 -33
- package/lib/esm/utils/PropsType.js +0 -2
- package/lib/esm/utils/addressesManager.d.ts +0 -64
- package/lib/esm/utils/addressesManager.js +0 -2
- package/lib/esm/utils/baseReducer.d.ts +0 -3
- package/lib/esm/utils/baseReducer.js +0 -2
- package/lib/esm/utils/browserInfo.d.ts +0 -12
- package/lib/esm/utils/browserInfo.js +0 -2
- package/lib/esm/utils/canPlaceOrder.d.ts +0 -5
- package/lib/esm/utils/canPlaceOrder.js +0 -2
- package/lib/esm/utils/checkIncludeResource.d.ts +0 -8
- package/lib/esm/utils/checkIncludeResource.js +0 -2
- package/lib/esm/utils/compareObjAttribute.d.ts +0 -7
- package/lib/esm/utils/compareObjAttribute.js +0 -2
- package/lib/esm/utils/countryStateCity.d.ts +0 -801
- package/lib/esm/utils/countryStateCity.js +0 -2
- package/lib/esm/utils/customMessages.d.ts +0 -2
- package/lib/esm/utils/customMessages.js +0 -2
- package/lib/esm/utils/customerOrderOptions.d.ts +0 -3
- package/lib/esm/utils/customerOrderOptions.js +0 -2
- package/lib/esm/utils/events.d.ts +0 -5
- package/lib/esm/utils/events.js +0 -2
- package/lib/esm/utils/expressPaymentHelper.d.ts +0 -92
- package/lib/esm/utils/expressPaymentHelper.js +0 -2
- package/lib/esm/utils/filterChildren.d.ts +0 -12
- package/lib/esm/utils/filterChildren.js +0 -2
- package/lib/esm/utils/formCleaner.d.ts +0 -4
- package/lib/esm/utils/formCleaner.js +0 -2
- package/lib/esm/utils/getAmount.d.ts +0 -7
- package/lib/esm/utils/getAmount.js +0 -2
- package/lib/esm/utils/getApplicationLink.d.ts +0 -35
- package/lib/esm/utils/getApplicationLink.js +0 -2
- package/lib/esm/utils/getCardDetails.d.ts +0 -16
- package/lib/esm/utils/getCardDetails.js +0 -2
- package/lib/esm/utils/getCustomerIdByToken.d.ts +0 -6
- package/lib/esm/utils/getCustomerIdByToken.js +0 -2
- package/lib/esm/utils/getDomain.d.ts +0 -4
- package/lib/esm/utils/getDomain.js +0 -2
- package/lib/esm/utils/getErrors.d.ts +0 -19
- package/lib/esm/utils/getErrors.js +0 -2
- package/lib/esm/utils/getLineItemsCount.d.ts +0 -10
- package/lib/esm/utils/getLineItemsCount.js +0 -2
- package/lib/esm/utils/getLoaderComponent.d.ts +0 -3
- package/lib/esm/utils/getLoaderComponent.js +0 -2
- package/lib/esm/utils/getPaymentAttributes.d.ts +0 -17
- package/lib/esm/utils/getPaymentAttributes.js +0 -2
- package/lib/esm/utils/getPrices.d.ts +0 -6
- package/lib/esm/utils/getPrices.js +0 -2
- package/lib/esm/utils/getPublicIp.d.ts +0 -1
- package/lib/esm/utils/getPublicIp.js +0 -2
- package/lib/esm/utils/getSdk.d.ts +0 -3
- package/lib/esm/utils/getSdk.js +0 -2
- package/lib/esm/utils/getSkus.d.ts +0 -3
- package/lib/esm/utils/getSkus.js +0 -2
- package/lib/esm/utils/hasSubscriptions.d.ts +0 -7
- package/lib/esm/utils/hasSubscriptions.js +0 -2
- package/lib/esm/utils/hooks/useCustomContext.d.ts +0 -21
- package/lib/esm/utils/hooks/useCustomContext.js +0 -2
- package/lib/esm/utils/hooks/useExternalScript.d.ts +0 -1
- package/lib/esm/utils/hooks/useExternalScript.js +0 -2
- package/lib/esm/utils/icons.d.ts +0 -2
- package/lib/esm/utils/icons.js +0 -2
- package/lib/esm/utils/isDate.d.ts +0 -1
- package/lib/esm/utils/isDate.js +0 -2
- package/lib/esm/utils/isEmpty.d.ts +0 -1
- package/lib/esm/utils/isEmpty.js +0 -2
- package/lib/esm/utils/isGuestToken.d.ts +0 -6
- package/lib/esm/utils/isGuestToken.js +0 -2
- package/lib/esm/utils/isJSON.d.ts +0 -1
- package/lib/esm/utils/isJSON.js +0 -2
- package/lib/esm/utils/jwt.d.ts +0 -27
- package/lib/esm/utils/jwt.js +0 -2
- package/lib/esm/utils/localStorage.d.ts +0 -11
- package/lib/esm/utils/localStorage.js +0 -2
- package/lib/esm/utils/omit.d.ts +0 -1
- package/lib/esm/utils/omit.js +0 -2
- package/lib/esm/utils/organization.d.ts +0 -18
- package/lib/esm/utils/organization.js +0 -2
- package/lib/esm/utils/payment-methods/sortPaymentMethods.d.ts +0 -2
- package/lib/esm/utils/payment-methods/sortPaymentMethods.js +0 -2
- package/lib/esm/utils/pick.d.ts +0 -1
- package/lib/esm/utils/pick.js +0 -2
- package/lib/esm/utils/placeholderImages.d.ts +0 -2
- package/lib/esm/utils/placeholderImages.js +0 -2
- package/lib/esm/utils/promisify.d.ts +0 -1
- package/lib/esm/utils/promisify.js +0 -2
- package/lib/esm/utils/replace.d.ts +0 -2
- package/lib/esm/utils/replace.js +0 -2
- package/lib/esm/utils/scrollbarWidth.d.ts +0 -1
- package/lib/esm/utils/scrollbarWidth.js +0 -2
- package/lib/esm/utils/shipments.d.ts +0 -3
- package/lib/esm/utils/shipments.js +0 -2
- package/lib/esm/utils/snakeToCamelCase.d.ts +0 -5
- package/lib/esm/utils/snakeToCamelCase.js +0 -2
- package/lib/esm/utils/stripe/retrievePaymentIntent.d.ts +0 -14
- package/lib/esm/utils/stripe/retrievePaymentIntent.js +0 -2
- package/lib/esm/utils/triggerAttributeHelper.d.ts +0 -31
- package/lib/esm/utils/triggerAttributeHelper.js +0 -2
- package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +0 -8
- package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.js +0 -2
- package/lib/esm/utils/validateFormFields.d.ts +0 -16
- package/lib/esm/utils/validateFormFields.js +0 -2
- package/lib/tsconfig.prod.esm.tsbuildinfo +0 -1
- package/lib/tsconfig.prod.tsbuildinfo +0 -1
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { type JSX } from "react";
|
|
2
|
-
import type { PaymentSourceProps } from "./PaymentSource";
|
|
3
|
-
import { type CardConfiguration, type CoreConfiguration, type DropinConfiguration, type PayPalConfiguration } from "@adyen/adyen-web/auto";
|
|
4
|
-
interface PaymentMethodsStyle {
|
|
5
|
-
card?: CardConfiguration["styles"];
|
|
6
|
-
paypal?: PayPalConfiguration["style"];
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Configuration options for the Adyen payment component.
|
|
10
|
-
*/
|
|
11
|
-
export interface AdyenPaymentConfig {
|
|
12
|
-
/**
|
|
13
|
-
* Optional CSS class name for the card container.
|
|
14
|
-
*/
|
|
15
|
-
cardContainerClassName?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Optional CSS class name for the 3D Secure container.
|
|
18
|
-
* @deprecated
|
|
19
|
-
*/
|
|
20
|
-
threeDSecureContainerClassName?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Callback function to be called when an order is placed.
|
|
23
|
-
* @param response - An object containing the placement status.
|
|
24
|
-
*/
|
|
25
|
-
placeOrderCallback?: (response: {
|
|
26
|
-
placed: boolean;
|
|
27
|
-
}) => void;
|
|
28
|
-
/**
|
|
29
|
-
* Optional styles for the payment methods.
|
|
30
|
-
*/
|
|
31
|
-
styles?: PaymentMethodsStyle;
|
|
32
|
-
/**
|
|
33
|
-
* Configuration options for the payment methods.
|
|
34
|
-
*/
|
|
35
|
-
paymentMethodsConfiguration?: DropinConfiguration["paymentMethodsConfiguration"];
|
|
36
|
-
/**
|
|
37
|
-
* Callback function to disable a stored payment method.
|
|
38
|
-
* @param props - An object containing the recurring detail reference and shopper reference.
|
|
39
|
-
* @returns A promise that resolves to a boolean indicating whether the stored payment method was disabled.
|
|
40
|
-
*/
|
|
41
|
-
onDisableStoredPaymentMethod?: (props: {
|
|
42
|
-
recurringDetailReference: string;
|
|
43
|
-
shopperReference: string | undefined;
|
|
44
|
-
}) => Promise<boolean>;
|
|
45
|
-
}
|
|
46
|
-
interface Props {
|
|
47
|
-
clientKey?: string;
|
|
48
|
-
config?: AdyenPaymentConfig;
|
|
49
|
-
templateCustomerSaveToWallet?: PaymentSourceProps["templateCustomerSaveToWallet"];
|
|
50
|
-
locale?: CoreConfiguration["locale"];
|
|
51
|
-
environment?: CoreConfiguration["environment"];
|
|
52
|
-
}
|
|
53
|
-
export declare function AdyenPayment({ clientKey, config, templateCustomerSaveToWallet, environment, locale, }: Props): JSX.Element | null;
|
|
54
|
-
export default AdyenPayment;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AdyenPayment=AdyenPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),localStorage_1=require("../../utils/localStorage"),auto_1=require("@adyen/adyen-web/auto"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),browserInfo_1=tslib_1.__importStar(require("../../utils/browserInfo")),PlaceOrderContext_1=tslib_1.__importDefault(require("../../context/PlaceOrderContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),getPublicIp_1=require("../../utils/getPublicIp"),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),defaultConfig={};function AdyenPayment({clientKey,config,templateCustomerSaveToWallet,environment="test",locale="en_US"}){const{cardContainerClassName,styles,onDisableStoredPaymentMethod}=Object.assign(Object.assign({},defaultConfig),config),[loadAdyen,setLoadAdyen]=(0,react_1.useState)(!1),[checkout,setCheckout]=(0,react_1.useState)(),{setPaymentSource,paymentSource,setPaymentMethodErrors,currentPaymentMethodType,setPaymentRef,currentCustomerPaymentSourceId}=(0,react_1.useContext)(PaymentMethodContext_1.default),{order,updateOrder}=(0,react_1.useContext)(OrderContext_1.default),{placeOrderButtonRef,setPlaceOrder}=(0,react_1.useContext)(PlaceOrderContext_1.default),{customers}=(0,react_1.useContext)(CustomerContext_1.default),ref=(0,react_1.useRef)(null),dropinRef=(0,react_1.useRef)(null),handleSubmit=e=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a,_b;const savePaymentSourceToCustomerWallet=(_b=(_a=e?.elements)===null||_a===void 0?void 0:_a.save_payment_source_to_customer_wallet)===null||_b===void 0?void 0:_b.checked;return savePaymentSourceToCustomerWallet&&(0,localStorage_1.setCustomerOrderParam)("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),dropinRef.current&&dropinRef.current.submit(),!1}),handleChange=state=>tslib_1.__awaiter(this,void 0,void 0,function*(){state.isValid&&ref.current&&(ref.current.onsubmit=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield handleSubmit(ref.current)}),setPaymentRef({ref}))}),handleOnAdditionalDetails=(state,component)=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a,_b;const attributes={payment_request_details:state.data,_details:1};try{const pSource=paymentSource&&(yield setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:"adyen_payments",attributes})),resultCode=(_a=pSource?.payment_response)===null||_a===void 0?void 0:_a.resultCode;if(["Authorised","Pending","Received"].includes(resultCode))return placeOrderButtonRef?.current!=null&&(placeOrderButtonRef.current.disabled&&(placeOrderButtonRef.current.disabled=!1),placeOrderButtonRef.current.click()),{resultCode};if(["Cancelled","Refused"].includes(resultCode)){const message=(_b=pSource?.payment_response)===null||_b===void 0?void 0:_b.refusalReason;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message}]),component&&component.mount("#adyen-dropin")}return{resultCode}}catch(error){return console.error("Adyen additional details error:",error),{resultCode:"Error"}}}),onSubmit=(state,component)=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o;const url=(0,browserInfo_1.cleanUrlBy)(),{type:currentPaymentMethodType2}=state.data.paymentMethod,shopperIp=yield(0,getPublicIp_1.getPublicIP)(),control=yield setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments"}),controlCode=(_a=control?.payment_response)===null||_a===void 0?void 0:_a.resultCode,paymentMethodType=(_c=(_b=control?.payment_response)===null||_b===void 0?void 0:_b.paymentMethod)===null||_c===void 0?void 0:_c.type;if(controlCode==="Authorised"&&paymentMethodType!=="giftcard")return{resultCode:controlCode};const attributes={payment_request_data:Object.assign(Object.assign({},state.data),{payment_method:state.data.paymentMethod,return_url:url,origin:window.location.origin,redirect_from_issuer_method:"GET",shopper_ip:shopperIp,shopperInteraction:"Ecommerce",recurringProcessingModel:"CardOnFile",browser_info:Object.assign({},(0,browserInfo_1.default)())})};delete attributes.payment_request_data.paymentMethod;try{if(yield setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes}),order?.id==null)return console.error("Order id is missing"),{resultCode:"Error"};if(controlCode==="Authorised"&&paymentMethodType==="giftcard")return yield updateOrder({id:order.id,attributes:{_authorize:!0}}),{resultCode:"Authorised",paymentMethodType:currentPaymentMethodType2};if(currentPaymentMethodType2==="giftcard"){const firstAuthorization=yield setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{_authorize:1}});if(["Cancelled","Refused"].includes((_d=firstAuthorization?.payment_response)===null||_d===void 0?void 0:_d.resultCode)){const availableGiftCardAmount=(_f=(_e=firstAuthorization?.payment_response)===null||_e===void 0?void 0:_e.additionalData)===null||_f===void 0?void 0:_f.currentBalanceValue;return yield updateOrder({id:order.id,attributes:{_authorization_amount_cents:Number.parseInt(availableGiftCardAmount),_place:!0}}),{resultCode:"Authorised",paymentMethodType:currentPaymentMethodType2}}return{resultCode:"Authorised",paymentMethodType:currentPaymentMethodType2}}const res=yield setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{_authorize:1}}),action=(_g=res?.payment_response)===null||_g===void 0?void 0:_g.action,resultCode=(_h=res?.payment_response)===null||_h===void 0?void 0:_h.resultCode;if(action!=null)return{resultCode,action};const issuerType=(_j=res?.payment_instrument)===null||_j===void 0?void 0:_j.issuer_type;if(["Authorised","Pending","Received"].includes(resultCode))return["apple pay","google pay"].includes(issuerType)&&setPlaceOrder!=null?(yield setPlaceOrder({paymentSource:res,currentCustomerPaymentSourceId}),{resultCode}):(placeOrderButtonRef?.current!=null&&(placeOrderButtonRef.current.disabled&&(placeOrderButtonRef.current.disabled=!1),placeOrderButtonRef.current.click()),{resultCode});if(["Cancelled","Refused"].includes(resultCode)){const message=(_k=res?.payment_response)===null||_k===void 0?void 0:_k.refusalReason;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType2,message}]),component&&component.mount("#adyen-dropin")}if((_l=res?.payment_response)===null||_l===void 0?void 0:_l.errorType)if(((_m=res?.payment_response)===null||_m===void 0?void 0:_m.errorCode)==="14_006")onSubmit(state,component);else{const message=(_o=res?.payment_response)===null||_o===void 0?void 0:_o.message;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType2,message}])}return{resultCode,paymentMethodType:currentPaymentMethodType2}}catch(error){const{message}=error;return setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType2,message:message??"An error occurred"}]),{resultCode:"Error"}}});return(0,react_1.useEffect)(()=>{var _a,_b,_c,_d,_e;const paymentMethodsResponse={paymentMethods:!((_a=paymentSource?.payment_methods)===null||_a===void 0)&&_a.paymentMethods?paymentSource?.payment_methods.paymentMethods:[],storedPaymentMethods:!((_b=paymentSource?.payment_methods)===null||_b===void 0)&&_b.storedPaymentMethods?paymentSource?.payment_methods.storedPaymentMethods:[]};paymentMethodsResponse.paymentMethods.length===0&&console.error("Payment methods are not available. Please, check your Adyen configuration.");const showStoredPaymentMethods=(_d=((_c=paymentSource?.payment_methods)===null||_c===void 0?void 0:_c.storedPaymentMethods)!=null)!==null&&_d!==void 0?_d:!1,options={locale:(_e=order?.language_code)!==null&&_e!==void 0?_e:locale,environment,clientKey,amount:{currency:order?.currency_code||"",value:order?.total_amount_with_taxes_cents||0},countryCode:order?.country_code||"",paymentMethodsResponse,showPayButton:!1,onAdditionalDetails:(state,element,actions)=>{(()=>tslib_1.__awaiter(this,void 0,void 0,function*(){const{resultCode}=yield handleOnAdditionalDetails(state,element);["Cancelled","Refused"].includes(resultCode)?actions.reject():actions.resolve({resultCode})}))()},onChange:state=>{handleChange(state)},onSubmit:(state,element,actions)=>{(()=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a2,_b2;const{resultCode,action}=yield onSubmit(state,element);["Cancelled","Refused"].includes(resultCode)?actions.reject():action!=null?(_a2=dropinRef.current)===null||_a2===void 0||_a2.handleAction(action):(actions.resolve({resultCode}),(_b2=dropinRef.current)===null||_b2===void 0||_b2.mount("#adyen-dropin"))}))()}};if(!ref&&clientKey&&(0,localStorage_1.setCustomerOrderParam)("_save_payment_source_to_customer_wallet","false"),clientKey&&!loadAdyen&&window&&!checkout){const initializeAdyen=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a2,_b2,_c2;const checkout2=yield(0,auto_1.AdyenCheckout)(options),dropin=new auto_1.Dropin(checkout2,{disableFinalAnimation:!0,showRemovePaymentMethodButton:showStoredPaymentMethods,instantPaymentTypes:["applepay","googlepay"],paymentMethodsConfiguration:Object.assign({showStoredPaymentMethods,paypal:Object.assign({showPayButton:!0,style:styles?.paypal},(_a2=config?.paymentMethodsConfiguration)===null||_a2===void 0?void 0:_a2.paypal),card:Object.assign({enableStoreDetails:showStoredPaymentMethods,styles:styles?.card,holderNameRequired:!1},(_b2=config?.paymentMethodsConfiguration)===null||_b2===void 0?void 0:_b2.card),giftcard:Object.assign({showPayButton:!0},(_c2=config?.paymentMethodsConfiguration)===null||_c2===void 0?void 0:_c2.giftcard)},config?.paymentMethodsConfiguration),onDisableStoredPaymentMethod:state=>{var _a3;const recurringDetailReference=state,shopperReference=(_a3=customers?.shopper_reference)!==null&&_a3!==void 0?_a3:void 0;onDisableStoredPaymentMethod?.({recurringDetailReference,shopperReference}).then(response=>{response?setPaymentSource({paymentResource:"adyen_payments",order,attributes:{}}):console.error("onDisableStoredPaymentMethod error")}).catch(error=>{console.error("onDisableStoredPaymentMethod error",error)})},onSelect:component=>{const id=component._id;id.search("scheme")===-1&&ref.current&&(id.search("paypal")===-1?ref.current.onsubmit=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield handleSubmit(ref.current)}):ref.current.onsubmit=null,setPaymentRef({ref}))}}).mount("#adyen-dropin");dropin&&checkout2&&(dropinRef.current=dropin,setCheckout(dropin),setLoadAdyen(!0))});dropinRef.current||initializeAdyen()}return()=>{setPaymentRef({ref:{current:null}}),setLoadAdyen(!1)}},[clientKey,ref!=null]),!clientKey&&!loadAdyen&&!checkout?null:(0,jsx_runtime_1.jsxs)("form",{ref,onSubmit:e=>{handleSubmit(e)},children:[(0,jsx_runtime_1.jsx)("div",{className:cardContainerClassName,id:"adyen-dropin"}),templateCustomerSaveToWallet&&(0,jsx_runtime_1.jsx)(Parent_1.default,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})]})}exports.default=AdyenPayment;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'react';
|
|
2
|
-
import type { PaymentSourceProps } from './PaymentSource';
|
|
3
|
-
import type { HostedFieldFieldOptions } from 'braintree-web';
|
|
4
|
-
type BraintreeHostedFields<Type> = {
|
|
5
|
-
[Property in keyof Type]: {
|
|
6
|
-
label?: string;
|
|
7
|
-
} & Type[Property];
|
|
8
|
-
};
|
|
9
|
-
export interface BraintreeConfig {
|
|
10
|
-
containerClassName?: string;
|
|
11
|
-
cardContainerClassName?: string;
|
|
12
|
-
expDateContainerClassName?: string;
|
|
13
|
-
fieldsContainerClassName?: string;
|
|
14
|
-
cvvContainerClassName?: string;
|
|
15
|
-
cardDetailsContainerClassName?: string;
|
|
16
|
-
fieldLabelClassName?: string;
|
|
17
|
-
inputWrapperClassName?: string;
|
|
18
|
-
fields?: BraintreeHostedFields<HostedFieldFieldOptions>;
|
|
19
|
-
styles?: Record<string, Record<string, string>>;
|
|
20
|
-
/**
|
|
21
|
-
* Force challenge request for 3D Secure authentication. Default is true.
|
|
22
|
-
*/
|
|
23
|
-
challengeRequested?: boolean;
|
|
24
|
-
}
|
|
25
|
-
interface Props {
|
|
26
|
-
authorization: string;
|
|
27
|
-
config?: BraintreeConfig;
|
|
28
|
-
templateCustomerSaveToWallet?: PaymentSourceProps['templateCustomerSaveToWallet'];
|
|
29
|
-
locale?: string;
|
|
30
|
-
}
|
|
31
|
-
export declare function BraintreePayment({ authorization, config, templateCustomerSaveToWallet }: Props): JSX.Element | null;
|
|
32
|
-
export default BraintreePayment;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BraintreePayment=BraintreePayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),localStorage_1=require("../../utils/localStorage"),promisify_1=tslib_1.__importDefault(require("../../utils/promisify")),defaultConfig={styles:{input:{"font-size":"16px",color:"#3A3A3A"},".number":{"font-family":"monospace"},":focus":{color:"blue"},".valid":{color:"green"},".invalid":{color:"red"},"@media screen and (max-width: 700px)":{input:{"font-size":"14px"}}},fields:{number:{label:"Card Number",selector:"#card-number",placeholder:"4111 1111 1111 1111"},cvv:{label:"CVV",selector:"#cvv",placeholder:"123"},expirationDate:{label:"Expiration Date",selector:"#expiration-date",placeholder:"10/2022"}},submitLabel:"Set payment method"};function BraintreePayment({authorization,config,templateCustomerSaveToWallet}){var _a,_b,_c;const{fields,styles,containerClassName,cardContainerClassName,fieldsContainerClassName,expDateContainerClassName,fieldLabelClassName,cvvContainerClassName,inputWrapperClassName,cardDetailsContainerClassName}=Object.assign(Object.assign({},defaultConfig),config),[loadBraintree,setLoadBraintree]=(0,react_1.useState)(!1),{setPaymentSource,paymentSource,setPaymentMethodErrors,currentPaymentMethodType,setPaymentRef}=(0,react_1.useContext)(PaymentMethodContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),ref=(0,react_1.useRef)(null),handleSubmitForm=_a2=>tslib_1.__awaiter(this,[_a2],void 0,function*({event,hostedFieldsInstance,threeDSInstance}){var _b2,_c2,_d,_e,_f,_g,_h;const savePaymentSourceToCustomerWallet=(_c2=(_b2=event?.elements)===null||_b2===void 0?void 0:_b2.save_payment_source_to_customer_wallet)===null||_c2===void 0?void 0:_c2.checked;if(savePaymentSourceToCustomerWallet&&(0,localStorage_1.setCustomerOrderParam)("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),hostedFieldsInstance)try{const payload=yield(0,promisify_1.default)(hostedFieldsInstance).then(payload2=>payload2),billingAddress=order?.billing_address,verifyCardOptions={nonce:payload.nonce,bin:payload.details.bin,amount:`${order?.total_amount_with_taxes_float}`,email:(_d=order?.customer_email)!==null&&_d!==void 0?_d:"",billingAddress:{givenName:(_e=billingAddress?.first_name)!==null&&_e!==void 0?_e:"",surname:(_f=billingAddress?.last_name)!==null&&_f!==void 0?_f:"",phoneNumber:billingAddress?.phone,streetAddress:billingAddress?.line_1,countryCodeAlpha2:billingAddress?.country_code,postalCode:(_g=billingAddress?.zip_code)!==null&&_g!==void 0?_g:"",region:billingAddress?.state_code,locality:billingAddress?.city},onLookupComplete:(_data,next)=>{next()}},response=yield threeDSInstance.verifyCard(verifyCardOptions);if(response?.liabilityShiftPossible===!0&&response?.liabilityShifted===!0&&paymentSource!=null)return yield setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:"braintree_payments",attributes:{payment_method_nonce:response.nonce,options:{id:response.nonce,card:{last4:response.details.lastFour,exp_year:response.details.expirationYear,exp_month:response.details.expirationMonth,brand:response.details.cardType.toLowerCase()}}}}),!0;throw new Error(`3D Secure authentication failed - ${(_h=response?.threeDSecureInfo)===null||_h===void 0?void 0:_h.status}`)}catch(error){return console.error(error),setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:error.message}]),!1}return!1});return(0,react_1.useEffect)(()=>{var _a2;if(!ref&&authorization&&(0,localStorage_1.setCustomerOrderParam)("_save_payment_source_to_customer_wallet","false"),authorization&&!loadBraintree&&!(0,isEmpty_1.default)(window)){const braintreeClient=require("braintree-web/client"),hostedFields=require("braintree-web/hosted-fields"),threeDSecure=require("braintree-web/three-d-secure");braintreeClient.create({authorization,challengeRequested:(_a2=config?.challengeRequested)!==null&&_a2!==void 0?_a2:!0},(clientErr,clientInstance)=>{if(clientErr){console.error(clientErr);return}hostedFields.create({client:clientInstance,fields,styles},(hostedFieldsErr,hostedFieldsInstance)=>{if(hostedFieldsErr){console.error(hostedFieldsErr);return}setLoadBraintree(!0),threeDSecure.create({authorization,version:2},(threeDSecureErr,threeDSInstance)=>{threeDSecureErr&&(console.error("3DSecure error",threeDSecureErr),setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:threeDSecureErr.message}])),ref.current&&(ref.current.onsubmit=paymentSource2=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield handleSubmitForm({event:ref.current,hostedFieldsInstance,threeDSInstance,paymentSource:paymentSource2})}),setPaymentRef({ref}))})})})}return()=>{setPaymentRef({ref:{current:null}}),setLoadBraintree(!1)}},[authorization,ref]),!authorization&&!loadBraintree?null:(0,jsx_runtime_1.jsx)("div",{className:containerClassName,children:(0,jsx_runtime_1.jsxs)("form",{ref,id:"braintree-form",onSubmit:handleSubmitForm,className:containerClassName,children:[(0,jsx_runtime_1.jsxs)("div",{className:fieldsContainerClassName,children:[(0,jsx_runtime_1.jsxs)("div",{className:cardContainerClassName,children:[(0,jsx_runtime_1.jsx)("label",{className:fieldLabelClassName,htmlFor:"card-number",children:(_a=fields?.number)===null||_a===void 0?void 0:_a.label}),(0,jsx_runtime_1.jsx)("div",{className:inputWrapperClassName,id:"card-number"})]}),(0,jsx_runtime_1.jsxs)("div",{className:cardDetailsContainerClassName,children:[(0,jsx_runtime_1.jsxs)("div",{className:expDateContainerClassName,children:[(0,jsx_runtime_1.jsx)("label",{className:fieldLabelClassName,htmlFor:"expiration-date",children:(_b=fields?.expirationDate)===null||_b===void 0?void 0:_b.label}),(0,jsx_runtime_1.jsx)("div",{className:inputWrapperClassName,id:"expiration-date"})]}),(0,jsx_runtime_1.jsxs)("div",{className:cvvContainerClassName,children:[(0,jsx_runtime_1.jsx)("label",{className:fieldLabelClassName,htmlFor:"cvv",children:(_c=fields?.cvv)===null||_c===void 0?void 0:_c.label}),(0,jsx_runtime_1.jsx)("div",{className:inputWrapperClassName,id:"cvv"})]})]})]}),(0,jsx_runtime_1.jsx)("div",{className:fieldsContainerClassName,children:templateCustomerSaveToWallet&&(0,jsx_runtime_1.jsx)(Parent_1.default,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})})]})})}exports.default=BraintreePayment;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'react';
|
|
2
|
-
import type { PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
|
|
3
|
-
import type { PaymentSourceProps } from './PaymentSource';
|
|
4
|
-
import { type FramesStyle } from 'frames-react';
|
|
5
|
-
export interface CheckoutComConfig {
|
|
6
|
-
containerClassName?: string;
|
|
7
|
-
hintLabel?: string;
|
|
8
|
-
name?: string;
|
|
9
|
-
success_url?: string;
|
|
10
|
-
failure_url?: string;
|
|
11
|
-
options?: {
|
|
12
|
-
style: FramesStyle;
|
|
13
|
-
};
|
|
14
|
-
[key: string]: unknown;
|
|
15
|
-
}
|
|
16
|
-
type Props = PaymentMethodConfig['checkoutComPayment'] & JSX.IntrinsicElements['div'] & {
|
|
17
|
-
show?: boolean;
|
|
18
|
-
publicKey: string;
|
|
19
|
-
locale?: string;
|
|
20
|
-
templateCustomerSaveToWallet?: PaymentSourceProps['templateCustomerSaveToWallet'];
|
|
21
|
-
};
|
|
22
|
-
export declare function CheckoutComPayment({ publicKey, options, locale, ...p }: Props): JSX.Element | null;
|
|
23
|
-
export default CheckoutComPayment;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CheckoutComPayment=CheckoutComPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),useExternalScript_1=tslib_1.__importDefault(require("../../utils/hooks/useExternalScript")),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),frames_react_1=require("frames-react"),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),localStorage_1=require("../../utils/localStorage"),scriptUrl="https://cdn.checkout.com/js/framesv2.min.js",systemLanguages=["DE-DE","EN-GB","ES-ES","FR-FR","IT-IT","KO-KR","NL-NL"],defaultOptions={style:{base:{color:"black",fontSize:"18px"},autofill:{backgroundColor:"yellow"},hover:{color:"blue"},focus:{color:"blue"},valid:{color:"green"},invalid:{color:"red"},placeholder:{base:{color:"gray"},focus:{border:"solid 1px blue"}}}};function CheckoutComPayment(_a){var{publicKey,options=defaultOptions,locale="EN-GB"}=_a,p=tslib_1.__rest(_a,["publicKey","options","locale"]);const ref=(0,react_1.useRef)(null),loaded=(0,useExternalScript_1.default)(scriptUrl),{setPaymentRef,currentPaymentMethodType,paymentSource,setPaymentSource,setPaymentMethodErrors}=(0,react_1.useContext)(PaymentMethodContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),{containerClassName,templateCustomerSaveToWallet,successUrl=window.location.href,failureUrl=window.location.href,show}=p,divProps=tslib_1.__rest(p,["containerClassName","templateCustomerSaveToWallet","successUrl","failureUrl","show"]),handleSubmit=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a2,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o;const savePaymentSourceToCustomerWallet=(_c=(_b=(_a2=ref?.current)===null||_a2===void 0?void 0:_a2.elements)===null||_b===void 0?void 0:_b.save_payment_source_to_customer_wallet)===null||_c===void 0?void 0:_c.checked;if(savePaymentSourceToCustomerWallet&&(0,localStorage_1.setCustomerOrderParam)("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),window.Frames){window.Frames.cardholder={name:(_d=order?.billing_address)===null||_d===void 0?void 0:_d.full_name,billingAddress:{addressLine1:(_e=order?.billing_address)===null||_e===void 0?void 0:_e.line_1,addressLine2:(_g=(_f=order?.billing_address)===null||_f===void 0?void 0:_f.line_2)!==null&&_g!==void 0?_g:"",zip:(_j=(_h=order?.billing_address)===null||_h===void 0?void 0:_h.zip_code)!==null&&_j!==void 0?_j:"",city:(_k=order?.billing_address)===null||_k===void 0?void 0:_k.city,state:(_l=order?.billing_address)===null||_l===void 0?void 0:_l.state_code,country:(_m=order?.billing_address)===null||_m===void 0?void 0:_m.country_code},phone:(_o=order?.billing_address)===null||_o===void 0?void 0:_o.phone};try{const data=yield window.Frames.submitCard();if(data.token&&paymentSource&¤tPaymentMethodType){const ps=yield setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{token:data.token,payment_type:"token",success_url:successUrl,failure_url:failureUrl,_authorize:!0}});ps?.redirect_uri&&(window.location.href=ps.redirect_uri)}}catch(error){console.error(error),setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:error?.message}])}}return!1}),lang=`${locale.toUpperCase()}-${locale.toUpperCase()}`,localization=systemLanguages.includes(lang)?lang:"EN-GB";return loaded&&show?(0,jsx_runtime_1.jsxs)("form",{ref,children:[(0,jsx_runtime_1.jsx)("div",Object.assign({className:containerClassName},divProps,{children:(0,jsx_runtime_1.jsxs)(frames_react_1.Frames,{config:Object.assign({debug:!0,publicKey,localization},options),cardValidationChanged:e=>{e.isValid&&ref.current&&(ref.current.onsubmit=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield handleSubmit()}),setPaymentRef({ref}))},cardTokenized:data=>data,children:[(0,jsx_runtime_1.jsx)(frames_react_1.CardNumber,{}),(0,jsx_runtime_1.jsx)(frames_react_1.ExpiryDate,{}),(0,jsx_runtime_1.jsx)(frames_react_1.Cvv,{})]})})),templateCustomerSaveToWallet&&(0,jsx_runtime_1.jsx)(Parent_1.default,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})]}):null}exports.default=CheckoutComPayment;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ChildrenFunction } from '../../typings/index';
|
|
2
|
-
import type { StripeElementLocale } from '@stripe/stripe-js';
|
|
3
|
-
import { type JSX } from 'react';
|
|
4
|
-
import type { PaymentSourceProps } from './PaymentSource';
|
|
5
|
-
export interface ExternalPaymentConfig {
|
|
6
|
-
/**
|
|
7
|
-
* Show the component. Default is false
|
|
8
|
-
*/
|
|
9
|
-
show?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Use to display information about the external payment or whatever else.
|
|
12
|
-
*/
|
|
13
|
-
customComponent?: ChildrenFunction<Omit<Props, 'customComponent'>>;
|
|
14
|
-
/**
|
|
15
|
-
* The payment source token, as generated by the external gateway SDK. Credit Card numbers are rejected.
|
|
16
|
-
*/
|
|
17
|
-
payment_source_token: string;
|
|
18
|
-
}
|
|
19
|
-
interface Props extends Omit<ExternalPaymentConfig, 'payment_source_token'>, Pick<PaymentSourceProps, 'templateCustomerSaveToWallet'> {
|
|
20
|
-
paymentSourceToken: string;
|
|
21
|
-
locale?: StripeElementLocale;
|
|
22
|
-
}
|
|
23
|
-
export declare function ExternalPayment(props: Props): JSX.Element | null;
|
|
24
|
-
export default ExternalPayment;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ExternalPayment=ExternalPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),react_1=require("react"),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext"));function ExternalPayment(props){const{setPaymentRef}=(0,react_1.useContext)(PaymentMethodContext_1.default),{order,updateOrder}=(0,react_1.useContext)(OrderContext_1.default),ref=(0,react_1.useRef)(null);(0,react_1.useEffect)(()=>{ref?.current!=null&&(ref.current.onsubmit=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){return!0}),setPaymentRef({ref}))},[ref]);const parentProps=Object.assign(Object.assign({},props),{order,updateOrder});return props?.customComponent!=null&&props.show?(0,jsx_runtime_1.jsxs)("form",{ref,children:[(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.customComponent})),props?.templateCustomerSaveToWallet!=null&&(0,jsx_runtime_1.jsx)(Parent_1.default,{name:"save_payment_source_to_customer_wallet",children:props.templateCustomerSaveToWallet})]}):null}exports.default=ExternalPayment;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'react';
|
|
2
|
-
import type { PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
|
|
3
|
-
import type { PaymentSourceProps } from './PaymentSource';
|
|
4
|
-
type KlarnaPaymentProps = PaymentMethodConfig['klarnaPayment'] & JSX.IntrinsicElements['div'] & Partial<PaymentSourceProps['templateCustomerSaveToWallet']> & {
|
|
5
|
-
show?: boolean;
|
|
6
|
-
clientToken: string;
|
|
7
|
-
locale?: string | null;
|
|
8
|
-
};
|
|
9
|
-
export default function KlarnaPayment({ clientToken, placeOrderCallback, locale, ...p }: KlarnaPaymentProps): JSX.Element | null;
|
|
10
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=KlarnaPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),useExternalScript_1=tslib_1.__importDefault(require("../../utils/hooks/useExternalScript"));function typeOfLine(lineItemType){switch(lineItemType){case"percentage_discount_promotions":return"discount";case"shipments":return"shipping_fee";case"skus":return"physical";case"payment_methods":default:return null}}function klarnaOrderLines(lineItems){return lineItems?lineItems?.map(item=>{const type=item.item_type?typeOfLine(item.item_type):null;return{quantity:item.quantity,total_amount:item.total_amount_cents,unit_price:item.unit_amount_cents,type}}):[]}function KlarnaPayment(_a){var{clientToken,placeOrderCallback,locale="EN"}=_a,p=tslib_1.__rest(_a,["clientToken","placeOrderCallback","locale"]);const ref=(0,react_1.useRef)(null),{paymentSource,currentPaymentMethodType,setPaymentRef,setPaymentSource}=(0,react_1.useContext)(PaymentMethodContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),loaded=(0,useExternalScript_1.default)("https://x.klarnacdn.net/kp/lib/v1/api.js"),[klarna,setKlarna]=(0,react_1.useState)(),{containerClassName}=p,divProps=tslib_1.__rest(p,["containerClassName"]);(0,react_1.useEffect)(()=>{loaded&&window?.Klarna!==void 0&&setKlarna(window.Klarna)},[loaded,window.Klarna]),(0,react_1.useEffect)(()=>(ref.current&&paymentSource&¤tPaymentMethodType&&loaded&&klarna&&(ref.current.onsubmit=props=>tslib_1.__awaiter(this,void 0,void 0,function*(){handleClick(klarna,props)}),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,paymentSource,currentPaymentMethodType,loaded,klarna]);const handleClick=(kl,props)=>{var _a2,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q,_r;const[first]=paymentSource?.payment_methods||void 0,paymentMethodCategories=first?.identifier,billingAddress={given_name:(_a2=order?.billing_address)===null||_a2===void 0?void 0:_a2.first_name,family_name:(_b=order?.billing_address)===null||_b===void 0?void 0:_b.last_name,email:order?.customer_email,street_address:(_c=order?.billing_address)===null||_c===void 0?void 0:_c.line_1,street_address2:null,organization_name:null,postal_code:(_d=order?.billing_address)===null||_d===void 0?void 0:_d.zip_code,city:(_e=order?.billing_address)===null||_e===void 0?void 0:_e.city,region:(_f=order?.billing_address)===null||_f===void 0?void 0:_f.state_code,phone:(_g=order?.billing_address)===null||_g===void 0?void 0:_g.phone,country:(_h=order?.billing_address)===null||_h===void 0?void 0:_h.country_code},shippingAddress={given_name:(_j=order?.shipping_address)===null||_j===void 0?void 0:_j.first_name,family_name:(_k=order?.shipping_address)===null||_k===void 0?void 0:_k.last_name,email:order?.customer_email,street_address:(_l=order?.shipping_address)===null||_l===void 0?void 0:_l.line_1,street_address2:null,postal_code:(_m=order?.shipping_address)===null||_m===void 0?void 0:_m.zip_code,organization_name:null,city:(_o=order?.shipping_address)===null||_o===void 0?void 0:_o.city,region:(_p=order?.shipping_address)===null||_p===void 0?void 0:_p.state_code,phone:(_q=order?.shipping_address)===null||_q===void 0?void 0:_q.phone,country:(_r=order?.shipping_address)===null||_r===void 0?void 0:_r.country_code},klarnaData={merchant_data:order?.id,purchase_country:order?.country_code,purchase_currency:order?.currency_code,locale,shipping_address:shippingAddress,billing_address:billingAddress,order_amount:order?.total_amount_cents,order_lines:klarnaOrderLines(order?.line_items),order_tax_amount:order?.total_tax_amount_cents};kl.Payments.authorize(Object.assign({payment_method_category:paymentMethodCategories},klarnaData),function(res){return tslib_1.__awaiter(this,void 0,void 0,function*(){if(res.approved&&paymentSource&¤tPaymentMethodType){const ps=yield setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{auth_token:res.authorization_token}});if(props.setPlaceOrder!=null){const placed=yield props.setPlaceOrder({paymentSource:ps});placed&&props.onclickCallback!=null&&props.onclickCallback(placed)}}})})};if(klarna&&clientToken){const[first]=paymentSource?.payment_methods||void 0;klarna.Payments.init({client_token:clientToken}),klarna.Payments.load({container:"#klarna-payments-container",payment_method_category:first?.identifier})}return(0,jsx_runtime_1.jsx)("form",{ref,children:(0,jsx_runtime_1.jsx)("div",Object.assign({className:containerClassName},divProps,{children:(0,jsx_runtime_1.jsx)("div",{id:"klarna-payments-container"})}))})}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'react';
|
|
2
|
-
import type { LoaderType } from '../../typings/index';
|
|
3
|
-
import type { CustomerCardsTemplateChildren } from '../utils/PaymentCardsTemplate';
|
|
4
|
-
export interface CustomerCardsProps {
|
|
5
|
-
handleClick: () => void;
|
|
6
|
-
}
|
|
7
|
-
export interface CustomerSaveToWalletProps {
|
|
8
|
-
name: 'save_payment_source_to_customer_wallet';
|
|
9
|
-
}
|
|
10
|
-
export interface PaymentSourceProps extends Omit<JSX.IntrinsicElements['div'], 'children'> {
|
|
11
|
-
children?: JSX.Element | JSX.Element[];
|
|
12
|
-
readonly?: boolean;
|
|
13
|
-
templateCustomerCards?: CustomerCardsTemplateChildren;
|
|
14
|
-
onClickCustomerCards?: () => void;
|
|
15
|
-
templateCustomerSaveToWallet?: (props: CustomerSaveToWalletProps) => JSX.Element;
|
|
16
|
-
loader?: LoaderType;
|
|
17
|
-
}
|
|
18
|
-
export declare function PaymentSource(props: PaymentSourceProps): JSX.Element;
|
|
19
|
-
export default PaymentSource;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSource=PaymentSource;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),PaymentMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodChildrenContext")),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),PaymentGateway_1=tslib_1.__importDefault(require("../payment_gateways/PaymentGateway")),getCardDetails_1=tslib_1.__importDefault(require("../../utils/getCardDetails")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext"));function PaymentSource(props){const{readonly}=props,{payment,expressPayments}=(0,react_1.useContext)(PaymentMethodChildrenContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),{payments}=(0,react_1.useContext)(CustomerContext_1.default),{currentPaymentMethodId,paymentSource,destroyPaymentSource,currentPaymentMethodType,currentCustomerPaymentSourceId}=(0,react_1.useContext)(PaymentMethodContext_1.default),[show,setShow]=(0,react_1.useState)(!1),[showCard,setShowCard]=(0,react_1.useState)(!1);(0,react_1.useEffect)(()=>{const isCustomerPaymentSource=currentCustomerPaymentSourceId!=null&¤tCustomerPaymentSourceId===paymentSource?.id;if(readonly)setShow(!0),setShowCard(!0);else if((payment?.id===currentPaymentMethodId||isCustomerPaymentSource)&&!expressPayments){setShow(!0);const card=(0,getCardDetails_1.default)({paymentType:payment?.payment_source_type,customerPayment:{payment_source:paymentSource}});isCustomerPaymentSource&&card.brand===""&&(card.brand=card.issuer_type!=null&&card.issuer_type!==""?card.issuer_type:"credit-card"),card.brand&&setShowCard(!0)}else setShow(!!(expressPayments&¤tPaymentMethodType==="stripe_payments"));return()=>{setShow(!1),setShowCard(!1)}},[currentPaymentMethodId,paymentSource?.id,payments!=null,payment!=null,readonly,order?.status,expressPayments]);const handleEditClick=e=>tslib_1.__awaiter(this,void 0,void 0,function*(){if(e.stopPropagation(),paymentSource){const paymentSourceId=paymentSource?.id;yield destroyPaymentSource({paymentSourceId,paymentResource:payment?.payment_source_type})}setShowCard(!showCard),setShow(!0)}),gatewayProps=Object.assign(Object.assign({},props),{show,showCard,handleEditClick,readonly});return(0,jsx_runtime_1.jsx)(PaymentGateway_1.default,Object.assign({},gatewayProps))}exports.default=PaymentSource;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type IconBrand } from '../../context/PaymentSourceContext';
|
|
2
|
-
import { type JSX } from 'react';
|
|
3
|
-
import type { ChildrenFunction } from '../../typings/index';
|
|
4
|
-
interface ChildrenProps extends Omit<Props, 'children'> {
|
|
5
|
-
brand: IconBrand;
|
|
6
|
-
defaultSrc: string;
|
|
7
|
-
url: string;
|
|
8
|
-
}
|
|
9
|
-
interface Props extends Omit<JSX.IntrinsicElements['img'], 'children'> {
|
|
10
|
-
children?: ChildrenFunction<ChildrenProps>;
|
|
11
|
-
width?: number;
|
|
12
|
-
height?: number;
|
|
13
|
-
}
|
|
14
|
-
export declare function PaymentSourceBrandIcon({ src, width, children, ...p }: Props): JSX.Element;
|
|
15
|
-
export default PaymentSourceBrandIcon;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSourceBrandIcon=PaymentSourceBrandIcon;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentSourceContext_1=tslib_1.__importDefault(require("../../context/PaymentSourceContext")),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CustomerPaymentSourceContext_1=tslib_1.__importDefault(require("../../context/CustomerPaymentSourceContext"));function PaymentSourceBrandIcon(_a){var _b,_c,{src,width=32,children}=_a,p=tslib_1.__rest(_a,["src","width","children"]);const{brand,issuer_type:issuerType}=(0,react_1.useContext)(PaymentSourceContext_1.default),{brand:customerCardBrand,issuer_type:customerIssuerType}=(0,react_1.useContext)(CustomerPaymentSourceContext_1.default),cardBrand=(_c=(_b=brand??customerCardBrand)!==null&&_b!==void 0?_b:issuerType)!==null&&_c!==void 0?_c:customerIssuerType,ref=(0,react_1.useRef)(null),defaultSrc="//data.commercelayer.app/assets/images/icons/credit-cards/color/credit-card.svg",url=src||`//data.commercelayer.app/assets/images/icons/credit-cards/color/${cardBrand??"credit-card"}.svg`,handleError=()=>{ref.current&&(ref.current.src=defaultSrc)},parentProps=Object.assign({brand:cardBrand,defaultSrc,url,width},p);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("img",Object.assign({ref,src:url,onError:handleError,width},p))}exports.default=PaymentSourceBrandIcon;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type IconBrand } from '../../context/PaymentSourceContext';
|
|
2
|
-
import { type JSX } from 'react';
|
|
3
|
-
import type { ChildrenFunction } from '../../typings/index';
|
|
4
|
-
interface CustomComponent extends Omit<Props, 'children'> {
|
|
5
|
-
brand: IconBrand;
|
|
6
|
-
}
|
|
7
|
-
interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
|
|
8
|
-
children?: ChildrenFunction<CustomComponent>;
|
|
9
|
-
label?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function PaymentSourceBrandName({ children, label, ...props }: Props): JSX.Element;
|
|
12
|
-
export default PaymentSourceBrandName;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSourceBrandName=PaymentSourceBrandName;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentSourceContext_1=tslib_1.__importDefault(require("../../context/PaymentSourceContext")),capitalize_1=tslib_1.__importDefault(require("lodash/capitalize")),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CustomerPaymentSourceContext_1=tslib_1.__importDefault(require("../../context/CustomerPaymentSourceContext"));function PaymentSourceBrandName(_a){var{children,label}=_a,props=tslib_1.__rest(_a,["children","label"]);const{brand}=(0,react_1.useContext)(PaymentSourceContext_1.default),{brand:customerCardBrand}=(0,react_1.useContext)(CustomerPaymentSourceContext_1.default),cardBrand=brand??customerCardBrand,brandName=cardBrand&&(0,capitalize_1.default)(cardBrand.replace(/_|-/gm," ")),parentProps=Object.assign({brand:brandName,label},props);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},props,{children:label||(0,capitalize_1.default)(brandName)}))}exports.default=PaymentSourceBrandName;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'react';
|
|
2
|
-
import type { ChildrenFunction } from '../../typings/index';
|
|
3
|
-
export type PaymentSourceDetailType = 'last4' | 'exp_year' | 'exp_month';
|
|
4
|
-
interface ChildrenProps extends Omit<Props, 'children'> {
|
|
5
|
-
text: string;
|
|
6
|
-
}
|
|
7
|
-
interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
|
|
8
|
-
children?: ChildrenFunction<ChildrenProps>;
|
|
9
|
-
/**
|
|
10
|
-
* Type of detail to display
|
|
11
|
-
*/
|
|
12
|
-
type: PaymentSourceDetailType;
|
|
13
|
-
}
|
|
14
|
-
export declare function PaymentSourceDetail({ type, children, ...p }: Props): JSX.Element;
|
|
15
|
-
export default PaymentSourceDetail;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSourceDetail=PaymentSourceDetail;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentSourceContext_1=tslib_1.__importDefault(require("../../context/PaymentSourceContext")),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CustomerPaymentSourceContext_1=tslib_1.__importDefault(require("../../context/CustomerPaymentSourceContext"));function PaymentSourceDetail(_a){var{type,children}=_a,p=tslib_1.__rest(_a,["type","children"]);const card=(0,react_1.useContext)(PaymentSourceContext_1.default),customerCard=(0,react_1.useContext)(CustomerPaymentSourceContext_1.default),cardObj=Object.keys(card).length>0?card:customerCard,text=type in cardObj&&cardObj[type]!=null?cardObj[type]:type==="last4"?"****":"**",parentProps=Object.assign({type,text},p);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},p,{children:text}))}exports.default=PaymentSourceDetail;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type ReactNode, type JSX } from 'react';
|
|
2
|
-
import type { ChildrenFunction } from '../../typings/index';
|
|
3
|
-
interface CustomComponent extends Omit<Props, 'children'> {
|
|
4
|
-
}
|
|
5
|
-
type Props = {
|
|
6
|
-
children?: ChildrenFunction<CustomComponent>;
|
|
7
|
-
label?: string | ReactNode;
|
|
8
|
-
} & Omit<JSX.IntrinsicElements['button'], 'onClick'>;
|
|
9
|
-
export declare function PaymentSourceEditButton({ children, label, ...props }: Props): JSX.Element | null;
|
|
10
|
-
export default PaymentSourceEditButton;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSourceEditButton=PaymentSourceEditButton;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentSourceContext_1=tslib_1.__importDefault(require("../../context/PaymentSourceContext")),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function PaymentSourceEditButton(_a){var{children,label="Edit"}=_a,props=tslib_1.__rest(_a,["children","label"]);const{showCard,handleEditClick,readonly}=(0,react_1.useContext)(PaymentSourceContext_1.default),parentProps=Object.assign({showCard,label,handleEditClick},props);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):readonly?null:(0,jsx_runtime_1.jsx)("button",Object.assign({},props,{onClick:handleEditClick,children:label}))}exports.default=PaymentSourceEditButton;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type ReactNode, type JSX } from 'react';
|
|
2
|
-
export interface PaypalConfig {
|
|
3
|
-
return_url: string;
|
|
4
|
-
cancel_url: string;
|
|
5
|
-
infoMessage?: {
|
|
6
|
-
text?: string | ReactNode;
|
|
7
|
-
className?: string;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
type Props = Omit<PaypalConfig, 'return_url' | 'cancel_url'> & JSX.IntrinsicElements['div'];
|
|
11
|
-
export declare function PaypalPayment({ infoMessage, ...p }: Props): JSX.Element | null;
|
|
12
|
-
export default PaypalPayment;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaypalPayment=PaypalPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),isFunction_1=tslib_1.__importDefault(require("lodash/isFunction")),react_1=require("react"),defaultMessage="by placing the order, you will be redirected to the PayPal website to sign in and authorize the payment";function PaypalPayment(_a){var{infoMessage}=_a,p=tslib_1.__rest(_a,["infoMessage"]);const ref=(0,react_1.useRef)(null),{setPaymentSource,paymentSource,currentPaymentMethodType,setPaymentRef}=(0,react_1.useContext)(PaymentMethodContext_1.default);(0,react_1.useEffect)(()=>(ref.current&&paymentSource&¤tPaymentMethodType&&paymentSource?.approval_url&&(ref.current.onsubmit=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield handleClick()}),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,paymentSource,currentPaymentMethodType]);const handleClick=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){if(paymentSource&¤tPaymentMethodType)try{return yield setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{metadata:{card:{id:paymentSource.id,brand:"paypal",last4:""}}}}),!0}catch{return!1}return!1});return(0,jsx_runtime_1.jsx)("form",{ref,children:(0,jsx_runtime_1.jsx)("div",Object.assign({},p,{children:(0,jsx_runtime_1.jsx)("span",{className:infoMessage?.className,children:(0,isFunction_1.default)(infoMessage?.text)?infoMessage?.text():infoMessage?.text||defaultMessage})}))})}exports.default=PaypalPayment;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StripeExpressPayment=StripeExpressPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),expressPaymentHelper_1=require("../../utils/expressPaymentHelper"),isEmpty_1=require("../../utils/isEmpty"),react_stripe_js_1=require("@stripe/react-stripe-js"),react_1=require("react");function StripeExpressPayment({clientSecret}){const stripe=(0,react_stripe_js_1.useStripe)(),[paymentRequest,setPaymentRequest]=(0,react_1.useState)(null),{accessToken,endpoint}=(0,react_1.useContext)(CommerceLayerContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),{paymentMethods,paymentSource}=(0,react_1.useContext)(PaymentMethodContext_1.default);return(0,react_1.useEffect)(()=>{var _a,_b,_c,_d,_e;if(stripe==null||order==null)return;const pr=stripe.paymentRequest({country:(_a=order?.country_code)!==null&&_a!==void 0?_a:"US",currency:(_c=(_b=order?.currency_code)===null||_b===void 0?void 0:_b.toLowerCase())!==null&&_c!==void 0?_c:"",total:{label:`#${(_d=order?.number)!==null&&_d!==void 0?_d:""}`,amount:(_e=order?.total_amount_with_taxes_cents)!==null&&_e!==void 0?_e:0},requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:!0});pr.canMakePayment().then(result=>{result&&setPaymentRequest(pr)}).catch(err=>{console.error("Can make payment:",err)})},[(0,isEmpty_1.isEmpty)(stripe),(0,isEmpty_1.isEmpty)(order)]),paymentRequest!=null&&stripe!=null?(paymentRequest.on("shippingaddresschange",ev=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a,_b,_c,_d,_e,_f,_g;if(order!=null&&accessToken!=null&&endpoint!=null){const requiresBillingInfo=(_a=order?.requires_billing_info)!==null&&_a!==void 0?_a:!1,orderWithShipments=yield(0,expressPaymentHelper_1.setExpressFakeAddress)({orderId:order.id,config:{accessToken,endpoint},address:{first_name:"Fake name",last_name:"Fake lastname",country_code:(_b=ev.shippingAddress.country)!==null&&_b!==void 0?_b:"",line_1:"Fake street 123",city:(_c=ev.shippingAddress.city)!==null&&_c!==void 0?_c:"Fake city",zip_code:(_d=ev.shippingAddress.postalCode)!==null&&_d!==void 0?_d:"12345",state_code:(_e=ev.shippingAddress.region)!==null&&_e!==void 0?_e:"Fake state",phone:"1234567890",billing_info:requiresBillingInfo?"Fake billing info":void 0}}),shippingOptions=(0,expressPaymentHelper_1.getExpressShippingMethods)(orderWithShipments);shippingOptions!=null&&!(0,isEmpty_1.isEmpty)(shippingOptions)?ev.updateWith({status:"success",shippingOptions,total:{label:`#${(_f=orderWithShipments?.number)!==null&&_f!==void 0?_f:""}`,amount:(_g=orderWithShipments?.total_amount_with_taxes_cents)!==null&&_g!==void 0?_g:0}}):ev.updateWith({status:"invalid_shipping_address"})}else ev.updateWith({status:"fail"})})),paymentRequest.on("shippingoptionchange",ev=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a,_b;if(order!=null&&accessToken!=null&&endpoint!=null){const updatedOrder=yield(0,expressPaymentHelper_1.setExpressShippingMethod)({orderId:order.id,config:{accessToken,endpoint},selectFirst:!1,selectedShippingMethodId:ev.shippingOption.id,params:{include:["shipments.available_shipping_methods"]}});ev.updateWith({status:"success",total:{label:`#${(_a=updatedOrder?.number)!==null&&_a!==void 0?_a:""}`,amount:(_b=updatedOrder?.total_amount_with_taxes_cents)!==null&&_b!==void 0?_b:0}})}else ev.updateWith({status:"fail"})})),paymentRequest.on("paymentmethod",ev=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q,_r;if(order?.id==null)throw new Error("Order is null");if(paymentMethods==null)throw new Error("Payment methods are null");const[paymentMethod]=(0,expressPaymentHelper_1.getAvailableExpressPayments)(paymentMethods);if(paymentMethod==null)throw new Error("Payment method is null");if(paymentSource==null)throw new Error("Payment source is null");const requiresBillingInfo=(_a=order?.requires_billing_info)!==null&&_a!==void 0?_a:!1,paymentResource=paymentMethod?.payment_source_type;if(accessToken!=null&&endpoint!=null){const[firstName,lastName]=(_c=(_b=ev.payerName)===null||_b===void 0?void 0:_b.split(" "))!==null&&_c!==void 0?_c:[],[line]=(_e=(_d=ev.shippingAddress)===null||_d===void 0?void 0:_d.addressLine)!==null&&_e!==void 0?_e:"",email=(_f=ev.payerEmail)!==null&&_f!==void 0?_f:"";yield(0,expressPaymentHelper_1.setExpressFakeAddress)({orderId:order.id,config:{accessToken,endpoint},address:{first_name:firstName??"Fake name",last_name:lastName??"Fake lastname",country_code:(_h=(_g=ev?.shippingAddress)===null||_g===void 0?void 0:_g.country)!==null&&_h!==void 0?_h:"",line_1:line??"Fake street 123",city:(_k=(_j=ev?.shippingAddress)===null||_j===void 0?void 0:_j.city)!==null&&_k!==void 0?_k:"Fake city",zip_code:(_m=(_l=ev?.shippingAddress)===null||_l===void 0?void 0:_l.postalCode)!==null&&_m!==void 0?_m:"12345",state_code:(_p=(_o=ev?.shippingAddress)===null||_o===void 0?void 0:_o.region)!==null&&_p!==void 0?_p:"Fake state",phone:(_q=ev?.payerPhone)!==null&&_q!==void 0?_q:"1234567890",billing_info:requiresBillingInfo?"Fake billing info":void 0},email}),yield(0,expressPaymentHelper_1.setExpressShippingMethod)({orderId:order.id,config:{accessToken,endpoint},selectFirst:!1,selectedShippingMethodId:(_r=ev?.shippingOption)===null||_r===void 0?void 0:_r.id,params:{include:["shipments.available_shipping_methods"]}});const placeOrderParams={config:{accessToken,endpoint},orderId:order?.id,paymentResource,paymentSourceId:paymentSource?.id};yield(0,expressPaymentHelper_1.setExpressPlaceOrder)(placeOrderParams);const{paymentIntent,error:confirmError}=yield stripe.confirmCardPayment(clientSecret,{payment_method:ev.paymentMethod.id},{handleActions:!1});if(confirmError)ev.complete("fail"),console.error("Confirm card payment:",confirmError);else if(ev.complete("success"),paymentIntent.status==="requires_action"){const{error}=yield stripe.confirmCardPayment(clientSecret);if(error)console.error("Confirm card payment:",error);else{const placeOrderParams2={config:{accessToken,endpoint},orderId:order?.id,placeTheOrder:!0};try{const order2=yield(0,expressPaymentHelper_1.setExpressPlaceOrder)(placeOrderParams2);ev.complete("success"),(0,expressPaymentHelper_1.expressRedirectUrl)({order:order2,config:{accessToken,endpoint}})}catch(err){console.error("Place order:",err),ev.complete("fail")}}}else{const placeOrderParams2={config:{accessToken,endpoint},orderId:order?.id,placeTheOrder:!0};try{const order2=yield(0,expressPaymentHelper_1.setExpressPlaceOrder)(placeOrderParams2);ev.complete("success"),(0,expressPaymentHelper_1.expressRedirectUrl)({order:order2,config:{accessToken,endpoint}})}catch(err){console.error("Place order:",err),ev.complete("fail")}}}})),(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:(0,jsx_runtime_1.jsx)(react_stripe_js_1.PaymentRequestButtonElement,{className:"",options:{paymentRequest}})})):null}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'react';
|
|
2
|
-
import type { StripeElementLocale, StripeElementsOptions, StripePaymentElementOptions } from '@stripe/stripe-js';
|
|
3
|
-
import type { PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
|
|
4
|
-
import type { PaymentSourceProps } from './PaymentSource';
|
|
5
|
-
export interface StripeConfig {
|
|
6
|
-
containerClassName?: string;
|
|
7
|
-
hintLabel?: string;
|
|
8
|
-
name?: string;
|
|
9
|
-
options?: StripePaymentElementOptions;
|
|
10
|
-
appearance?: StripeElementsOptions['appearance'];
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
}
|
|
13
|
-
type Props = PaymentMethodConfig['stripePayment'] & Omit<JSX.IntrinsicElements['div'], 'ref'> & Partial<PaymentSourceProps['templateCustomerSaveToWallet']> & {
|
|
14
|
-
show?: boolean;
|
|
15
|
-
publishableKey: string;
|
|
16
|
-
locale?: StripeElementLocale;
|
|
17
|
-
clientSecret: string;
|
|
18
|
-
expressPayments?: boolean;
|
|
19
|
-
};
|
|
20
|
-
export declare function StripePayment({ publishableKey, show, options, clientSecret, locale, expressPayments, ...p }: Props): JSX.Element | null;
|
|
21
|
-
export default StripePayment;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StripePayment=StripePayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),react_stripe_js_1=require("@stripe/react-stripe-js"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),localStorage_1=require("../../utils/localStorage"),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),StripeExpressPayment_1=require("./StripeExpressPayment"),defaultOptions={layout:{type:"accordion",defaultCollapsed:!1,radios:!0,spacedAccordionItems:!1},fields:{billingDetails:"never"}},defaultAppearance={theme:"stripe",variables:{colorText:"#32325d",fontFamily:'"Helvetica Neue", Helvetica, sans-serif'}};function StripePaymentForm({options=defaultOptions,templateCustomerSaveToWallet}){const ref=(0,react_1.useRef)(null),{currentPaymentMethodType,setPaymentMethodErrors,setPaymentRef}=(0,react_1.useContext)(PaymentMethodContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),stripe=(0,react_stripe_js_1.useStripe)(),elements=(0,react_stripe_js_1.useElements)();(0,react_1.useEffect)(()=>(ref.current&&stripe&&elements&&(ref.current.onsubmit=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield onSubmit({event:ref.current,stripe,elements})}),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,stripe,elements]);const onSubmit=_a=>tslib_1.__awaiter(this,[_a],void 0,function*({event,stripe:stripe2,elements:elements2}){var _b,_c,_d,_e,_f,_g,_h;if(!stripe2)return!1;const savePaymentSourceToCustomerWallet=(_c=(_b=event?.elements)===null||_b===void 0?void 0:_b.save_payment_source_to_customer_wallet)===null||_c===void 0?void 0:_c.checked;if(savePaymentSourceToCustomerWallet&&(0,localStorage_1.setCustomerOrderParam)("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),elements2!=null){const billingInfo=order?.billing_address,email=(_d=order?.customer_email)!==null&&_d!==void 0?_d:"",billingDetails={name:(_e=billingInfo?.full_name)!==null&&_e!==void 0?_e:"",email,phone:billingInfo?.phone,address:{city:billingInfo?.city,country:billingInfo?.country_code,line1:billingInfo?.line_1,line2:(_f=billingInfo?.line_2)!==null&&_f!==void 0?_f:"",postal_code:(_g=billingInfo?.zip_code)!==null&&_g!==void 0?_g:"",state:billingInfo?.state_code}},url=new URL(window.location.href),cleanUrl=`${url.origin}${url.pathname}?accessToken=${url.searchParams.get("accessToken")}`,{error}=yield stripe2.confirmPayment({elements:elements2,confirmParams:{return_url:cleanUrl,payment_method_data:{billing_details:billingDetails}},redirect:"if_required"});return error?(console.error(error),setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:(_h=error.message)!==null&&_h!==void 0?_h:""}]),!1):!0}return!1});return(0,jsx_runtime_1.jsxs)("form",{ref,children:[(0,jsx_runtime_1.jsx)(react_stripe_js_1.PaymentElement,{id:"payment-element",options:Object.assign(Object.assign({},defaultOptions),options)}),templateCustomerSaveToWallet&&(0,jsx_runtime_1.jsx)(Parent_1.default,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})]})}function StripePayment(_a){var{publishableKey,show,options,clientSecret,locale="auto",expressPayments=!1}=_a,p=tslib_1.__rest(_a,["publishableKey","show","options","clientSecret","locale","expressPayments"]);const[isLoaded,setIsLoaded]=(0,react_1.useState)(!1),[stripe,setStripe]=(0,react_1.useState)(null),{containerClassName,templateCustomerSaveToWallet,fonts=[],appearance}=p,divProps=tslib_1.__rest(p,["containerClassName","templateCustomerSaveToWallet","fonts","appearance"]);(0,react_1.useEffect)(()=>(show&&publishableKey&&Promise.resolve().then(()=>tslib_1.__importStar(require("@stripe/stripe-js"))).then(({loadStripe})=>{(()=>tslib_1.__awaiter(this,void 0,void 0,function*(){const res=yield loadStripe(publishableKey,{locale});res!=null&&(setStripe(res),setIsLoaded(!0))}))()}),()=>{setIsLoaded(!1)}),[show,publishableKey]);const elementsOptions={clientSecret,appearance:Object.assign(Object.assign({},defaultAppearance),appearance),fonts};return isLoaded&&stripe!=null&&clientSecret!=null?(0,jsx_runtime_1.jsx)("div",Object.assign({className:containerClassName},divProps,{children:(0,jsx_runtime_1.jsx)(react_stripe_js_1.Elements,{stripe,options:elementsOptions,children:expressPayments?(0,jsx_runtime_1.jsx)(StripeExpressPayment_1.StripeExpressPayment,{clientSecret}):(0,jsx_runtime_1.jsx)(StripePaymentForm,{options,templateCustomerSaveToWallet})})})):null}exports.default=StripePayment;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'react';
|
|
2
|
-
export interface WireTransferConfig {
|
|
3
|
-
infoMessage?: {
|
|
4
|
-
text?: string | JSX.Element[];
|
|
5
|
-
className?: string;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
type Props = WireTransferConfig & JSX.IntrinsicElements['div'] & {
|
|
9
|
-
'data-testid'?: string;
|
|
10
|
-
};
|
|
11
|
-
export declare function WireTransferPayment({ infoMessage, ...p }: Props): JSX.Element;
|
|
12
|
-
export default WireTransferPayment;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WireTransferPayment=WireTransferPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),react_1=require("react"),defaultMessage="after placing the order, you will need to manually complete the payment with your bank";function WireTransferPayment(_a){var _b,{infoMessage}=_a,p=tslib_1.__rest(_a,["infoMessage"]);const{className,"data-testid":dataTestId}=p,ref=(0,react_1.useRef)(null),{setPaymentSource,paymentSource,currentPaymentMethodType,setPaymentRef}=(0,react_1.useContext)(PaymentMethodContext_1.default);(0,react_1.useEffect)(()=>(ref.current&&paymentSource&¤tPaymentMethodType&&(ref.current.onsubmit=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield handleClick()}),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,paymentSource,currentPaymentMethodType]);const handleClick=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){if(paymentSource&¤tPaymentMethodType)try{return yield setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{metadata:{card:{id:paymentSource.id,brand:"wire-transfer",last4:""}}}}),!0}catch{return!1}return!1});return(0,jsx_runtime_1.jsx)("form",{ref,children:(0,jsx_runtime_1.jsx)("div",{className,"data-testid":dataTestId,children:(0,jsx_runtime_1.jsx)("span",{className:infoMessage?.className,children:(_b=infoMessage?.text)!==null&&_b!==void 0?_b:defaultMessage})})})}exports.default=WireTransferPayment;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'react';
|
|
2
|
-
import type { Price as PriceType } from '@commercelayer/sdk';
|
|
3
|
-
import type { ChildrenFunction, LoaderType } from '../../typings/index';
|
|
4
|
-
interface PriceChildrenProps extends Omit<PriceProps, 'children'> {
|
|
5
|
-
loading: boolean;
|
|
6
|
-
loader: LoaderType;
|
|
7
|
-
prices: PriceType[];
|
|
8
|
-
}
|
|
9
|
-
export interface PriceProps extends Omit<JSX.IntrinsicElements['span'], 'children' | 'ref'> {
|
|
10
|
-
children?: ChildrenFunction<PriceChildrenProps>;
|
|
11
|
-
/**
|
|
12
|
-
* CSS class name to be added for the compare price
|
|
13
|
-
*/
|
|
14
|
-
compareClassName?: string;
|
|
15
|
-
/**
|
|
16
|
-
* When `false` the compare_at price will not be displayed
|
|
17
|
-
* @default true
|
|
18
|
-
*/
|
|
19
|
-
showCompare?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* The `sku_code` of the price to be fetched
|
|
22
|
-
*/
|
|
23
|
-
skuCode?: string | null;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* To display the price of your products with localized currency, discounts, and personalization rules, as shown in the code snippets below.
|
|
27
|
-
*
|
|
28
|
-
* Each price has an amount (the actual selling price) and an optional compare-at amount (the full price that you want to display to the customer — typically with a strikethrough).
|
|
29
|
-
* This component is the owner of the price information. It fetches the price of the specified SKU and dispatches it to the cl-price-amount children.
|
|
30
|
-
* <span type='info'>
|
|
31
|
-
* By default it shows the `formatted_amount` and `formatted_compare_at_amount` of the first price object, but it also allows to access to the full `Price`object via children props.
|
|
32
|
-
* </span>
|
|
33
|
-
*/
|
|
34
|
-
export declare function Price(props: PriceProps): JSX.Element;
|
|
35
|
-
export default Price;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Price=Price;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),PricesContext_1=tslib_1.__importDefault(require("../../context/PricesContext")),react_1=require("react"),getPrices_1=require("../../utils/getPrices"),SkuChildrenContext_1=tslib_1.__importDefault(require("../../context/SkuChildrenContext"));function Price(props){const{children,skuCode=""}=props,{prices,skuCode:pricesSkuCode,loading,skuCodes,setSkuCodes,loader}=(0,react_1.useContext)(PricesContext_1.default),{sku}=(0,react_1.useContext)(SkuChildrenContext_1.default),[skuPrices,setSkuPrices]=(0,react_1.useState)([]),sCode=pricesSkuCode||skuCode||sku?.code||"";(0,react_1.useEffect)(()=>(prices!=null&&`${sCode}`in prices?setSkuPrices(prices[sCode]):sCode&&!skuCodes.includes(sCode)&&(skuCodes.push(sCode),setSkuCodes&&setSkuCodes({skuCodes})),()=>{setSkuPrices([])}),[prices,sCode]);const parentProps=Object.assign({loading,loader,prices:skuPrices},props),pricesComponent=prices==null||skuPrices==null?null:(0,getPrices_1.getPricesComponent)(skuPrices,props);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:loading||pricesComponent==null?loader:pricesComponent})}exports.default=Price;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'react';
|
|
2
|
-
import type { LoaderType } from '../../typings/index';
|
|
3
|
-
import type { QueryPageSize } from '@commercelayer/sdk';
|
|
4
|
-
interface Props {
|
|
5
|
-
/**
|
|
6
|
-
* Any valid JSX.Element(s).
|
|
7
|
-
* A single `<Price>` component or a list of them is expected to render the prices.
|
|
8
|
-
*/
|
|
9
|
-
children: JSX.Element | JSX.Element[];
|
|
10
|
-
/**
|
|
11
|
-
* SDK query filter to fetch the prices when multiple prices are requested.
|
|
12
|
-
*/
|
|
13
|
-
filters?: object;
|
|
14
|
-
/**
|
|
15
|
-
* Loader component or string to be rendered while the prices are being fetched.
|
|
16
|
-
* @default 'Loading...'
|
|
17
|
-
*/
|
|
18
|
-
loader?: LoaderType;
|
|
19
|
-
/**
|
|
20
|
-
* Prices per page to be fetched
|
|
21
|
-
*/
|
|
22
|
-
perPage?: QueryPageSize;
|
|
23
|
-
/**
|
|
24
|
-
* SKU code to fetch the prices for. If not provided, the `sku_code` will be retrieved from the `<Price>` component(s) nested as children.
|
|
25
|
-
*/
|
|
26
|
-
skuCode?: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Main container for the Prices components. It stores the prices context.
|
|
30
|
-
*
|
|
31
|
-
* It can be used to fetch the prices for a specific `sku_code` passed as prop
|
|
32
|
-
* or for the `sku_code` retrieved from all `<Price>` components nested as children.
|
|
33
|
-
* <span title='Requirements' type='warning'>
|
|
34
|
-
* Must be a child of the `<CommerceLayer>` component.
|
|
35
|
-
* </span>
|
|
36
|
-
* <span title='Children' type='info'>
|
|
37
|
-
* `<Price>`
|
|
38
|
-
* </span>
|
|
39
|
-
*/
|
|
40
|
-
export declare function PricesContainer(props: Props): JSX.Element;
|
|
41
|
-
export default PricesContainer;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PricesContainer=PricesContainer;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),PriceReducer_1=tslib_1.__importStar(require("../../reducers/PriceReducer")),PricesContext_1=tslib_1.__importDefault(require("../../context/PricesContext")),SkuContext_1=tslib_1.__importDefault(require("../../context/SkuContext"));function PricesContainer(props){const{children,skuCode="",loader="Loading...",perPage=10,filters={}}=props,[state,dispatch]=(0,react_1.useReducer)(PriceReducer_1.default,PriceReducer_1.priceInitialState),config=(0,react_1.useContext)(CommerceLayerContext_1.default),{skuCodes}=(0,react_1.useContext)(SkuContext_1.default);!state.skuCodes.includes(skuCode)&&skuCode&&state.skuCodes.push(skuCode);const sCode=skuCodes&&skuCodes?.length>0?"":skuCode??"";(0,react_1.useEffect)(()=>{state.skuCodes.length===0&&skuCodes!=null&&skuCodes.length>0&&state.setSkuCodes!=null&&state.setSkuCodes({skuCodes,dispatch}),config.accessToken&&(state.skuCodes.length>0||sCode)&&(0,PriceReducer_1.getSkusPrice)(sCode&&[sCode]||state.skuCodes,{config,dispatch,perPage,filters})},[config.accessToken,sCode,state.skuCodes.length]);const priceValue=Object.assign(Object.assign({},state),{skuCode:sCode,loader,setSkuCodes:params=>{(0,PriceReducer_1.setSkuCodes)(Object.assign(Object.assign({},params),{dispatch}))}});return(0,jsx_runtime_1.jsx)(PricesContext_1.default.Provider,{value:priceValue,children})}exports.default=PricesContainer;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type ReactNode, type JSX } from 'react';
|
|
2
|
-
import type { LoaderType } from '../../typings/index';
|
|
3
|
-
import type { Order } from '@commercelayer/sdk';
|
|
4
|
-
interface ShipmentProps {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
loader?: LoaderType;
|
|
7
|
-
autoSelectSingleShippingMethod?: boolean | ((order?: Order) => void);
|
|
8
|
-
}
|
|
9
|
-
export declare function Shipment({ children, loader, autoSelectSingleShippingMethod }: ShipmentProps): JSX.Element;
|
|
10
|
-
export default Shipment;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Shipment=Shipment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ShipmentContext_1=tslib_1.__importDefault(require("../../context/ShipmentContext")),ShipmentChildrenContext_1=tslib_1.__importDefault(require("../../context/ShipmentChildrenContext")),getLoaderComponent_1=tslib_1.__importDefault(require("../../utils/getLoaderComponent")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext"));function Shipment({children,loader="Loading...",autoSelectSingleShippingMethod=!1}){const[loading,setLoading]=(0,react_1.useState)(!0),{shipments,deliveryLeadTimes,setShippingMethod}=(0,react_1.useContext)(ShipmentContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default);(0,react_1.useEffect)(()=>(shipments!=null&&(autoSelectSingleShippingMethod?tslib_1.__awaiter(this,void 0,void 0,function*(){var _a;for(const shipment of shipments){const isSingle=((_a=shipment?.available_shipping_methods)===null||_a===void 0?void 0:_a.length)===1;if(!shipment?.shipping_method&&isSingle){const[shippingMethod]=shipment?.available_shipping_methods||[];if(shippingMethod&&setShippingMethod!=null){const{success,order:order2}=yield setShippingMethod(shipment.id,shippingMethod.id);typeof autoSelectSingleShippingMethod=="function"&&success&&autoSelectSingleShippingMethod(order2)}}else setTimeout(()=>{setLoading(!1)},200)}}):setLoading(!1)),()=>{setLoading(!0)}),[shipments!=null,shipments?.length,order?.gift_card_or_coupon_code]);const components=shipments?.map((shipment,k)=>{var _a,_b;const shipmentLineItems=shipment.stock_line_items,lineItems=shipmentLineItems?.map(shipmentLineItem=>{const l=shipmentLineItem.line_item;return l&&(l.quantity=shipmentLineItem.quantity),l}),shippingMethods=shipment.available_shipping_methods,currentShippingMethodId=autoSelectSingleShippingMethod&&shippingMethods&&shippingMethods.length===1?(_a=shippingMethods[0])===null||_a===void 0?void 0:_a.id:(_b=shipment.shipping_method)===null||_b===void 0?void 0:_b.id,stockTransfers=shipment.stock_transfers,parcels=shipment.parcels,times=deliveryLeadTimes?.filter(time=>{var _a2,_b2;return((_a2=time.stock_location)===null||_a2===void 0?void 0:_a2.id)===((_b2=shipment.stock_location)===null||_b2===void 0?void 0:_b2.id)}),shipmentProps={parcels,lineItems,shippingMethods,currentShippingMethodId,stockTransfers,deliveryLeadTimes:times,shipment,keyNumber:shipment?.id};return(0,jsx_runtime_1.jsx)(ShipmentChildrenContext_1.default.Provider,{value:shipmentProps,children},k)});return loading?(0,getLoaderComponent_1.default)(loader):(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:components})}exports.default=Shipment;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'react';
|
|
2
|
-
import type { Shipment } from '@commercelayer/sdk';
|
|
3
|
-
type ShipmentFieldChildrenProps = Omit<Props, 'children'> & {
|
|
4
|
-
shipment: Shipment;
|
|
5
|
-
};
|
|
6
|
-
export type ShipmentAttribute = 'number' | 'currency_code' | 'status' | 'cost_amount_cents' | 'cost_amount_float' | 'formatted_cost_amount' | 'key_number';
|
|
7
|
-
interface Props extends Omit<JSX.IntrinsicElements['span'], 'children' | 'ref'> {
|
|
8
|
-
children?: (props: ShipmentFieldChildrenProps) => JSX.Element;
|
|
9
|
-
name: ShipmentAttribute;
|
|
10
|
-
}
|
|
11
|
-
export declare function ShipmentField(props: Props): JSX.Element;
|
|
12
|
-
export default ShipmentField;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShipmentField=ShipmentField;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),get_1=tslib_1.__importDefault(require("lodash/get")),ShipmentChildrenContext_1=tslib_1.__importDefault(require("../../context/ShipmentChildrenContext"));function ShipmentField(props){const{name}=props,{shipment,keyNumber}=(0,react_1.useContext)(ShipmentChildrenContext_1.default),key=name,text=key!=="key_number"?(0,get_1.default)(shipment,key):keyNumber,parentProps=Object.assign({shipment},props);return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},props,{children:text}))}exports.default=ShipmentField;
|