@commercelayer/react-components 4.28.6 → 4.28.8-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import type { DefaultChildrenType } from '../../typings/globals';
2
- import { type JSX } from 'react';
1
+ import { type JSX } from "react";
2
+ import type { DefaultChildrenType } from "../../typings/globals";
3
3
  interface Props {
4
4
  children?: DefaultChildrenType;
5
5
  /**
@@ -7,5 +7,5 @@ interface Props {
7
7
  */
8
8
  loader?: string | JSX.Element;
9
9
  }
10
- export declare function CustomerPaymentSource({ children, loader }: Props): JSX.Element;
10
+ export declare function CustomerPaymentSource({ children, loader, }: Props): JSX.Element;
11
11
  export default CustomerPaymentSource;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomerPaymentSource=CustomerPaymentSource;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),CustomerPaymentSourceContext_1=tslib_1.__importDefault(require("../../context/CustomerPaymentSourceContext")),getCardDetails_1=tslib_1.__importDefault(require("../../utils/getCardDetails")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext")),react_1=require("react");function CustomerPaymentSource({children,loader="Loading..."}){const[loading,setLoading]=(0,react_1.useState)(!0),{payments}=(0,useCustomContext_1.default)({context:CustomerContext_1.default,contextComponentName:"CustomerContainer",currentComponentName:"CustomerPaymentSource",key:"payments"});(0,react_1.useEffect)(()=>(payments!=null&&setLoading(!1),()=>{setLoading(!0)}),[payments!=null]);const provider=payments?.filter(p=>p?.payment_source!=null).map(p=>{const paymentType=p.payment_source?.type,customerPayment=p,value={...(0,getCardDetails_1.default)({paymentType,customerPayment})};return(0,jsx_runtime_1.jsx)(CustomerPaymentSourceContext_1.default.Provider,{value,children},p.id)});return loading?(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:loader}):(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:provider})}exports.default=CustomerPaymentSource;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomerPaymentSource=CustomerPaymentSource;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),CustomerPaymentSourceContext_1=tslib_1.__importDefault(require("../../context/CustomerPaymentSourceContext")),useCommerceLayer_1=tslib_1.__importDefault(require("../../hooks/useCommerceLayer")),getCardDetails_1=tslib_1.__importDefault(require("../../utils/getCardDetails")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext"));function CustomerPaymentSource({children,loader="Loading..."}){const{sdkClient}=(0,useCommerceLayer_1.default)(),[loading,setLoading]=(0,react_1.useState)(!0),{payments,getCustomerPaymentSources}=(0,useCustomContext_1.default)({context:CustomerContext_1.default,contextComponentName:"CustomerContainer",currentComponentName:"CustomerPaymentSource",key:"payments"});(0,react_1.useEffect)(()=>(payments!=null&&setLoading(!1),()=>{setLoading(!0)}),[payments]);const provider=payments?.filter(p=>p?.payment_source!=null).map(p=>{const paymentType=p.payment_source?.type,customerPayment=p,value={...(0,getCardDetails_1.default)({paymentType,customerPayment}),handleDeleteClick:e=>{e?.preventDefault(),e?.stopPropagation();const sdk=sdkClient();sdk?.customer_payment_sources.delete(p.id).then(()=>{getCustomerPaymentSources&&getCustomerPaymentSources()})}};return(0,jsx_runtime_1.jsx)(CustomerPaymentSourceContext_1.default.Provider,{value,children},p.id)});return loading?(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:loader}):(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:provider})}exports.default=CustomerPaymentSource;
@@ -1,2 +1,2 @@
1
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"),auto_1=require("@adyen/adyen-web/auto"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),PlaceOrderContext_1=tslib_1.__importDefault(require("../../context/PlaceOrderContext")),browserInfo_1=tslib_1.__importStar(require("../../utils/browserInfo")),getPublicIp_1=require("../../utils/getPublicIp"),hasSubscriptions_1=require("../../utils/hasSubscriptions"),localStorage_1=require("../../utils/localStorage"),defaultConfig={};function AdyenPayment({clientKey,config,templateCustomerSaveToWallet,environment="test",locale="en_US"}){const{cardContainerClassName,styles,onDisableStoredPaymentMethod,giftcardErrorComponent,onReady,onSelect,subscriptionPaymentMethods}={...defaultConfig,...config},[loadAdyen,setLoadAdyen]=(0,react_1.useState)(!1),[checkout,setCheckout]=(0,react_1.useState)(),[giftcardError,setGiftcardError]=(0,react_1.useState)(null),{setPaymentSource,paymentSource,setPaymentMethodErrors,currentPaymentMethodType,setPaymentRef,currentCustomerPaymentSourceId}=(0,react_1.useContext)(PaymentMethodContext_1.default),{order,updateOrder,getOrderByFields}=(0,react_1.useContext)(OrderContext_1.default),authConfig=(0,react_1.useContext)(CommerceLayerContext_1.default),{placeOrderButtonRef,setPlaceOrder,status}=(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=async e=>{const savePaymentSourceToCustomerWallet=e?.elements?.save_payment_source_to_customer_wallet?.checked;return savePaymentSourceToCustomerWallet&&(0,localStorage_1.setCustomerOrderParam)("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),dropinRef.current&&dropinRef.current.submit(),!1},handleChange=async state=>{state.isValid&&ref.current&&(ref.current.onsubmit=async()=>await handleSubmit(ref.current),setPaymentRef({ref}))},handleOnAdditionalDetails=async(state,component)=>{const attributes={payment_request_details:state.data,_details:1};try{const pSource=paymentSource&&await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:"adyen_payments",attributes}),resultCode=pSource?.payment_response?.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=pSource?.payment_response?.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=async(state,component)=>{const url=(0,browserInfo_1.cleanUrlBy)(),{type:currentPaymentMethodType2}=state.data.paymentMethod,shopperIp=await(0,getPublicIp_1.getPublicIP)(),control=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments"}),controlCode=control?.payment_response?.resultCode,paymentMethodType=control?.payment_response?.paymentMethod?.type??control?.payment_request_data?.payment_method?.type,paymentStatus=(await getOrderByFields({orderId:order?.id??"",fields:["status","payment_status"],config:authConfig}))?.payment_status;if(controlCode==="Authorised"&&paymentMethodType!=="giftcard"&&paymentStatus!=="partially_authorized")return{resultCode:controlCode};const attributes={payment_request_data:{...state.data,payment_method:state.data.paymentMethod,return_url:url,origin:window.location.origin,redirect_from_issuer_method:"GET",shopper_ip:shopperIp,shopperInteraction:"Ecommerce",browser_info:{...(0,browserInfo_1.default)()}}};delete attributes.payment_request_data.paymentMethod;try{if(await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes}),order?.id==null)return console.error("Order id is missing"),{resultCode:"Error"};if(currentPaymentMethodType2==="giftcard"){const currentBalance=(await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{_balance:!0}}))?.balance??0,totalAmount=order?.total_amount_with_taxes_cents??0,attributes2=currentBalance>=totalAmount?{_authorize:!0}:{_authorization_amount_cents:currentBalance,_authorize:!0},{order:orderUpdated}=await updateOrder({id:order.id,attributes:attributes2}),resultCode2=orderUpdated?.payment_source?.payment_response?.resultCode,refusalReasonCode=orderUpdated?.payment_source?.payment_response?.refusalReasonCode,errorCode=orderUpdated?.payment_source?.payment_response?.errorCode,action2=orderUpdated?.payment_source?.payment_response?.action,paymentStatus2=orderUpdated?.payment_status;if(["Cancelled","Refused"].includes(resultCode2)&&refusalReasonCode!=="12"||errorCode){const message=orderUpdated?.payment_response?.refusalReason??orderUpdated?.payment_response?.message;return{resultCode:errorCode?"Refused":resultCode2,message}}return{resultCode:"Authorised",paymentMethodType:currentPaymentMethodType2,action:action2,paymentStatus:paymentStatus2}}const res=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{_authorize:1}}),action=res?.payment_response?.action,resultCode=res?.payment_response?.resultCode;if(action!=null)return{resultCode,action};const issuerType=res?.payment_instrument?.issuer_type;if(["Authorised","Pending","Received"].includes(resultCode))return["apple pay","google pay"].includes(issuerType)&&setPlaceOrder!=null?(await 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=res?.payment_response?.refusalReason;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType2,message}]),component&&component.mount("#adyen-dropin")}if(res?.payment_response?.errorType)if(res?.payment_response?.errorCode==="14_006")onSubmit(state,component);else{const message=res?.payment_response?.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)(()=>{const paymentMethodsResponse={paymentMethods:paymentSource?.payment_methods?.paymentMethods?paymentSource?.payment_methods.paymentMethods:[],storedPaymentMethods:paymentSource?.payment_methods?.storedPaymentMethods?paymentSource?.payment_methods.storedPaymentMethods:[]};paymentMethodsResponse.paymentMethods.length===0&&console.error("Payment methods are not available. Please, check your Adyen configuration.");let showStoredPaymentMethods=paymentSource?.payment_methods?.storedPaymentMethods!=null;order&&(0,hasSubscriptions_1.hasSubscriptions)(order)&&(showStoredPaymentMethods=!1,paymentMethodsResponse.storedPaymentMethods=[],paymentMethodsResponse.paymentMethods=subscriptionPaymentMethods!=null&&subscriptionPaymentMethods.length>0?paymentMethodsResponse.paymentMethods.filter(pm=>subscriptionPaymentMethods.includes(pm.type)):paymentMethodsResponse.paymentMethods);const options={locale:order?.language_code??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)=>{(async()=>{const{resultCode}=await handleOnAdditionalDetails(state,element);["Cancelled","Refused"].includes(resultCode)?actions.reject():actions.resolve({resultCode})})()},onChange:state=>{handleChange(state)},onSubmit:(state,element,actions)=>{(async()=>{const{resultCode,action,message,paymentStatus}=await onSubmit(state,element);["Cancelled","Refused"].includes(resultCode)?(actions.reject(),message&&setGiftcardError(message)):action!=null?dropinRef.current?.handleAction(action):(actions.resolve({resultCode}),paymentStatus==="partially_authorized"&&dropinRef.current?.mount("#adyen-dropin"),setGiftcardError(null))})()}};if(!ref&&clientKey&&(0,localStorage_1.setCustomerOrderParam)("_save_payment_source_to_customer_wallet","false"),clientKey&&!loadAdyen&&window&&!checkout){const initializeAdyen=async()=>{const checkout2=await(0,auto_1.AdyenCheckout)(options),dropin=new auto_1.Dropin(checkout2,{disableFinalAnimation:!0,showRemovePaymentMethodButton:showStoredPaymentMethods,instantPaymentTypes:["applepay","googlepay"],paymentMethodsConfiguration:{showStoredPaymentMethods,paypal:{showPayButton:!0,style:styles?.paypal,...config?.paymentMethodsConfiguration?.paypal},card:{enableStoreDetails:showStoredPaymentMethods,styles:styles?.card,holderNameRequired:!1,...config?.paymentMethodsConfiguration?.card},giftcard:{showPayButton:!0,...config?.paymentMethodsConfiguration?.giftcard},...config?.paymentMethodsConfiguration},onDisableStoredPaymentMethod:state=>{const recurringDetailReference=state,shopperReference=customers?.shopper_reference??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=async()=>await handleSubmit(ref.current):ref.current.onsubmit=null,setPaymentRef({ref})),onSelect&&onSelect(component)},onReady(){onReady&&onReady()}}).mount("#adyen-dropin");dropin&&checkout2&&(dropinRef.current=dropin,setCheckout(dropin),setLoadAdyen(!0))},html=document.getElementById("adyen-dropin");!dropinRef.current&&status==="standby"&&html&&initializeAdyen()}return()=>{setPaymentRef({ref:{current:null}}),setLoadAdyen(!1)}},[clientKey,ref!=null,status]),!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"}),giftcardError!=null&&giftcardErrorComponent?giftcardErrorComponent(giftcardError):null,templateCustomerSaveToWallet&&(0,jsx_runtime_1.jsx)(Parent_1.default,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})]})}exports.default=AdyenPayment;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AdyenPayment=AdyenPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),auto_1=require("@adyen/adyen-web/auto"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),PlaceOrderContext_1=tslib_1.__importDefault(require("../../context/PlaceOrderContext")),browserInfo_1=tslib_1.__importStar(require("../../utils/browserInfo")),getPublicIp_1=require("../../utils/getPublicIp"),hasSubscriptions_1=require("../../utils/hasSubscriptions"),localStorage_1=require("../../utils/localStorage"),defaultConfig={};function AdyenPayment({clientKey,config,templateCustomerSaveToWallet,environment="test",locale="en_US"}){const{cardContainerClassName,styles,onDisableStoredPaymentMethod,giftcardErrorComponent,onReady,onSelect,subscriptionPaymentMethods}={...defaultConfig,...config},[loadAdyen,setLoadAdyen]=(0,react_1.useState)(!1),[checkout,setCheckout]=(0,react_1.useState)(),[giftcardError,setGiftcardError]=(0,react_1.useState)(null),{setPaymentSource,paymentSource,setPaymentMethodErrors,currentPaymentMethodType,setPaymentRef,currentCustomerPaymentSourceId}=(0,react_1.useContext)(PaymentMethodContext_1.default),{order,updateOrder,getOrderByFields}=(0,react_1.useContext)(OrderContext_1.default),authConfig=(0,react_1.useContext)(CommerceLayerContext_1.default),{placeOrderButtonRef,setPlaceOrder,status}=(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=async e=>{const savePaymentSourceToCustomerWallet=e?.elements?.save_payment_source_to_customer_wallet?.checked;return savePaymentSourceToCustomerWallet&&(0,localStorage_1.setCustomerOrderParam)("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),dropinRef.current&&dropinRef.current.submit(),!1},handleChange=async state=>{state.isValid&&ref.current&&(ref.current.onsubmit=async()=>await handleSubmit(ref.current),setPaymentRef({ref}))},handleOnAdditionalDetails=async(state,component)=>{const attributes={payment_request_details:state.data,_details:1};try{const pSource=paymentSource&&await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:"adyen_payments",attributes}),resultCode=pSource?.payment_response?.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=pSource?.payment_response?.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=async(state,component)=>{const url=(0,browserInfo_1.cleanUrlBy)(),{type:currentPaymentMethodType2}=state.data.paymentMethod,shopperIp=await(0,getPublicIp_1.getPublicIP)(),control=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments"}),controlCode=control?.payment_response?.resultCode,paymentMethodType=control?.payment_response?.paymentMethod?.type??control?.payment_request_data?.payment_method?.type,paymentStatus=(await getOrderByFields({orderId:order?.id??"",fields:["status","payment_status"],config:authConfig}))?.payment_status;if(controlCode==="Authorised"&&paymentMethodType!=="giftcard"&&paymentStatus!=="partially_authorized")return{resultCode:controlCode};const attributes={payment_request_data:{...state.data,payment_method:state.data.paymentMethod,return_url:url,origin:window.location.origin,redirect_from_issuer_method:"GET",shopper_ip:shopperIp,shopperInteraction:"Ecommerce",browser_info:{...(0,browserInfo_1.default)()}}};delete attributes.payment_request_data.paymentMethod;try{if(await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes}),order?.id==null)return console.error("Order id is missing"),{resultCode:"Error"};if(currentPaymentMethodType2==="giftcard"){const currentBalance=(await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{_balance:!0}}))?.balance??0,totalAmount=order?.total_amount_with_taxes_cents??0;if(currentBalance===0){const message="The gift card has no balance. Please use a different one.";return setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType2,message}]),{resultCode:"Refused",message}}const attributes2=currentBalance>=totalAmount?{_authorize:!0}:{_authorization_amount_cents:currentBalance,_authorize:!0},{order:orderUpdated}=await updateOrder({id:order.id,attributes:attributes2}),resultCode2=orderUpdated?.payment_source?.payment_response?.resultCode,refusalReasonCode=orderUpdated?.payment_source?.payment_response?.refusalReasonCode,errorCode=orderUpdated?.payment_source?.payment_response?.errorCode,action2=orderUpdated?.payment_source?.payment_response?.action,paymentStatus2=orderUpdated?.payment_status;if(["Cancelled","Refused"].includes(resultCode2)&&refusalReasonCode!=="12"||errorCode){const message=orderUpdated?.payment_response?.refusalReason??orderUpdated?.payment_response?.message;return{resultCode:errorCode?"Refused":resultCode2,message}}return{resultCode:"Authorised",paymentMethodType:currentPaymentMethodType2,action:action2,paymentStatus:paymentStatus2}}const res=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{_authorize:1}}),action=res?.payment_response?.action,resultCode=res?.payment_response?.resultCode;if(action!=null)return{resultCode,action};const issuerType=res?.payment_instrument?.issuer_type;if(["Authorised","Pending","Received"].includes(resultCode))return["apple pay","google pay"].includes(issuerType)&&setPlaceOrder!=null?(await 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=res?.payment_response?.refusalReason;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType2,message}]),component&&component.mount("#adyen-dropin")}if(res?.payment_response?.errorType)if(res?.payment_response?.errorCode==="14_006")onSubmit(state,component);else{const message=res?.payment_response?.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)(()=>{const paymentMethodsResponse={paymentMethods:paymentSource?.payment_methods?.paymentMethods?paymentSource?.payment_methods.paymentMethods:[],storedPaymentMethods:paymentSource?.payment_methods?.storedPaymentMethods?paymentSource?.payment_methods.storedPaymentMethods:[]};paymentMethodsResponse.paymentMethods.length===0&&console.error("Payment methods are not available. Please, check your Adyen configuration.");let showStoredPaymentMethods=paymentSource?.payment_methods?.storedPaymentMethods!=null;order&&(0,hasSubscriptions_1.hasSubscriptions)(order)&&(showStoredPaymentMethods=!1,paymentMethodsResponse.storedPaymentMethods=[],paymentMethodsResponse.paymentMethods=subscriptionPaymentMethods!=null&&subscriptionPaymentMethods.length>0?paymentMethodsResponse.paymentMethods.filter(pm=>subscriptionPaymentMethods.includes(pm.type)):paymentMethodsResponse.paymentMethods);const options={locale:order?.language_code??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)=>{(async()=>{const{resultCode}=await handleOnAdditionalDetails(state,element);["Cancelled","Refused"].includes(resultCode)?actions.reject():actions.resolve({resultCode})})()},onChange:state=>{handleChange(state)},onSubmit:(state,element,actions)=>{(async()=>{const{resultCode,action,message,paymentStatus}=await onSubmit(state,element);["Cancelled","Refused"].includes(resultCode)?(actions.reject(),message&&setGiftcardError(message)):action!=null?dropinRef.current?.handleAction(action):(actions.resolve({resultCode}),paymentStatus==="partially_authorized"&&dropinRef.current?.mount("#adyen-dropin"),setGiftcardError(null))})()}};if(!ref&&clientKey&&(0,localStorage_1.setCustomerOrderParam)("_save_payment_source_to_customer_wallet","false"),clientKey&&!loadAdyen&&window&&!checkout){const initializeAdyen=async()=>{const checkout2=await(0,auto_1.AdyenCheckout)(options),dropin=new auto_1.Dropin(checkout2,{disableFinalAnimation:!0,showRemovePaymentMethodButton:showStoredPaymentMethods,instantPaymentTypes:["applepay","googlepay"],paymentMethodsConfiguration:{showStoredPaymentMethods,paypal:{showPayButton:!0,style:styles?.paypal,...config?.paymentMethodsConfiguration?.paypal},card:{enableStoreDetails:showStoredPaymentMethods,styles:styles?.card,holderNameRequired:!1,...config?.paymentMethodsConfiguration?.card},giftcard:{showPayButton:!0,...config?.paymentMethodsConfiguration?.giftcard},...config?.paymentMethodsConfiguration},onDisableStoredPaymentMethod:state=>{const recurringDetailReference=state,shopperReference=customers?.shopper_reference??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=async()=>await handleSubmit(ref.current):ref.current.onsubmit=null,setPaymentRef({ref})),onSelect&&onSelect(component)},onReady(){onReady&&onReady()}}).mount("#adyen-dropin");dropin&&checkout2&&(dropinRef.current=dropin,setCheckout(dropin),setLoadAdyen(!0))},html=document.getElementById("adyen-dropin");!dropinRef.current&&status==="standby"&&html&&initializeAdyen()}return()=>{setPaymentRef({ref:{current:null}}),setLoadAdyen(!1)}},[clientKey,ref!=null,status]),!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"}),giftcardError!=null&&giftcardErrorComponent?giftcardErrorComponent(giftcardError):null,templateCustomerSaveToWallet&&(0,jsx_runtime_1.jsx)(Parent_1.default,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})]})}exports.default=AdyenPayment;
@@ -0,0 +1,10 @@
1
+ import { type JSX, type ReactNode } 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 PaymentSourceDeleteButton({ children, label, ...props }: Props): JSX.Element | null;
10
+ export default PaymentSourceDeleteButton;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSourceDeleteButton=PaymentSourceDeleteButton;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CustomerPaymentSourceContext_1=tslib_1.__importDefault(require("../../context/CustomerPaymentSourceContext"));function PaymentSourceDeleteButton({children,label="Delete",...props}){const{handleDeleteClick}=(0,react_1.useContext)(CustomerPaymentSourceContext_1.default),parentProps={label,handleDeleteClick,...props};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):handleDeleteClick!=null?(0,jsx_runtime_1.jsx)("button",{...props,onClick:handleDeleteClick,children:label}):null}exports.default=PaymentSourceDeleteButton;
@@ -5,6 +5,7 @@ interface DefaultContext {
5
5
  exp_year?: number | string;
6
6
  last4?: string;
7
7
  issuer_type?: string;
8
+ handleDeleteClick?: (e: MouseEvent) => void;
8
9
  }
9
10
  export declare const defaultCustomerPaymentSourceContext: {};
10
11
  declare const CustomerPaymentSourceContext: import("react").Context<DefaultContext>;
@@ -81,6 +81,7 @@ export * from './components/payment_source/PaymentSourceBrandIcon';
81
81
  export * from './components/payment_source/PaymentSourceBrandName';
82
82
  export * from './components/payment_source/PaymentSourceDetail';
83
83
  export * from './components/payment_source/PaymentSourceEditButton';
84
+ export * from './components/payment_source/PaymentSourceDeleteButton';
84
85
  export * from './components/prices/Price';
85
86
  export * from './components/prices/PricesContainer';
86
87
  export * from './components/shipments/Shipment';
package/lib/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib");tslib_1.__exportStar(require("./components/ExternalFunction"),exports),tslib_1.__exportStar(require("./components/MetadataInput"),exports),tslib_1.__exportStar(require("./components/SubmitButton"),exports),tslib_1.__exportStar(require("./components/addresses/Address"),exports),tslib_1.__exportStar(require("./components/addresses/AddressCountrySelector"),exports),tslib_1.__exportStar(require("./components/addresses/AddressField"),exports),tslib_1.__exportStar(require("./components/addresses/AddressInput"),exports),tslib_1.__exportStar(require("./components/addresses/AddressInputSelect"),exports),tslib_1.__exportStar(require("./components/addresses/AddressStateSelector"),exports),tslib_1.__exportStar(require("./components/addresses/AddressesContainer"),exports),tslib_1.__exportStar(require("./components/addresses/AddressesEmpty"),exports),tslib_1.__exportStar(require("./components/addresses/BillingAddressContainer"),exports),tslib_1.__exportStar(require("./components/addresses/BillingAddressForm"),exports),tslib_1.__exportStar(require("./components/addresses/SaveAddressesButton"),exports),tslib_1.__exportStar(require("./components/addresses/ShippingAddressContainer"),exports),tslib_1.__exportStar(require("./components/addresses/ShippingAddressForm"),exports),tslib_1.__exportStar(require("./components/auth/CommerceLayer"),exports),tslib_1.__exportStar(require("./components/customers/CustomerAddressForm"),exports),tslib_1.__exportStar(require("./components/customers/CustomerContainer"),exports),tslib_1.__exportStar(require("./components/customers/CustomerField"),exports),tslib_1.__exportStar(require("./components/customers/CustomerInput"),exports),tslib_1.__exportStar(require("./components/customers/SaveCustomerButton"),exports),tslib_1.__exportStar(require("./components/errors/Errors"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCard"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardContainer"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardCurrencySelector"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardInput"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardOrCouponCode"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardOrCouponForm"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardOrCouponInput"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardOrCouponRemoveButton"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardOrCouponSubmit"),exports),tslib_1.__exportStar(require("./components/in_stock_subscriptions/InStockSubscriptionButton"),exports),tslib_1.__exportStar(require("./components/in_stock_subscriptions/InStockSubscriptionsContainer"),exports),tslib_1.__exportStar(require("./components/line_items/LineItem"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemAmount"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemCode"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemField"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemImage"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemName"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemOption"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemOptions"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemQuantity"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemRemoveLink"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemsContainer"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemsCount"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemsEmpty"),exports),tslib_1.__exportStar(require("./components/orders/AddToCartButton"),exports),tslib_1.__exportStar(require("./components/orders/AdjustmentAmount"),exports),tslib_1.__exportStar(require("./components/orders/CartLink"),exports),tslib_1.__exportStar(require("./components/orders/CheckoutLink"),exports),tslib_1.__exportStar(require("./components/orders/DiscountAmount"),exports),tslib_1.__exportStar(require("./components/orders/GiftCardAmount"),exports),tslib_1.__exportStar(require("./components/orders/OrderContainer"),exports),tslib_1.__exportStar(require("./components/orders/OrderList"),exports),tslib_1.__exportStar(require("./components/orders/OrderListEmpty"),exports),tslib_1.__exportStar(require("./components/orders/OrderListRow"),exports),tslib_1.__exportStar(require("./components/orders/OrderNumber"),exports),tslib_1.__exportStar(require("./components/orders/OrderStorage"),exports),tslib_1.__exportStar(require("./components/orders/PaymentMethodAmount"),exports),tslib_1.__exportStar(require("./components/orders/PlaceOrderButton"),exports),tslib_1.__exportStar(require("./components/orders/PlaceOrderContainer"),exports),tslib_1.__exportStar(require("./components/orders/PrivacyAndTermsCheckbox"),exports),tslib_1.__exportStar(require("./components/orders/ShippingAmount"),exports),tslib_1.__exportStar(require("./components/orders/SubTotalAmount"),exports),tslib_1.__exportStar(require("./components/orders/TaxesAmount"),exports),tslib_1.__exportStar(require("./components/orders/TotalAmount"),exports),tslib_1.__exportStar(require("./components/parcels/ParcelField"),exports),tslib_1.__exportStar(require("./components/parcels/ParcelLineItem"),exports),tslib_1.__exportStar(require("./components/parcels/ParcelLineItemField"),exports),tslib_1.__exportStar(require("./components/parcels/ParcelLineItemsCount"),exports),tslib_1.__exportStar(require("./components/parcels/Parcels"),exports),tslib_1.__exportStar(require("./components/parcels/ParcelsCount"),exports),tslib_1.__exportStar(require("./components/payment_methods/PaymentMethod"),exports),tslib_1.__exportStar(require("./components/payment_methods/PaymentMethodName"),exports),tslib_1.__exportStar(require("./components/payment_methods/PaymentMethodPrice"),exports),tslib_1.__exportStar(require("./components/payment_methods/PaymentMethodRadioButton"),exports),tslib_1.__exportStar(require("./components/payment_methods/PaymentMethodsContainer"),exports),tslib_1.__exportStar(require("./components/payment_source/PaymentSource"),exports),tslib_1.__exportStar(require("./components/payment_source/PaymentSourceBrandIcon"),exports),tslib_1.__exportStar(require("./components/payment_source/PaymentSourceBrandName"),exports),tslib_1.__exportStar(require("./components/payment_source/PaymentSourceDetail"),exports),tslib_1.__exportStar(require("./components/payment_source/PaymentSourceEditButton"),exports),tslib_1.__exportStar(require("./components/prices/Price"),exports),tslib_1.__exportStar(require("./components/prices/PricesContainer"),exports),tslib_1.__exportStar(require("./components/shipments/Shipment"),exports),tslib_1.__exportStar(require("./components/shipments/ShipmentField"),exports),tslib_1.__exportStar(require("./components/shipments/ShipmentsContainer"),exports),tslib_1.__exportStar(require("./components/shipments/ShipmentsCount"),exports),tslib_1.__exportStar(require("./components/shipping_methods/ShippingMethod"),exports),tslib_1.__exportStar(require("./components/shipping_methods/ShippingMethodName"),exports),tslib_1.__exportStar(require("./components/shipping_methods/ShippingMethodPrice"),exports),tslib_1.__exportStar(require("./components/shipping_methods/ShippingMethodRadioButton"),exports),tslib_1.__exportStar(require("./components/skus/AvailabilityContainer"),exports),tslib_1.__exportStar(require("./components/skus/AvailabilityTemplate"),exports),tslib_1.__exportStar(require("./components/skus/DeliveryLeadTime"),exports),tslib_1.__exportStar(require("./components/skus/SkuField"),exports),tslib_1.__exportStar(require("./components/skus/SkuList"),exports),tslib_1.__exportStar(require("./components/skus/SkuListsContainer"),exports),tslib_1.__exportStar(require("./components/skus/Skus"),exports),tslib_1.__exportStar(require("./components/skus/SkusContainer"),exports),tslib_1.__exportStar(require("./components/stock_transfers/StockTransfer"),exports),tslib_1.__exportStar(require("./components/stock_transfers/StockTransferField"),exports),tslib_1.__exportStar(require("./hooks/useOrderContainer"),exports),tslib_1.__exportStar(require("./hooks/useCommerceLayer"),exports),tslib_1.__exportStar(require("./hooks/useCustomerContainer"),exports),tslib_1.__exportStar(require("./typings/errors"),exports);
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib");tslib_1.__exportStar(require("./components/ExternalFunction"),exports),tslib_1.__exportStar(require("./components/MetadataInput"),exports),tslib_1.__exportStar(require("./components/SubmitButton"),exports),tslib_1.__exportStar(require("./components/addresses/Address"),exports),tslib_1.__exportStar(require("./components/addresses/AddressCountrySelector"),exports),tslib_1.__exportStar(require("./components/addresses/AddressField"),exports),tslib_1.__exportStar(require("./components/addresses/AddressInput"),exports),tslib_1.__exportStar(require("./components/addresses/AddressInputSelect"),exports),tslib_1.__exportStar(require("./components/addresses/AddressStateSelector"),exports),tslib_1.__exportStar(require("./components/addresses/AddressesContainer"),exports),tslib_1.__exportStar(require("./components/addresses/AddressesEmpty"),exports),tslib_1.__exportStar(require("./components/addresses/BillingAddressContainer"),exports),tslib_1.__exportStar(require("./components/addresses/BillingAddressForm"),exports),tslib_1.__exportStar(require("./components/addresses/SaveAddressesButton"),exports),tslib_1.__exportStar(require("./components/addresses/ShippingAddressContainer"),exports),tslib_1.__exportStar(require("./components/addresses/ShippingAddressForm"),exports),tslib_1.__exportStar(require("./components/auth/CommerceLayer"),exports),tslib_1.__exportStar(require("./components/customers/CustomerAddressForm"),exports),tslib_1.__exportStar(require("./components/customers/CustomerContainer"),exports),tslib_1.__exportStar(require("./components/customers/CustomerField"),exports),tslib_1.__exportStar(require("./components/customers/CustomerInput"),exports),tslib_1.__exportStar(require("./components/customers/SaveCustomerButton"),exports),tslib_1.__exportStar(require("./components/errors/Errors"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCard"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardContainer"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardCurrencySelector"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardInput"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardOrCouponCode"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardOrCouponForm"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardOrCouponInput"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardOrCouponRemoveButton"),exports),tslib_1.__exportStar(require("./components/gift_cards/GiftCardOrCouponSubmit"),exports),tslib_1.__exportStar(require("./components/in_stock_subscriptions/InStockSubscriptionButton"),exports),tslib_1.__exportStar(require("./components/in_stock_subscriptions/InStockSubscriptionsContainer"),exports),tslib_1.__exportStar(require("./components/line_items/LineItem"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemAmount"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemCode"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemField"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemImage"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemName"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemOption"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemOptions"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemQuantity"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemRemoveLink"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemsContainer"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemsCount"),exports),tslib_1.__exportStar(require("./components/line_items/LineItemsEmpty"),exports),tslib_1.__exportStar(require("./components/orders/AddToCartButton"),exports),tslib_1.__exportStar(require("./components/orders/AdjustmentAmount"),exports),tslib_1.__exportStar(require("./components/orders/CartLink"),exports),tslib_1.__exportStar(require("./components/orders/CheckoutLink"),exports),tslib_1.__exportStar(require("./components/orders/DiscountAmount"),exports),tslib_1.__exportStar(require("./components/orders/GiftCardAmount"),exports),tslib_1.__exportStar(require("./components/orders/OrderContainer"),exports),tslib_1.__exportStar(require("./components/orders/OrderList"),exports),tslib_1.__exportStar(require("./components/orders/OrderListEmpty"),exports),tslib_1.__exportStar(require("./components/orders/OrderListRow"),exports),tslib_1.__exportStar(require("./components/orders/OrderNumber"),exports),tslib_1.__exportStar(require("./components/orders/OrderStorage"),exports),tslib_1.__exportStar(require("./components/orders/PaymentMethodAmount"),exports),tslib_1.__exportStar(require("./components/orders/PlaceOrderButton"),exports),tslib_1.__exportStar(require("./components/orders/PlaceOrderContainer"),exports),tslib_1.__exportStar(require("./components/orders/PrivacyAndTermsCheckbox"),exports),tslib_1.__exportStar(require("./components/orders/ShippingAmount"),exports),tslib_1.__exportStar(require("./components/orders/SubTotalAmount"),exports),tslib_1.__exportStar(require("./components/orders/TaxesAmount"),exports),tslib_1.__exportStar(require("./components/orders/TotalAmount"),exports),tslib_1.__exportStar(require("./components/parcels/ParcelField"),exports),tslib_1.__exportStar(require("./components/parcels/ParcelLineItem"),exports),tslib_1.__exportStar(require("./components/parcels/ParcelLineItemField"),exports),tslib_1.__exportStar(require("./components/parcels/ParcelLineItemsCount"),exports),tslib_1.__exportStar(require("./components/parcels/Parcels"),exports),tslib_1.__exportStar(require("./components/parcels/ParcelsCount"),exports),tslib_1.__exportStar(require("./components/payment_methods/PaymentMethod"),exports),tslib_1.__exportStar(require("./components/payment_methods/PaymentMethodName"),exports),tslib_1.__exportStar(require("./components/payment_methods/PaymentMethodPrice"),exports),tslib_1.__exportStar(require("./components/payment_methods/PaymentMethodRadioButton"),exports),tslib_1.__exportStar(require("./components/payment_methods/PaymentMethodsContainer"),exports),tslib_1.__exportStar(require("./components/payment_source/PaymentSource"),exports),tslib_1.__exportStar(require("./components/payment_source/PaymentSourceBrandIcon"),exports),tslib_1.__exportStar(require("./components/payment_source/PaymentSourceBrandName"),exports),tslib_1.__exportStar(require("./components/payment_source/PaymentSourceDetail"),exports),tslib_1.__exportStar(require("./components/payment_source/PaymentSourceEditButton"),exports),tslib_1.__exportStar(require("./components/payment_source/PaymentSourceDeleteButton"),exports),tslib_1.__exportStar(require("./components/prices/Price"),exports),tslib_1.__exportStar(require("./components/prices/PricesContainer"),exports),tslib_1.__exportStar(require("./components/shipments/Shipment"),exports),tslib_1.__exportStar(require("./components/shipments/ShipmentField"),exports),tslib_1.__exportStar(require("./components/shipments/ShipmentsContainer"),exports),tslib_1.__exportStar(require("./components/shipments/ShipmentsCount"),exports),tslib_1.__exportStar(require("./components/shipping_methods/ShippingMethod"),exports),tslib_1.__exportStar(require("./components/shipping_methods/ShippingMethodName"),exports),tslib_1.__exportStar(require("./components/shipping_methods/ShippingMethodPrice"),exports),tslib_1.__exportStar(require("./components/shipping_methods/ShippingMethodRadioButton"),exports),tslib_1.__exportStar(require("./components/skus/AvailabilityContainer"),exports),tslib_1.__exportStar(require("./components/skus/AvailabilityTemplate"),exports),tslib_1.__exportStar(require("./components/skus/DeliveryLeadTime"),exports),tslib_1.__exportStar(require("./components/skus/SkuField"),exports),tslib_1.__exportStar(require("./components/skus/SkuList"),exports),tslib_1.__exportStar(require("./components/skus/SkuListsContainer"),exports),tslib_1.__exportStar(require("./components/skus/Skus"),exports),tslib_1.__exportStar(require("./components/skus/SkusContainer"),exports),tslib_1.__exportStar(require("./components/stock_transfers/StockTransfer"),exports),tslib_1.__exportStar(require("./components/stock_transfers/StockTransferField"),exports),tslib_1.__exportStar(require("./hooks/useOrderContainer"),exports),tslib_1.__exportStar(require("./hooks/useCommerceLayer"),exports),tslib_1.__exportStar(require("./hooks/useCustomerContainer"),exports),tslib_1.__exportStar(require("./typings/errors"),exports);
@@ -1,5 +1,5 @@
1
- import type { DefaultChildrenType } from '../../typings/globals';
2
- import { type JSX } from 'react';
1
+ import { type JSX } from "react";
2
+ import type { DefaultChildrenType } from "../../typings/globals";
3
3
  interface Props {
4
4
  children?: DefaultChildrenType;
5
5
  /**
@@ -7,5 +7,5 @@ interface Props {
7
7
  */
8
8
  loader?: string | JSX.Element;
9
9
  }
10
- export declare function CustomerPaymentSource({ children, loader }: Props): JSX.Element;
10
+ export declare function CustomerPaymentSource({ children, loader, }: Props): JSX.Element;
11
11
  export default CustomerPaymentSource;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import CustomerContext from"../../context/CustomerContext";import CustomerPaymentSourceContext from"../../context/CustomerPaymentSourceContext";import getCardDetails from"../../utils/getCardDetails";import useCustomContext from"../../utils/hooks/useCustomContext";import{useEffect,useState}from"react";export function CustomerPaymentSource({children,loader="Loading..."}){const[loading,setLoading]=useState(!0),{payments}=useCustomContext({context:CustomerContext,contextComponentName:"CustomerContainer",currentComponentName:"CustomerPaymentSource",key:"payments"});useEffect(()=>(payments!=null&&setLoading(!1),()=>{setLoading(!0)}),[payments!=null]);const provider=payments?.filter(p=>p?.payment_source!=null).map(p=>{const paymentType=p.payment_source?.type,value={...getCardDetails({paymentType,customerPayment:p})};return _jsx(CustomerPaymentSourceContext.Provider,{value,children},p.id)});return loading?_jsx(_Fragment,{children:loader}):_jsx(_Fragment,{children:provider})}export default CustomerPaymentSource;
2
+ import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import{useEffect,useState}from"react";import CustomerContext from"../../context/CustomerContext";import CustomerPaymentSourceContext from"../../context/CustomerPaymentSourceContext";import useCommerceLayer from"../../hooks/useCommerceLayer";import getCardDetails from"../../utils/getCardDetails";import useCustomContext from"../../utils/hooks/useCustomContext";export function CustomerPaymentSource({children,loader="Loading..."}){const{sdkClient}=useCommerceLayer(),[loading,setLoading]=useState(!0),{payments,getCustomerPaymentSources}=useCustomContext({context:CustomerContext,contextComponentName:"CustomerContainer",currentComponentName:"CustomerPaymentSource",key:"payments"});useEffect(()=>(payments!=null&&setLoading(!1),()=>{setLoading(!0)}),[payments]);const provider=payments?.filter(p=>p?.payment_source!=null).map(p=>{const paymentType=p.payment_source?.type,value={...getCardDetails({paymentType,customerPayment:p}),handleDeleteClick:e=>{e?.preventDefault(),e?.stopPropagation();const sdk=sdkClient();sdk?.customer_payment_sources.delete(p.id).then(()=>{getCustomerPaymentSources&&getCustomerPaymentSources()})}};return _jsx(CustomerPaymentSourceContext.Provider,{value,children},p.id)});return loading?_jsx(_Fragment,{children:loader}):_jsx(_Fragment,{children:provider})}export default CustomerPaymentSource;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{AdyenCheckout,Dropin}from"@adyen/adyen-web/auto";import{useContext,useEffect,useRef,useState}from"react";import Parent from"../utils/Parent";import CommerceLayerContext from"../../context/CommerceLayerContext";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PlaceOrderContext from"../../context/PlaceOrderContext";import browserInfo,{cleanUrlBy}from"../../utils/browserInfo";import{getPublicIP}from"../../utils/getPublicIp";import{hasSubscriptions}from"../../utils/hasSubscriptions";import{setCustomerOrderParam}from"../../utils/localStorage";const defaultConfig={};export function AdyenPayment({clientKey,config,templateCustomerSaveToWallet,environment="test",locale="en_US"}){const{cardContainerClassName,styles,onDisableStoredPaymentMethod,giftcardErrorComponent,onReady,onSelect,subscriptionPaymentMethods}={...defaultConfig,...config},[loadAdyen,setLoadAdyen]=useState(!1),[checkout,setCheckout]=useState(),[giftcardError,setGiftcardError]=useState(null),{setPaymentSource,paymentSource,setPaymentMethodErrors,currentPaymentMethodType,setPaymentRef,currentCustomerPaymentSourceId}=useContext(PaymentMethodContext),{order,updateOrder,getOrderByFields}=useContext(OrderContext),authConfig=useContext(CommerceLayerContext),{placeOrderButtonRef,setPlaceOrder,status}=useContext(PlaceOrderContext),{customers}=useContext(CustomerContext),ref=useRef(null),dropinRef=useRef(null),handleSubmit=async e=>{const savePaymentSourceToCustomerWallet=e?.elements?.save_payment_source_to_customer_wallet?.checked;return savePaymentSourceToCustomerWallet&&setCustomerOrderParam("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),dropinRef.current&&dropinRef.current.submit(),!1},handleChange=async state=>{state.isValid&&ref.current&&(ref.current.onsubmit=async()=>await handleSubmit(ref.current),setPaymentRef({ref}))},handleOnAdditionalDetails=async(state,component)=>{const attributes={payment_request_details:state.data,_details:1};try{const pSource=paymentSource&&await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:"adyen_payments",attributes}),resultCode=pSource?.payment_response?.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=pSource?.payment_response?.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=async(state,component)=>{const url=cleanUrlBy(),{type:currentPaymentMethodType2}=state.data.paymentMethod,shopperIp=await getPublicIP(),control=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments"}),controlCode=control?.payment_response?.resultCode,paymentMethodType=control?.payment_response?.paymentMethod?.type??control?.payment_request_data?.payment_method?.type,paymentStatus=(await getOrderByFields({orderId:order?.id??"",fields:["status","payment_status"],config:authConfig}))?.payment_status;if(controlCode==="Authorised"&&paymentMethodType!=="giftcard"&&paymentStatus!=="partially_authorized")return{resultCode:controlCode};const attributes={payment_request_data:{...state.data,payment_method:state.data.paymentMethod,return_url:url,origin:window.location.origin,redirect_from_issuer_method:"GET",shopper_ip:shopperIp,shopperInteraction:"Ecommerce",browser_info:{...browserInfo()}}};delete attributes.payment_request_data.paymentMethod;try{if(await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes}),order?.id==null)return console.error("Order id is missing"),{resultCode:"Error"};if(currentPaymentMethodType2==="giftcard"){const currentBalance=(await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{_balance:!0}}))?.balance??0,totalAmount=order?.total_amount_with_taxes_cents??0,attributes2=currentBalance>=totalAmount?{_authorize:!0}:{_authorization_amount_cents:currentBalance,_authorize:!0},{order:orderUpdated}=await updateOrder({id:order.id,attributes:attributes2}),resultCode2=orderUpdated?.payment_source?.payment_response?.resultCode,refusalReasonCode=orderUpdated?.payment_source?.payment_response?.refusalReasonCode,errorCode=orderUpdated?.payment_source?.payment_response?.errorCode,action2=orderUpdated?.payment_source?.payment_response?.action,paymentStatus2=orderUpdated?.payment_status;if(["Cancelled","Refused"].includes(resultCode2)&&refusalReasonCode!=="12"||errorCode){const message=orderUpdated?.payment_response?.refusalReason??orderUpdated?.payment_response?.message;return{resultCode:errorCode?"Refused":resultCode2,message}}return{resultCode:"Authorised",paymentMethodType:currentPaymentMethodType2,action:action2,paymentStatus:paymentStatus2}}const res=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{_authorize:1}}),action=res?.payment_response?.action,resultCode=res?.payment_response?.resultCode;if(action!=null)return{resultCode,action};const issuerType=res?.payment_instrument?.issuer_type;if(["Authorised","Pending","Received"].includes(resultCode))return["apple pay","google pay"].includes(issuerType)&&setPlaceOrder!=null?(await 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=res?.payment_response?.refusalReason;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType2,message}]),component&&component.mount("#adyen-dropin")}if(res?.payment_response?.errorType)if(res?.payment_response?.errorCode==="14_006")onSubmit(state,component);else{const message=res?.payment_response?.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 useEffect(()=>{const paymentMethodsResponse={paymentMethods:paymentSource?.payment_methods?.paymentMethods?paymentSource?.payment_methods.paymentMethods:[],storedPaymentMethods:paymentSource?.payment_methods?.storedPaymentMethods?paymentSource?.payment_methods.storedPaymentMethods:[]};paymentMethodsResponse.paymentMethods.length===0&&console.error("Payment methods are not available. Please, check your Adyen configuration.");let showStoredPaymentMethods=paymentSource?.payment_methods?.storedPaymentMethods!=null;order&&hasSubscriptions(order)&&(showStoredPaymentMethods=!1,paymentMethodsResponse.storedPaymentMethods=[],paymentMethodsResponse.paymentMethods=subscriptionPaymentMethods!=null&&subscriptionPaymentMethods.length>0?paymentMethodsResponse.paymentMethods.filter(pm=>subscriptionPaymentMethods.includes(pm.type)):paymentMethodsResponse.paymentMethods);const options={locale:order?.language_code??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)=>{(async()=>{const{resultCode}=await handleOnAdditionalDetails(state,element);["Cancelled","Refused"].includes(resultCode)?actions.reject():actions.resolve({resultCode})})()},onChange:state=>{handleChange(state)},onSubmit:(state,element,actions)=>{(async()=>{const{resultCode,action,message,paymentStatus}=await onSubmit(state,element);["Cancelled","Refused"].includes(resultCode)?(actions.reject(),message&&setGiftcardError(message)):action!=null?dropinRef.current?.handleAction(action):(actions.resolve({resultCode}),paymentStatus==="partially_authorized"&&dropinRef.current?.mount("#adyen-dropin"),setGiftcardError(null))})()}};if(!ref&&clientKey&&setCustomerOrderParam("_save_payment_source_to_customer_wallet","false"),clientKey&&!loadAdyen&&window&&!checkout){const initializeAdyen=async()=>{const checkout2=await AdyenCheckout(options),dropin=new Dropin(checkout2,{disableFinalAnimation:!0,showRemovePaymentMethodButton:showStoredPaymentMethods,instantPaymentTypes:["applepay","googlepay"],paymentMethodsConfiguration:{showStoredPaymentMethods,paypal:{showPayButton:!0,style:styles?.paypal,...config?.paymentMethodsConfiguration?.paypal},card:{enableStoreDetails:showStoredPaymentMethods,styles:styles?.card,holderNameRequired:!1,...config?.paymentMethodsConfiguration?.card},giftcard:{showPayButton:!0,...config?.paymentMethodsConfiguration?.giftcard},...config?.paymentMethodsConfiguration},onDisableStoredPaymentMethod:state=>{const recurringDetailReference=state,shopperReference=customers?.shopper_reference??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=async()=>await handleSubmit(ref.current):ref.current.onsubmit=null,setPaymentRef({ref})),onSelect&&onSelect(component)},onReady(){onReady&&onReady()}}).mount("#adyen-dropin");dropin&&checkout2&&(dropinRef.current=dropin,setCheckout(dropin),setLoadAdyen(!0))},html=document.getElementById("adyen-dropin");!dropinRef.current&&status==="standby"&&html&&initializeAdyen()}return()=>{setPaymentRef({ref:{current:null}}),setLoadAdyen(!1)}},[clientKey,ref!=null,status]),!clientKey&&!loadAdyen&&!checkout?null:_jsxs("form",{ref,onSubmit:e=>{handleSubmit(e)},children:[_jsx("div",{className:cardContainerClassName,id:"adyen-dropin"}),giftcardError!=null&&giftcardErrorComponent?giftcardErrorComponent(giftcardError):null,templateCustomerSaveToWallet&&_jsx(Parent,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})]})}export default AdyenPayment;
2
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{AdyenCheckout,Dropin}from"@adyen/adyen-web/auto";import{useContext,useEffect,useRef,useState}from"react";import Parent from"../utils/Parent";import CommerceLayerContext from"../../context/CommerceLayerContext";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PlaceOrderContext from"../../context/PlaceOrderContext";import browserInfo,{cleanUrlBy}from"../../utils/browserInfo";import{getPublicIP}from"../../utils/getPublicIp";import{hasSubscriptions}from"../../utils/hasSubscriptions";import{setCustomerOrderParam}from"../../utils/localStorage";const defaultConfig={};export function AdyenPayment({clientKey,config,templateCustomerSaveToWallet,environment="test",locale="en_US"}){const{cardContainerClassName,styles,onDisableStoredPaymentMethod,giftcardErrorComponent,onReady,onSelect,subscriptionPaymentMethods}={...defaultConfig,...config},[loadAdyen,setLoadAdyen]=useState(!1),[checkout,setCheckout]=useState(),[giftcardError,setGiftcardError]=useState(null),{setPaymentSource,paymentSource,setPaymentMethodErrors,currentPaymentMethodType,setPaymentRef,currentCustomerPaymentSourceId}=useContext(PaymentMethodContext),{order,updateOrder,getOrderByFields}=useContext(OrderContext),authConfig=useContext(CommerceLayerContext),{placeOrderButtonRef,setPlaceOrder,status}=useContext(PlaceOrderContext),{customers}=useContext(CustomerContext),ref=useRef(null),dropinRef=useRef(null),handleSubmit=async e=>{const savePaymentSourceToCustomerWallet=e?.elements?.save_payment_source_to_customer_wallet?.checked;return savePaymentSourceToCustomerWallet&&setCustomerOrderParam("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),dropinRef.current&&dropinRef.current.submit(),!1},handleChange=async state=>{state.isValid&&ref.current&&(ref.current.onsubmit=async()=>await handleSubmit(ref.current),setPaymentRef({ref}))},handleOnAdditionalDetails=async(state,component)=>{const attributes={payment_request_details:state.data,_details:1};try{const pSource=paymentSource&&await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:"adyen_payments",attributes}),resultCode=pSource?.payment_response?.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=pSource?.payment_response?.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=async(state,component)=>{const url=cleanUrlBy(),{type:currentPaymentMethodType2}=state.data.paymentMethod,shopperIp=await getPublicIP(),control=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments"}),controlCode=control?.payment_response?.resultCode,paymentMethodType=control?.payment_response?.paymentMethod?.type??control?.payment_request_data?.payment_method?.type,paymentStatus=(await getOrderByFields({orderId:order?.id??"",fields:["status","payment_status"],config:authConfig}))?.payment_status;if(controlCode==="Authorised"&&paymentMethodType!=="giftcard"&&paymentStatus!=="partially_authorized")return{resultCode:controlCode};const attributes={payment_request_data:{...state.data,payment_method:state.data.paymentMethod,return_url:url,origin:window.location.origin,redirect_from_issuer_method:"GET",shopper_ip:shopperIp,shopperInteraction:"Ecommerce",browser_info:{...browserInfo()}}};delete attributes.payment_request_data.paymentMethod;try{if(await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes}),order?.id==null)return console.error("Order id is missing"),{resultCode:"Error"};if(currentPaymentMethodType2==="giftcard"){const currentBalance=(await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{_balance:!0}}))?.balance??0,totalAmount=order?.total_amount_with_taxes_cents??0;if(currentBalance===0){const message="The gift card has no balance. Please use a different one.";return setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType2,message}]),{resultCode:"Refused",message}}const attributes2=currentBalance>=totalAmount?{_authorize:!0}:{_authorization_amount_cents:currentBalance,_authorize:!0},{order:orderUpdated}=await updateOrder({id:order.id,attributes:attributes2}),resultCode2=orderUpdated?.payment_source?.payment_response?.resultCode,refusalReasonCode=orderUpdated?.payment_source?.payment_response?.refusalReasonCode,errorCode=orderUpdated?.payment_source?.payment_response?.errorCode,action2=orderUpdated?.payment_source?.payment_response?.action,paymentStatus2=orderUpdated?.payment_status;if(["Cancelled","Refused"].includes(resultCode2)&&refusalReasonCode!=="12"||errorCode){const message=orderUpdated?.payment_response?.refusalReason??orderUpdated?.payment_response?.message;return{resultCode:errorCode?"Refused":resultCode2,message}}return{resultCode:"Authorised",paymentMethodType:currentPaymentMethodType2,action:action2,paymentStatus:paymentStatus2}}const res=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{_authorize:1}}),action=res?.payment_response?.action,resultCode=res?.payment_response?.resultCode;if(action!=null)return{resultCode,action};const issuerType=res?.payment_instrument?.issuer_type;if(["Authorised","Pending","Received"].includes(resultCode))return["apple pay","google pay"].includes(issuerType)&&setPlaceOrder!=null?(await 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=res?.payment_response?.refusalReason;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType2,message}]),component&&component.mount("#adyen-dropin")}if(res?.payment_response?.errorType)if(res?.payment_response?.errorCode==="14_006")onSubmit(state,component);else{const message=res?.payment_response?.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 useEffect(()=>{const paymentMethodsResponse={paymentMethods:paymentSource?.payment_methods?.paymentMethods?paymentSource?.payment_methods.paymentMethods:[],storedPaymentMethods:paymentSource?.payment_methods?.storedPaymentMethods?paymentSource?.payment_methods.storedPaymentMethods:[]};paymentMethodsResponse.paymentMethods.length===0&&console.error("Payment methods are not available. Please, check your Adyen configuration.");let showStoredPaymentMethods=paymentSource?.payment_methods?.storedPaymentMethods!=null;order&&hasSubscriptions(order)&&(showStoredPaymentMethods=!1,paymentMethodsResponse.storedPaymentMethods=[],paymentMethodsResponse.paymentMethods=subscriptionPaymentMethods!=null&&subscriptionPaymentMethods.length>0?paymentMethodsResponse.paymentMethods.filter(pm=>subscriptionPaymentMethods.includes(pm.type)):paymentMethodsResponse.paymentMethods);const options={locale:order?.language_code??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)=>{(async()=>{const{resultCode}=await handleOnAdditionalDetails(state,element);["Cancelled","Refused"].includes(resultCode)?actions.reject():actions.resolve({resultCode})})()},onChange:state=>{handleChange(state)},onSubmit:(state,element,actions)=>{(async()=>{const{resultCode,action,message,paymentStatus}=await onSubmit(state,element);["Cancelled","Refused"].includes(resultCode)?(actions.reject(),message&&setGiftcardError(message)):action!=null?dropinRef.current?.handleAction(action):(actions.resolve({resultCode}),paymentStatus==="partially_authorized"&&dropinRef.current?.mount("#adyen-dropin"),setGiftcardError(null))})()}};if(!ref&&clientKey&&setCustomerOrderParam("_save_payment_source_to_customer_wallet","false"),clientKey&&!loadAdyen&&window&&!checkout){const initializeAdyen=async()=>{const checkout2=await AdyenCheckout(options),dropin=new Dropin(checkout2,{disableFinalAnimation:!0,showRemovePaymentMethodButton:showStoredPaymentMethods,instantPaymentTypes:["applepay","googlepay"],paymentMethodsConfiguration:{showStoredPaymentMethods,paypal:{showPayButton:!0,style:styles?.paypal,...config?.paymentMethodsConfiguration?.paypal},card:{enableStoreDetails:showStoredPaymentMethods,styles:styles?.card,holderNameRequired:!1,...config?.paymentMethodsConfiguration?.card},giftcard:{showPayButton:!0,...config?.paymentMethodsConfiguration?.giftcard},...config?.paymentMethodsConfiguration},onDisableStoredPaymentMethod:state=>{const recurringDetailReference=state,shopperReference=customers?.shopper_reference??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=async()=>await handleSubmit(ref.current):ref.current.onsubmit=null,setPaymentRef({ref})),onSelect&&onSelect(component)},onReady(){onReady&&onReady()}}).mount("#adyen-dropin");dropin&&checkout2&&(dropinRef.current=dropin,setCheckout(dropin),setLoadAdyen(!0))},html=document.getElementById("adyen-dropin");!dropinRef.current&&status==="standby"&&html&&initializeAdyen()}return()=>{setPaymentRef({ref:{current:null}}),setLoadAdyen(!1)}},[clientKey,ref!=null,status]),!clientKey&&!loadAdyen&&!checkout?null:_jsxs("form",{ref,onSubmit:e=>{handleSubmit(e)},children:[_jsx("div",{className:cardContainerClassName,id:"adyen-dropin"}),giftcardError!=null&&giftcardErrorComponent?giftcardErrorComponent(giftcardError):null,templateCustomerSaveToWallet&&_jsx(Parent,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})]})}export default AdyenPayment;
@@ -0,0 +1,10 @@
1
+ import { type JSX, type ReactNode } 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 PaymentSourceDeleteButton({ children, label, ...props }: Props): JSX.Element | null;
10
+ export default PaymentSourceDeleteButton;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import Parent from"../utils/Parent";import CustomerPaymentSourceContext from"../../context/CustomerPaymentSourceContext";export function PaymentSourceDeleteButton({children,label="Delete",...props}){const{handleDeleteClick}=useContext(CustomerPaymentSourceContext),parentProps={label,handleDeleteClick,...props};return children?_jsx(Parent,{...parentProps,children}):handleDeleteClick!=null?_jsx("button",{...props,onClick:handleDeleteClick,children:label}):null}export default PaymentSourceDeleteButton;
@@ -5,6 +5,7 @@ interface DefaultContext {
5
5
  exp_year?: number | string;
6
6
  last4?: string;
7
7
  issuer_type?: string;
8
+ handleDeleteClick?: (e: MouseEvent) => void;
8
9
  }
9
10
  export declare const defaultCustomerPaymentSourceContext: {};
10
11
  declare const CustomerPaymentSourceContext: import("react").Context<DefaultContext>;
@@ -81,6 +81,7 @@ export * from './components/payment_source/PaymentSourceBrandIcon';
81
81
  export * from './components/payment_source/PaymentSourceBrandName';
82
82
  export * from './components/payment_source/PaymentSourceDetail';
83
83
  export * from './components/payment_source/PaymentSourceEditButton';
84
+ export * from './components/payment_source/PaymentSourceDeleteButton';
84
85
  export * from './components/prices/Price';
85
86
  export * from './components/prices/PricesContainer';
86
87
  export * from './components/shipments/Shipment';
package/lib/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export*from"./components/ExternalFunction";export*from"./components/MetadataInput";export*from"./components/SubmitButton";export*from"./components/addresses/Address";export*from"./components/addresses/AddressCountrySelector";export*from"./components/addresses/AddressField";export*from"./components/addresses/AddressInput";export*from"./components/addresses/AddressInputSelect";export*from"./components/addresses/AddressStateSelector";export*from"./components/addresses/AddressesContainer";export*from"./components/addresses/AddressesEmpty";export*from"./components/addresses/BillingAddressContainer";export*from"./components/addresses/BillingAddressForm";export*from"./components/addresses/SaveAddressesButton";export*from"./components/addresses/ShippingAddressContainer";export*from"./components/addresses/ShippingAddressForm";export*from"./components/auth/CommerceLayer";export*from"./components/customers/CustomerAddressForm";export*from"./components/customers/CustomerContainer";export*from"./components/customers/CustomerField";export*from"./components/customers/CustomerInput";export*from"./components/customers/SaveCustomerButton";export*from"./components/errors/Errors";export*from"./components/gift_cards/GiftCard";export*from"./components/gift_cards/GiftCardContainer";export*from"./components/gift_cards/GiftCardCurrencySelector";export*from"./components/gift_cards/GiftCardInput";export*from"./components/gift_cards/GiftCardOrCouponCode";export*from"./components/gift_cards/GiftCardOrCouponForm";export*from"./components/gift_cards/GiftCardOrCouponInput";export*from"./components/gift_cards/GiftCardOrCouponRemoveButton";export*from"./components/gift_cards/GiftCardOrCouponSubmit";export*from"./components/in_stock_subscriptions/InStockSubscriptionButton";export*from"./components/in_stock_subscriptions/InStockSubscriptionsContainer";export*from"./components/line_items/LineItem";export*from"./components/line_items/LineItemAmount";export*from"./components/line_items/LineItemCode";export*from"./components/line_items/LineItemField";export*from"./components/line_items/LineItemImage";export*from"./components/line_items/LineItemName";export*from"./components/line_items/LineItemOption";export*from"./components/line_items/LineItemOptions";export*from"./components/line_items/LineItemQuantity";export*from"./components/line_items/LineItemRemoveLink";export*from"./components/line_items/LineItemsContainer";export*from"./components/line_items/LineItemsCount";export*from"./components/line_items/LineItemsEmpty";export*from"./components/orders/AddToCartButton";export*from"./components/orders/AdjustmentAmount";export*from"./components/orders/CartLink";export*from"./components/orders/CheckoutLink";export*from"./components/orders/DiscountAmount";export*from"./components/orders/GiftCardAmount";export*from"./components/orders/OrderContainer";export*from"./components/orders/OrderList";export*from"./components/orders/OrderListEmpty";export*from"./components/orders/OrderListRow";export*from"./components/orders/OrderNumber";export*from"./components/orders/OrderStorage";export*from"./components/orders/PaymentMethodAmount";export*from"./components/orders/PlaceOrderButton";export*from"./components/orders/PlaceOrderContainer";export*from"./components/orders/PrivacyAndTermsCheckbox";export*from"./components/orders/ShippingAmount";export*from"./components/orders/SubTotalAmount";export*from"./components/orders/TaxesAmount";export*from"./components/orders/TotalAmount";export*from"./components/parcels/ParcelField";export*from"./components/parcels/ParcelLineItem";export*from"./components/parcels/ParcelLineItemField";export*from"./components/parcels/ParcelLineItemsCount";export*from"./components/parcels/Parcels";export*from"./components/parcels/ParcelsCount";export*from"./components/payment_methods/PaymentMethod";export*from"./components/payment_methods/PaymentMethodName";export*from"./components/payment_methods/PaymentMethodPrice";export*from"./components/payment_methods/PaymentMethodRadioButton";export*from"./components/payment_methods/PaymentMethodsContainer";export*from"./components/payment_source/PaymentSource";export*from"./components/payment_source/PaymentSourceBrandIcon";export*from"./components/payment_source/PaymentSourceBrandName";export*from"./components/payment_source/PaymentSourceDetail";export*from"./components/payment_source/PaymentSourceEditButton";export*from"./components/prices/Price";export*from"./components/prices/PricesContainer";export*from"./components/shipments/Shipment";export*from"./components/shipments/ShipmentField";export*from"./components/shipments/ShipmentsContainer";export*from"./components/shipments/ShipmentsCount";export*from"./components/shipping_methods/ShippingMethod";export*from"./components/shipping_methods/ShippingMethodName";export*from"./components/shipping_methods/ShippingMethodPrice";export*from"./components/shipping_methods/ShippingMethodRadioButton";export*from"./components/skus/AvailabilityContainer";export*from"./components/skus/AvailabilityTemplate";export*from"./components/skus/DeliveryLeadTime";export*from"./components/skus/SkuField";export*from"./components/skus/SkuList";export*from"./components/skus/SkuListsContainer";export*from"./components/skus/Skus";export*from"./components/skus/SkusContainer";export*from"./components/stock_transfers/StockTransfer";export*from"./components/stock_transfers/StockTransferField";export*from"./hooks/useOrderContainer";export*from"./hooks/useCommerceLayer";export*from"./hooks/useCustomerContainer";export*from"./typings/errors";
2
+ export*from"./components/ExternalFunction";export*from"./components/MetadataInput";export*from"./components/SubmitButton";export*from"./components/addresses/Address";export*from"./components/addresses/AddressCountrySelector";export*from"./components/addresses/AddressField";export*from"./components/addresses/AddressInput";export*from"./components/addresses/AddressInputSelect";export*from"./components/addresses/AddressStateSelector";export*from"./components/addresses/AddressesContainer";export*from"./components/addresses/AddressesEmpty";export*from"./components/addresses/BillingAddressContainer";export*from"./components/addresses/BillingAddressForm";export*from"./components/addresses/SaveAddressesButton";export*from"./components/addresses/ShippingAddressContainer";export*from"./components/addresses/ShippingAddressForm";export*from"./components/auth/CommerceLayer";export*from"./components/customers/CustomerAddressForm";export*from"./components/customers/CustomerContainer";export*from"./components/customers/CustomerField";export*from"./components/customers/CustomerInput";export*from"./components/customers/SaveCustomerButton";export*from"./components/errors/Errors";export*from"./components/gift_cards/GiftCard";export*from"./components/gift_cards/GiftCardContainer";export*from"./components/gift_cards/GiftCardCurrencySelector";export*from"./components/gift_cards/GiftCardInput";export*from"./components/gift_cards/GiftCardOrCouponCode";export*from"./components/gift_cards/GiftCardOrCouponForm";export*from"./components/gift_cards/GiftCardOrCouponInput";export*from"./components/gift_cards/GiftCardOrCouponRemoveButton";export*from"./components/gift_cards/GiftCardOrCouponSubmit";export*from"./components/in_stock_subscriptions/InStockSubscriptionButton";export*from"./components/in_stock_subscriptions/InStockSubscriptionsContainer";export*from"./components/line_items/LineItem";export*from"./components/line_items/LineItemAmount";export*from"./components/line_items/LineItemCode";export*from"./components/line_items/LineItemField";export*from"./components/line_items/LineItemImage";export*from"./components/line_items/LineItemName";export*from"./components/line_items/LineItemOption";export*from"./components/line_items/LineItemOptions";export*from"./components/line_items/LineItemQuantity";export*from"./components/line_items/LineItemRemoveLink";export*from"./components/line_items/LineItemsContainer";export*from"./components/line_items/LineItemsCount";export*from"./components/line_items/LineItemsEmpty";export*from"./components/orders/AddToCartButton";export*from"./components/orders/AdjustmentAmount";export*from"./components/orders/CartLink";export*from"./components/orders/CheckoutLink";export*from"./components/orders/DiscountAmount";export*from"./components/orders/GiftCardAmount";export*from"./components/orders/OrderContainer";export*from"./components/orders/OrderList";export*from"./components/orders/OrderListEmpty";export*from"./components/orders/OrderListRow";export*from"./components/orders/OrderNumber";export*from"./components/orders/OrderStorage";export*from"./components/orders/PaymentMethodAmount";export*from"./components/orders/PlaceOrderButton";export*from"./components/orders/PlaceOrderContainer";export*from"./components/orders/PrivacyAndTermsCheckbox";export*from"./components/orders/ShippingAmount";export*from"./components/orders/SubTotalAmount";export*from"./components/orders/TaxesAmount";export*from"./components/orders/TotalAmount";export*from"./components/parcels/ParcelField";export*from"./components/parcels/ParcelLineItem";export*from"./components/parcels/ParcelLineItemField";export*from"./components/parcels/ParcelLineItemsCount";export*from"./components/parcels/Parcels";export*from"./components/parcels/ParcelsCount";export*from"./components/payment_methods/PaymentMethod";export*from"./components/payment_methods/PaymentMethodName";export*from"./components/payment_methods/PaymentMethodPrice";export*from"./components/payment_methods/PaymentMethodRadioButton";export*from"./components/payment_methods/PaymentMethodsContainer";export*from"./components/payment_source/PaymentSource";export*from"./components/payment_source/PaymentSourceBrandIcon";export*from"./components/payment_source/PaymentSourceBrandName";export*from"./components/payment_source/PaymentSourceDetail";export*from"./components/payment_source/PaymentSourceEditButton";export*from"./components/payment_source/PaymentSourceDeleteButton";export*from"./components/prices/Price";export*from"./components/prices/PricesContainer";export*from"./components/shipments/Shipment";export*from"./components/shipments/ShipmentField";export*from"./components/shipments/ShipmentsContainer";export*from"./components/shipments/ShipmentsCount";export*from"./components/shipping_methods/ShippingMethod";export*from"./components/shipping_methods/ShippingMethodName";export*from"./components/shipping_methods/ShippingMethodPrice";export*from"./components/shipping_methods/ShippingMethodRadioButton";export*from"./components/skus/AvailabilityContainer";export*from"./components/skus/AvailabilityTemplate";export*from"./components/skus/DeliveryLeadTime";export*from"./components/skus/SkuField";export*from"./components/skus/SkuList";export*from"./components/skus/SkuListsContainer";export*from"./components/skus/Skus";export*from"./components/skus/SkusContainer";export*from"./components/stock_transfers/StockTransfer";export*from"./components/stock_transfers/StockTransferField";export*from"./hooks/useOrderContainer";export*from"./hooks/useCommerceLayer";export*from"./hooks/useCustomerContainer";export*from"./typings/errors";
@@ -1 +1 @@
1
- {"root":["../src/index.ts","../src/components/ExternalFunction.tsx","../src/components/MetadataInput.tsx","../src/components/SubmitButton.tsx","../src/components/addresses/Address.tsx","../src/components/addresses/AddressCountrySelector.tsx","../src/components/addresses/AddressField.tsx","../src/components/addresses/AddressInput.tsx","../src/components/addresses/AddressInputSelect.tsx","../src/components/addresses/AddressStateSelector.tsx","../src/components/addresses/AddressesContainer.tsx","../src/components/addresses/AddressesEmpty.tsx","../src/components/addresses/BillingAddressContainer.tsx","../src/components/addresses/BillingAddressForm.tsx","../src/components/addresses/SaveAddressesButton.tsx","../src/components/addresses/ShippingAddressContainer.tsx","../src/components/addresses/ShippingAddressForm.tsx","../src/components/auth/CommerceLayer.tsx","../src/components/customers/CustomerAddressForm.tsx","../src/components/customers/CustomerContainer.tsx","../src/components/customers/CustomerField.tsx","../src/components/customers/CustomerInput.tsx","../src/components/customers/CustomerPaymentSource.tsx","../src/components/customers/CustomerPaymentSourceEmpty.tsx","../src/components/customers/MyAccountLink.tsx","../src/components/customers/MyIdentityLink.tsx","../src/components/customers/SaveCustomerButton.tsx","../src/components/errors/Errors.tsx","../src/components/gift_cards/GiftCard.tsx","../src/components/gift_cards/GiftCardContainer.tsx","../src/components/gift_cards/GiftCardCurrencySelector.tsx","../src/components/gift_cards/GiftCardInput.tsx","../src/components/gift_cards/GiftCardOrCouponCode.tsx","../src/components/gift_cards/GiftCardOrCouponForm.tsx","../src/components/gift_cards/GiftCardOrCouponInput.tsx","../src/components/gift_cards/GiftCardOrCouponRemoveButton.tsx","../src/components/gift_cards/GiftCardOrCouponSubmit.tsx","../src/components/gift_cards/GiftCardRecipientInput.tsx","../src/components/in_stock_subscriptions/InStockSubscriptionButton.tsx","../src/components/in_stock_subscriptions/InStockSubscriptionsContainer.tsx","../src/components/line_items/LineItem.tsx","../src/components/line_items/LineItemAmount.tsx","../src/components/line_items/LineItemCode.tsx","../src/components/line_items/LineItemField.tsx","../src/components/line_items/LineItemImage.tsx","../src/components/line_items/LineItemName.tsx","../src/components/line_items/LineItemOption.tsx","../src/components/line_items/LineItemOptions.tsx","../src/components/line_items/LineItemQuantity.tsx","../src/components/line_items/LineItemRemoveLink.tsx","../src/components/line_items/LineItemsContainer.tsx","../src/components/line_items/LineItemsCount.tsx","../src/components/line_items/LineItemsEmpty.tsx","../src/components/orders/AddToCartButton.tsx","../src/components/orders/AdjustmentAmount.tsx","../src/components/orders/CartLink.tsx","../src/components/orders/CheckoutLink.tsx","../src/components/orders/DiscountAmount.tsx","../src/components/orders/GiftCardAmount.tsx","../src/components/orders/HostedCart.tsx","../src/components/orders/OrderContainer.tsx","../src/components/orders/OrderList.tsx","../src/components/orders/OrderListEmpty.tsx","../src/components/orders/OrderListPaginationButtons.tsx","../src/components/orders/OrderListPaginationInfo.tsx","../src/components/orders/OrderListRow.tsx","../src/components/orders/OrderNumber.tsx","../src/components/orders/OrderStorage.tsx","../src/components/orders/PaymentMethodAmount.tsx","../src/components/orders/PlaceOrderButton.tsx","../src/components/orders/PlaceOrderContainer.tsx","../src/components/orders/PrivacyAndTermsCheckbox.tsx","../src/components/orders/ShippingAmount.tsx","../src/components/orders/SubTotalAmount.tsx","../src/components/orders/TaxesAmount.tsx","../src/components/orders/TotalAmount.tsx","../src/components/parcels/ParcelField.tsx","../src/components/parcels/ParcelLineItem.tsx","../src/components/parcels/ParcelLineItemField.tsx","../src/components/parcels/ParcelLineItemsCount.tsx","../src/components/parcels/Parcels.tsx","../src/components/parcels/ParcelsCount.tsx","../src/components/payment_gateways/AdyenGateway.tsx","../src/components/payment_gateways/BraintreeGateway.tsx","../src/components/payment_gateways/CheckoutComGateway.tsx","../src/components/payment_gateways/ExternalGateway.tsx","../src/components/payment_gateways/KlarnaGateway.tsx","../src/components/payment_gateways/PaymentGateway.tsx","../src/components/payment_gateways/PaypalGateway.tsx","../src/components/payment_gateways/StripeGateway.tsx","../src/components/payment_gateways/WireTransferGateway.tsx","../src/components/payment_methods/PaymentMethod.tsx","../src/components/payment_methods/PaymentMethodName.tsx","../src/components/payment_methods/PaymentMethodPrice.tsx","../src/components/payment_methods/PaymentMethodRadioButton.tsx","../src/components/payment_methods/PaymentMethodsContainer.tsx","../src/components/payment_source/AdyenPayment.tsx","../src/components/payment_source/BraintreePayment.tsx","../src/components/payment_source/CheckoutComPayment.tsx","../src/components/payment_source/ExternalPayment.tsx","../src/components/payment_source/KlarnaPayment.tsx","../src/components/payment_source/PaymentSource.tsx","../src/components/payment_source/PaymentSourceBrandIcon.tsx","../src/components/payment_source/PaymentSourceBrandName.tsx","../src/components/payment_source/PaymentSourceDetail.tsx","../src/components/payment_source/PaymentSourceEditButton.tsx","../src/components/payment_source/PaypalPayment.tsx","../src/components/payment_source/StripeExpressPayment.tsx","../src/components/payment_source/StripePayment.tsx","../src/components/payment_source/WireTransferPayment.tsx","../src/components/prices/Price.tsx","../src/components/prices/PricesContainer.tsx","../src/components/shipments/Shipment.tsx","../src/components/shipments/ShipmentField.tsx","../src/components/shipments/ShipmentsContainer.tsx","../src/components/shipments/ShipmentsCount.tsx","../src/components/shipping_methods/ShippingMethod.tsx","../src/components/shipping_methods/ShippingMethodName.tsx","../src/components/shipping_methods/ShippingMethodPrice.tsx","../src/components/shipping_methods/ShippingMethodRadioButton.tsx","../src/components/skus/AvailabilityContainer.tsx","../src/components/skus/AvailabilityTemplate.tsx","../src/components/skus/DeliveryLeadTime.tsx","../src/components/skus/SkuField.tsx","../src/components/skus/SkuList.tsx","../src/components/skus/SkuListsContainer.tsx","../src/components/skus/Skus.tsx","../src/components/skus/SkusContainer.tsx","../src/components/stock_transfers/StockTransfer.tsx","../src/components/stock_transfers/StockTransferField.tsx","../src/components/utils/AddressCardsTemplate.tsx","../src/components/utils/BaseField.tsx","../src/components/utils/BaseInput.tsx","../src/components/utils/BaseOrderPrice.tsx","../src/components/utils/BaseSelect.tsx","../src/components/utils/ErrorBoundary.tsx","../src/components/utils/GenericFieldComponent.tsx","../src/components/utils/Parent.tsx","../src/components/utils/PaymentCardsTemplate.tsx","../src/components/utils/PriceTemplate.tsx","../src/components/utils/getAllErrors.tsx","../src/config/currency.ts","../src/context/AddressChildrenContext.ts","../src/context/AddressContext.ts","../src/context/AvailabilityContext.ts","../src/context/BillingAddressContext.ts","../src/context/BillingAddressFormContext.ts","../src/context/CommerceLayerContext.ts","../src/context/CouponAndGiftCardFormContext.ts","../src/context/CustomerAddressFormContext.ts","../src/context/CustomerContext.ts","../src/context/CustomerPaymentSourceContext.ts","../src/context/ExternalFunctionContext.ts","../src/context/GiftCardContext.ts","../src/context/InStockSubscriptionContext.ts","../src/context/LineItemChildrenContext.ts","../src/context/LineItemContext.ts","../src/context/LineItemOptionChildrenContext.ts","../src/context/OrderContext.ts","../src/context/OrderListChildrenContext.ts","../src/context/OrderListPaginationContext.ts","../src/context/OrderStorageContext.ts","../src/context/ParcelChildrenContext.ts","../src/context/ParcelLineItemChildrenContext.ts","../src/context/PaymentMethodChildrenContext.ts","../src/context/PaymentMethodContext.ts","../src/context/PaymentSourceContext.ts","../src/context/PlaceOrderContext.ts","../src/context/PricesContext.ts","../src/context/ShipmentChildrenContext.ts","../src/context/ShipmentContext.ts","../src/context/ShippingAddressContext.ts","../src/context/ShippingAddressFormContext.ts","../src/context/ShippingMethodChildrenContext.ts","../src/context/SkuChildrenContext.ts","../src/context/SkuContext.ts","../src/context/SkuListsContext.ts","../src/context/StockTransferChildrenContext.ts","../src/hooks/useCommerceLayer.ts","../src/hooks/useCustomerContainer.ts","../src/hooks/useOrderContainer.ts","../src/reducers/AddressReducer.ts","../src/reducers/AvailabilityReducer.ts","../src/reducers/BillingAddressReducer.ts","../src/reducers/CustomerReducer.ts","../src/reducers/GiftCardReducer.ts","../src/reducers/InStockSubscriptionReducer.ts","../src/reducers/LineItemReducer.ts","../src/reducers/OrderReducer.ts","../src/reducers/PaymentMethodReducer.ts","../src/reducers/PlaceOrderReducer.ts","../src/reducers/PriceReducer.ts","../src/reducers/ShipmentReducer.ts","../src/reducers/ShippingAddressReducer.ts","../src/reducers/SkuListsReducer.ts","../src/reducers/SkuReducer.ts","../src/typings/environment.d.ts","../src/typings/errors.ts","../src/typings/globals.ts","../src/typings/index.ts","../src/utils/PropsType.ts","../src/utils/addressesManager.ts","../src/utils/baseReducer.ts","../src/utils/browserInfo.ts","../src/utils/canPlaceOrder.ts","../src/utils/checkIncludeResource.ts","../src/utils/compareObjAttribute.ts","../src/utils/countryStateCity.ts","../src/utils/currencies.ts","../src/utils/customMessages.ts","../src/utils/customerOrderOptions.ts","../src/utils/events.ts","../src/utils/expressPaymentHelper.ts","../src/utils/filterChildren.ts","../src/utils/formCleaner.ts","../src/utils/getAmount.ts","../src/utils/getApplicationLink.ts","../src/utils/getCardDetails.ts","../src/utils/getCustomerIdByToken.ts","../src/utils/getDomain.ts","../src/utils/getErrors.ts","../src/utils/getLineItemsCount.ts","../src/utils/getLoaderComponent.tsx","../src/utils/getPaymentAttributes.ts","../src/utils/getPrices.tsx","../src/utils/getPublicIp.ts","../src/utils/getSdk.ts","../src/utils/getSkus.ts","../src/utils/hasSubscriptions.ts","../src/utils/icons.tsx","../src/utils/isDate.ts","../src/utils/isEmpty.ts","../src/utils/isGuestToken.ts","../src/utils/isJSON.ts","../src/utils/jwt.ts","../src/utils/localStorage.ts","../src/utils/omit.ts","../src/utils/organization.ts","../src/utils/pick.ts","../src/utils/placeholderImages.ts","../src/utils/promisify.ts","../src/utils/replace.ts","../src/utils/scrollbarWidth.ts","../src/utils/shipments.ts","../src/utils/snakeToCamelCase.ts","../src/utils/triggerAttributeHelper.ts","../src/utils/updateOrderSubscriptionCustomerPaymentSource.ts","../src/utils/validateFormFields.ts","../src/utils/adyen/manageGiftCard.ts","../src/utils/hooks/useCustomContext.ts","../src/utils/hooks/useExternalScript.ts","../src/utils/payment-methods/sortPaymentMethods.ts","../src/utils/stripe/retrievePaymentIntent.ts"],"version":"5.9.2"}
1
+ {"root":["../src/index.ts","../src/components/ExternalFunction.tsx","../src/components/MetadataInput.tsx","../src/components/SubmitButton.tsx","../src/components/addresses/Address.tsx","../src/components/addresses/AddressCountrySelector.tsx","../src/components/addresses/AddressField.tsx","../src/components/addresses/AddressInput.tsx","../src/components/addresses/AddressInputSelect.tsx","../src/components/addresses/AddressStateSelector.tsx","../src/components/addresses/AddressesContainer.tsx","../src/components/addresses/AddressesEmpty.tsx","../src/components/addresses/BillingAddressContainer.tsx","../src/components/addresses/BillingAddressForm.tsx","../src/components/addresses/SaveAddressesButton.tsx","../src/components/addresses/ShippingAddressContainer.tsx","../src/components/addresses/ShippingAddressForm.tsx","../src/components/auth/CommerceLayer.tsx","../src/components/customers/CustomerAddressForm.tsx","../src/components/customers/CustomerContainer.tsx","../src/components/customers/CustomerField.tsx","../src/components/customers/CustomerInput.tsx","../src/components/customers/CustomerPaymentSource.tsx","../src/components/customers/CustomerPaymentSourceEmpty.tsx","../src/components/customers/MyAccountLink.tsx","../src/components/customers/MyIdentityLink.tsx","../src/components/customers/SaveCustomerButton.tsx","../src/components/errors/Errors.tsx","../src/components/gift_cards/GiftCard.tsx","../src/components/gift_cards/GiftCardContainer.tsx","../src/components/gift_cards/GiftCardCurrencySelector.tsx","../src/components/gift_cards/GiftCardInput.tsx","../src/components/gift_cards/GiftCardOrCouponCode.tsx","../src/components/gift_cards/GiftCardOrCouponForm.tsx","../src/components/gift_cards/GiftCardOrCouponInput.tsx","../src/components/gift_cards/GiftCardOrCouponRemoveButton.tsx","../src/components/gift_cards/GiftCardOrCouponSubmit.tsx","../src/components/gift_cards/GiftCardRecipientInput.tsx","../src/components/in_stock_subscriptions/InStockSubscriptionButton.tsx","../src/components/in_stock_subscriptions/InStockSubscriptionsContainer.tsx","../src/components/line_items/LineItem.tsx","../src/components/line_items/LineItemAmount.tsx","../src/components/line_items/LineItemCode.tsx","../src/components/line_items/LineItemField.tsx","../src/components/line_items/LineItemImage.tsx","../src/components/line_items/LineItemName.tsx","../src/components/line_items/LineItemOption.tsx","../src/components/line_items/LineItemOptions.tsx","../src/components/line_items/LineItemQuantity.tsx","../src/components/line_items/LineItemRemoveLink.tsx","../src/components/line_items/LineItemsContainer.tsx","../src/components/line_items/LineItemsCount.tsx","../src/components/line_items/LineItemsEmpty.tsx","../src/components/orders/AddToCartButton.tsx","../src/components/orders/AdjustmentAmount.tsx","../src/components/orders/CartLink.tsx","../src/components/orders/CheckoutLink.tsx","../src/components/orders/DiscountAmount.tsx","../src/components/orders/GiftCardAmount.tsx","../src/components/orders/HostedCart.tsx","../src/components/orders/OrderContainer.tsx","../src/components/orders/OrderList.tsx","../src/components/orders/OrderListEmpty.tsx","../src/components/orders/OrderListPaginationButtons.tsx","../src/components/orders/OrderListPaginationInfo.tsx","../src/components/orders/OrderListRow.tsx","../src/components/orders/OrderNumber.tsx","../src/components/orders/OrderStorage.tsx","../src/components/orders/PaymentMethodAmount.tsx","../src/components/orders/PlaceOrderButton.tsx","../src/components/orders/PlaceOrderContainer.tsx","../src/components/orders/PrivacyAndTermsCheckbox.tsx","../src/components/orders/ShippingAmount.tsx","../src/components/orders/SubTotalAmount.tsx","../src/components/orders/TaxesAmount.tsx","../src/components/orders/TotalAmount.tsx","../src/components/parcels/ParcelField.tsx","../src/components/parcels/ParcelLineItem.tsx","../src/components/parcels/ParcelLineItemField.tsx","../src/components/parcels/ParcelLineItemsCount.tsx","../src/components/parcels/Parcels.tsx","../src/components/parcels/ParcelsCount.tsx","../src/components/payment_gateways/AdyenGateway.tsx","../src/components/payment_gateways/BraintreeGateway.tsx","../src/components/payment_gateways/CheckoutComGateway.tsx","../src/components/payment_gateways/ExternalGateway.tsx","../src/components/payment_gateways/KlarnaGateway.tsx","../src/components/payment_gateways/PaymentGateway.tsx","../src/components/payment_gateways/PaypalGateway.tsx","../src/components/payment_gateways/StripeGateway.tsx","../src/components/payment_gateways/WireTransferGateway.tsx","../src/components/payment_methods/PaymentMethod.tsx","../src/components/payment_methods/PaymentMethodName.tsx","../src/components/payment_methods/PaymentMethodPrice.tsx","../src/components/payment_methods/PaymentMethodRadioButton.tsx","../src/components/payment_methods/PaymentMethodsContainer.tsx","../src/components/payment_source/AdyenPayment.tsx","../src/components/payment_source/BraintreePayment.tsx","../src/components/payment_source/CheckoutComPayment.tsx","../src/components/payment_source/ExternalPayment.tsx","../src/components/payment_source/KlarnaPayment.tsx","../src/components/payment_source/PaymentSource.tsx","../src/components/payment_source/PaymentSourceBrandIcon.tsx","../src/components/payment_source/PaymentSourceBrandName.tsx","../src/components/payment_source/PaymentSourceDeleteButton.tsx","../src/components/payment_source/PaymentSourceDetail.tsx","../src/components/payment_source/PaymentSourceEditButton.tsx","../src/components/payment_source/PaypalPayment.tsx","../src/components/payment_source/StripeExpressPayment.tsx","../src/components/payment_source/StripePayment.tsx","../src/components/payment_source/WireTransferPayment.tsx","../src/components/prices/Price.tsx","../src/components/prices/PricesContainer.tsx","../src/components/shipments/Shipment.tsx","../src/components/shipments/ShipmentField.tsx","../src/components/shipments/ShipmentsContainer.tsx","../src/components/shipments/ShipmentsCount.tsx","../src/components/shipping_methods/ShippingMethod.tsx","../src/components/shipping_methods/ShippingMethodName.tsx","../src/components/shipping_methods/ShippingMethodPrice.tsx","../src/components/shipping_methods/ShippingMethodRadioButton.tsx","../src/components/skus/AvailabilityContainer.tsx","../src/components/skus/AvailabilityTemplate.tsx","../src/components/skus/DeliveryLeadTime.tsx","../src/components/skus/SkuField.tsx","../src/components/skus/SkuList.tsx","../src/components/skus/SkuListsContainer.tsx","../src/components/skus/Skus.tsx","../src/components/skus/SkusContainer.tsx","../src/components/stock_transfers/StockTransfer.tsx","../src/components/stock_transfers/StockTransferField.tsx","../src/components/utils/AddressCardsTemplate.tsx","../src/components/utils/BaseField.tsx","../src/components/utils/BaseInput.tsx","../src/components/utils/BaseOrderPrice.tsx","../src/components/utils/BaseSelect.tsx","../src/components/utils/ErrorBoundary.tsx","../src/components/utils/GenericFieldComponent.tsx","../src/components/utils/Parent.tsx","../src/components/utils/PaymentCardsTemplate.tsx","../src/components/utils/PriceTemplate.tsx","../src/components/utils/getAllErrors.tsx","../src/config/currency.ts","../src/context/AddressChildrenContext.ts","../src/context/AddressContext.ts","../src/context/AvailabilityContext.ts","../src/context/BillingAddressContext.ts","../src/context/BillingAddressFormContext.ts","../src/context/CommerceLayerContext.ts","../src/context/CouponAndGiftCardFormContext.ts","../src/context/CustomerAddressFormContext.ts","../src/context/CustomerContext.ts","../src/context/CustomerPaymentSourceContext.ts","../src/context/ExternalFunctionContext.ts","../src/context/GiftCardContext.ts","../src/context/InStockSubscriptionContext.ts","../src/context/LineItemChildrenContext.ts","../src/context/LineItemContext.ts","../src/context/LineItemOptionChildrenContext.ts","../src/context/OrderContext.ts","../src/context/OrderListChildrenContext.ts","../src/context/OrderListPaginationContext.ts","../src/context/OrderStorageContext.ts","../src/context/ParcelChildrenContext.ts","../src/context/ParcelLineItemChildrenContext.ts","../src/context/PaymentMethodChildrenContext.ts","../src/context/PaymentMethodContext.ts","../src/context/PaymentSourceContext.ts","../src/context/PlaceOrderContext.ts","../src/context/PricesContext.ts","../src/context/ShipmentChildrenContext.ts","../src/context/ShipmentContext.ts","../src/context/ShippingAddressContext.ts","../src/context/ShippingAddressFormContext.ts","../src/context/ShippingMethodChildrenContext.ts","../src/context/SkuChildrenContext.ts","../src/context/SkuContext.ts","../src/context/SkuListsContext.ts","../src/context/StockTransferChildrenContext.ts","../src/hooks/useCommerceLayer.ts","../src/hooks/useCustomerContainer.ts","../src/hooks/useOrderContainer.ts","../src/reducers/AddressReducer.ts","../src/reducers/AvailabilityReducer.ts","../src/reducers/BillingAddressReducer.ts","../src/reducers/CustomerReducer.ts","../src/reducers/GiftCardReducer.ts","../src/reducers/InStockSubscriptionReducer.ts","../src/reducers/LineItemReducer.ts","../src/reducers/OrderReducer.ts","../src/reducers/PaymentMethodReducer.ts","../src/reducers/PlaceOrderReducer.ts","../src/reducers/PriceReducer.ts","../src/reducers/ShipmentReducer.ts","../src/reducers/ShippingAddressReducer.ts","../src/reducers/SkuListsReducer.ts","../src/reducers/SkuReducer.ts","../src/typings/environment.d.ts","../src/typings/errors.ts","../src/typings/globals.ts","../src/typings/index.ts","../src/utils/PropsType.ts","../src/utils/addressesManager.ts","../src/utils/baseReducer.ts","../src/utils/browserInfo.ts","../src/utils/canPlaceOrder.ts","../src/utils/checkIncludeResource.ts","../src/utils/compareObjAttribute.ts","../src/utils/countryStateCity.ts","../src/utils/currencies.ts","../src/utils/customMessages.ts","../src/utils/customerOrderOptions.ts","../src/utils/events.ts","../src/utils/expressPaymentHelper.ts","../src/utils/filterChildren.ts","../src/utils/formCleaner.ts","../src/utils/getAmount.ts","../src/utils/getApplicationLink.ts","../src/utils/getCardDetails.ts","../src/utils/getCustomerIdByToken.ts","../src/utils/getDomain.ts","../src/utils/getErrors.ts","../src/utils/getLineItemsCount.ts","../src/utils/getLoaderComponent.tsx","../src/utils/getPaymentAttributes.ts","../src/utils/getPrices.tsx","../src/utils/getPublicIp.ts","../src/utils/getSdk.ts","../src/utils/getSkus.ts","../src/utils/hasSubscriptions.ts","../src/utils/icons.tsx","../src/utils/isDate.ts","../src/utils/isEmpty.ts","../src/utils/isGuestToken.ts","../src/utils/isJSON.ts","../src/utils/jwt.ts","../src/utils/localStorage.ts","../src/utils/omit.ts","../src/utils/organization.ts","../src/utils/pick.ts","../src/utils/placeholderImages.ts","../src/utils/promisify.ts","../src/utils/replace.ts","../src/utils/scrollbarWidth.ts","../src/utils/shipments.ts","../src/utils/snakeToCamelCase.ts","../src/utils/triggerAttributeHelper.ts","../src/utils/updateOrderSubscriptionCustomerPaymentSource.ts","../src/utils/validateFormFields.ts","../src/utils/adyen/manageGiftCard.ts","../src/utils/hooks/useCustomContext.ts","../src/utils/hooks/useExternalScript.ts","../src/utils/payment-methods/sortPaymentMethods.ts","../src/utils/stripe/retrievePaymentIntent.ts"],"version":"5.9.2"}
@@ -1 +1 @@
1
- {"root":["../src/index.ts","../src/components/ExternalFunction.tsx","../src/components/MetadataInput.tsx","../src/components/SubmitButton.tsx","../src/components/addresses/Address.tsx","../src/components/addresses/AddressCountrySelector.tsx","../src/components/addresses/AddressField.tsx","../src/components/addresses/AddressInput.tsx","../src/components/addresses/AddressInputSelect.tsx","../src/components/addresses/AddressStateSelector.tsx","../src/components/addresses/AddressesContainer.tsx","../src/components/addresses/AddressesEmpty.tsx","../src/components/addresses/BillingAddressContainer.tsx","../src/components/addresses/BillingAddressForm.tsx","../src/components/addresses/SaveAddressesButton.tsx","../src/components/addresses/ShippingAddressContainer.tsx","../src/components/addresses/ShippingAddressForm.tsx","../src/components/auth/CommerceLayer.tsx","../src/components/customers/CustomerAddressForm.tsx","../src/components/customers/CustomerContainer.tsx","../src/components/customers/CustomerField.tsx","../src/components/customers/CustomerInput.tsx","../src/components/customers/CustomerPaymentSource.tsx","../src/components/customers/CustomerPaymentSourceEmpty.tsx","../src/components/customers/MyAccountLink.tsx","../src/components/customers/MyIdentityLink.tsx","../src/components/customers/SaveCustomerButton.tsx","../src/components/errors/Errors.tsx","../src/components/gift_cards/GiftCard.tsx","../src/components/gift_cards/GiftCardContainer.tsx","../src/components/gift_cards/GiftCardCurrencySelector.tsx","../src/components/gift_cards/GiftCardInput.tsx","../src/components/gift_cards/GiftCardOrCouponCode.tsx","../src/components/gift_cards/GiftCardOrCouponForm.tsx","../src/components/gift_cards/GiftCardOrCouponInput.tsx","../src/components/gift_cards/GiftCardOrCouponRemoveButton.tsx","../src/components/gift_cards/GiftCardOrCouponSubmit.tsx","../src/components/gift_cards/GiftCardRecipientInput.tsx","../src/components/in_stock_subscriptions/InStockSubscriptionButton.tsx","../src/components/in_stock_subscriptions/InStockSubscriptionsContainer.tsx","../src/components/line_items/LineItem.tsx","../src/components/line_items/LineItemAmount.tsx","../src/components/line_items/LineItemCode.tsx","../src/components/line_items/LineItemField.tsx","../src/components/line_items/LineItemImage.tsx","../src/components/line_items/LineItemName.tsx","../src/components/line_items/LineItemOption.tsx","../src/components/line_items/LineItemOptions.tsx","../src/components/line_items/LineItemQuantity.tsx","../src/components/line_items/LineItemRemoveLink.tsx","../src/components/line_items/LineItemsContainer.tsx","../src/components/line_items/LineItemsCount.tsx","../src/components/line_items/LineItemsEmpty.tsx","../src/components/orders/AddToCartButton.tsx","../src/components/orders/AdjustmentAmount.tsx","../src/components/orders/CartLink.tsx","../src/components/orders/CheckoutLink.tsx","../src/components/orders/DiscountAmount.tsx","../src/components/orders/GiftCardAmount.tsx","../src/components/orders/HostedCart.tsx","../src/components/orders/OrderContainer.tsx","../src/components/orders/OrderList.tsx","../src/components/orders/OrderListEmpty.tsx","../src/components/orders/OrderListPaginationButtons.tsx","../src/components/orders/OrderListPaginationInfo.tsx","../src/components/orders/OrderListRow.tsx","../src/components/orders/OrderNumber.tsx","../src/components/orders/OrderStorage.tsx","../src/components/orders/PaymentMethodAmount.tsx","../src/components/orders/PlaceOrderButton.tsx","../src/components/orders/PlaceOrderContainer.tsx","../src/components/orders/PrivacyAndTermsCheckbox.tsx","../src/components/orders/ShippingAmount.tsx","../src/components/orders/SubTotalAmount.tsx","../src/components/orders/TaxesAmount.tsx","../src/components/orders/TotalAmount.tsx","../src/components/parcels/ParcelField.tsx","../src/components/parcels/ParcelLineItem.tsx","../src/components/parcels/ParcelLineItemField.tsx","../src/components/parcels/ParcelLineItemsCount.tsx","../src/components/parcels/Parcels.tsx","../src/components/parcels/ParcelsCount.tsx","../src/components/payment_gateways/AdyenGateway.tsx","../src/components/payment_gateways/BraintreeGateway.tsx","../src/components/payment_gateways/CheckoutComGateway.tsx","../src/components/payment_gateways/ExternalGateway.tsx","../src/components/payment_gateways/KlarnaGateway.tsx","../src/components/payment_gateways/PaymentGateway.tsx","../src/components/payment_gateways/PaypalGateway.tsx","../src/components/payment_gateways/StripeGateway.tsx","../src/components/payment_gateways/WireTransferGateway.tsx","../src/components/payment_methods/PaymentMethod.tsx","../src/components/payment_methods/PaymentMethodName.tsx","../src/components/payment_methods/PaymentMethodPrice.tsx","../src/components/payment_methods/PaymentMethodRadioButton.tsx","../src/components/payment_methods/PaymentMethodsContainer.tsx","../src/components/payment_source/AdyenPayment.tsx","../src/components/payment_source/BraintreePayment.tsx","../src/components/payment_source/CheckoutComPayment.tsx","../src/components/payment_source/ExternalPayment.tsx","../src/components/payment_source/KlarnaPayment.tsx","../src/components/payment_source/PaymentSource.tsx","../src/components/payment_source/PaymentSourceBrandIcon.tsx","../src/components/payment_source/PaymentSourceBrandName.tsx","../src/components/payment_source/PaymentSourceDetail.tsx","../src/components/payment_source/PaymentSourceEditButton.tsx","../src/components/payment_source/PaypalPayment.tsx","../src/components/payment_source/StripeExpressPayment.tsx","../src/components/payment_source/StripePayment.tsx","../src/components/payment_source/WireTransferPayment.tsx","../src/components/prices/Price.tsx","../src/components/prices/PricesContainer.tsx","../src/components/shipments/Shipment.tsx","../src/components/shipments/ShipmentField.tsx","../src/components/shipments/ShipmentsContainer.tsx","../src/components/shipments/ShipmentsCount.tsx","../src/components/shipping_methods/ShippingMethod.tsx","../src/components/shipping_methods/ShippingMethodName.tsx","../src/components/shipping_methods/ShippingMethodPrice.tsx","../src/components/shipping_methods/ShippingMethodRadioButton.tsx","../src/components/skus/AvailabilityContainer.tsx","../src/components/skus/AvailabilityTemplate.tsx","../src/components/skus/DeliveryLeadTime.tsx","../src/components/skus/SkuField.tsx","../src/components/skus/SkuList.tsx","../src/components/skus/SkuListsContainer.tsx","../src/components/skus/Skus.tsx","../src/components/skus/SkusContainer.tsx","../src/components/stock_transfers/StockTransfer.tsx","../src/components/stock_transfers/StockTransferField.tsx","../src/components/utils/AddressCardsTemplate.tsx","../src/components/utils/BaseField.tsx","../src/components/utils/BaseInput.tsx","../src/components/utils/BaseOrderPrice.tsx","../src/components/utils/BaseSelect.tsx","../src/components/utils/ErrorBoundary.tsx","../src/components/utils/GenericFieldComponent.tsx","../src/components/utils/Parent.tsx","../src/components/utils/PaymentCardsTemplate.tsx","../src/components/utils/PriceTemplate.tsx","../src/components/utils/getAllErrors.tsx","../src/config/currency.ts","../src/context/AddressChildrenContext.ts","../src/context/AddressContext.ts","../src/context/AvailabilityContext.ts","../src/context/BillingAddressContext.ts","../src/context/BillingAddressFormContext.ts","../src/context/CommerceLayerContext.ts","../src/context/CouponAndGiftCardFormContext.ts","../src/context/CustomerAddressFormContext.ts","../src/context/CustomerContext.ts","../src/context/CustomerPaymentSourceContext.ts","../src/context/ExternalFunctionContext.ts","../src/context/GiftCardContext.ts","../src/context/InStockSubscriptionContext.ts","../src/context/LineItemChildrenContext.ts","../src/context/LineItemContext.ts","../src/context/LineItemOptionChildrenContext.ts","../src/context/OrderContext.ts","../src/context/OrderListChildrenContext.ts","../src/context/OrderListPaginationContext.ts","../src/context/OrderStorageContext.ts","../src/context/ParcelChildrenContext.ts","../src/context/ParcelLineItemChildrenContext.ts","../src/context/PaymentMethodChildrenContext.ts","../src/context/PaymentMethodContext.ts","../src/context/PaymentSourceContext.ts","../src/context/PlaceOrderContext.ts","../src/context/PricesContext.ts","../src/context/ShipmentChildrenContext.ts","../src/context/ShipmentContext.ts","../src/context/ShippingAddressContext.ts","../src/context/ShippingAddressFormContext.ts","../src/context/ShippingMethodChildrenContext.ts","../src/context/SkuChildrenContext.ts","../src/context/SkuContext.ts","../src/context/SkuListsContext.ts","../src/context/StockTransferChildrenContext.ts","../src/hooks/useCommerceLayer.ts","../src/hooks/useCustomerContainer.ts","../src/hooks/useOrderContainer.ts","../src/reducers/AddressReducer.ts","../src/reducers/AvailabilityReducer.ts","../src/reducers/BillingAddressReducer.ts","../src/reducers/CustomerReducer.ts","../src/reducers/GiftCardReducer.ts","../src/reducers/InStockSubscriptionReducer.ts","../src/reducers/LineItemReducer.ts","../src/reducers/OrderReducer.ts","../src/reducers/PaymentMethodReducer.ts","../src/reducers/PlaceOrderReducer.ts","../src/reducers/PriceReducer.ts","../src/reducers/ShipmentReducer.ts","../src/reducers/ShippingAddressReducer.ts","../src/reducers/SkuListsReducer.ts","../src/reducers/SkuReducer.ts","../src/typings/environment.d.ts","../src/typings/errors.ts","../src/typings/globals.ts","../src/typings/index.ts","../src/utils/PropsType.ts","../src/utils/addressesManager.ts","../src/utils/baseReducer.ts","../src/utils/browserInfo.ts","../src/utils/canPlaceOrder.ts","../src/utils/checkIncludeResource.ts","../src/utils/compareObjAttribute.ts","../src/utils/countryStateCity.ts","../src/utils/currencies.ts","../src/utils/customMessages.ts","../src/utils/customerOrderOptions.ts","../src/utils/events.ts","../src/utils/expressPaymentHelper.ts","../src/utils/filterChildren.ts","../src/utils/formCleaner.ts","../src/utils/getAmount.ts","../src/utils/getApplicationLink.ts","../src/utils/getCardDetails.ts","../src/utils/getCustomerIdByToken.ts","../src/utils/getDomain.ts","../src/utils/getErrors.ts","../src/utils/getLineItemsCount.ts","../src/utils/getLoaderComponent.tsx","../src/utils/getPaymentAttributes.ts","../src/utils/getPrices.tsx","../src/utils/getPublicIp.ts","../src/utils/getSdk.ts","../src/utils/getSkus.ts","../src/utils/hasSubscriptions.ts","../src/utils/icons.tsx","../src/utils/isDate.ts","../src/utils/isEmpty.ts","../src/utils/isGuestToken.ts","../src/utils/isJSON.ts","../src/utils/jwt.ts","../src/utils/localStorage.ts","../src/utils/omit.ts","../src/utils/organization.ts","../src/utils/pick.ts","../src/utils/placeholderImages.ts","../src/utils/promisify.ts","../src/utils/replace.ts","../src/utils/scrollbarWidth.ts","../src/utils/shipments.ts","../src/utils/snakeToCamelCase.ts","../src/utils/triggerAttributeHelper.ts","../src/utils/updateOrderSubscriptionCustomerPaymentSource.ts","../src/utils/validateFormFields.ts","../src/utils/adyen/manageGiftCard.ts","../src/utils/hooks/useCustomContext.ts","../src/utils/hooks/useExternalScript.ts","../src/utils/payment-methods/sortPaymentMethods.ts","../src/utils/stripe/retrievePaymentIntent.ts"],"version":"5.9.2"}
1
+ {"root":["../src/index.ts","../src/components/ExternalFunction.tsx","../src/components/MetadataInput.tsx","../src/components/SubmitButton.tsx","../src/components/addresses/Address.tsx","../src/components/addresses/AddressCountrySelector.tsx","../src/components/addresses/AddressField.tsx","../src/components/addresses/AddressInput.tsx","../src/components/addresses/AddressInputSelect.tsx","../src/components/addresses/AddressStateSelector.tsx","../src/components/addresses/AddressesContainer.tsx","../src/components/addresses/AddressesEmpty.tsx","../src/components/addresses/BillingAddressContainer.tsx","../src/components/addresses/BillingAddressForm.tsx","../src/components/addresses/SaveAddressesButton.tsx","../src/components/addresses/ShippingAddressContainer.tsx","../src/components/addresses/ShippingAddressForm.tsx","../src/components/auth/CommerceLayer.tsx","../src/components/customers/CustomerAddressForm.tsx","../src/components/customers/CustomerContainer.tsx","../src/components/customers/CustomerField.tsx","../src/components/customers/CustomerInput.tsx","../src/components/customers/CustomerPaymentSource.tsx","../src/components/customers/CustomerPaymentSourceEmpty.tsx","../src/components/customers/MyAccountLink.tsx","../src/components/customers/MyIdentityLink.tsx","../src/components/customers/SaveCustomerButton.tsx","../src/components/errors/Errors.tsx","../src/components/gift_cards/GiftCard.tsx","../src/components/gift_cards/GiftCardContainer.tsx","../src/components/gift_cards/GiftCardCurrencySelector.tsx","../src/components/gift_cards/GiftCardInput.tsx","../src/components/gift_cards/GiftCardOrCouponCode.tsx","../src/components/gift_cards/GiftCardOrCouponForm.tsx","../src/components/gift_cards/GiftCardOrCouponInput.tsx","../src/components/gift_cards/GiftCardOrCouponRemoveButton.tsx","../src/components/gift_cards/GiftCardOrCouponSubmit.tsx","../src/components/gift_cards/GiftCardRecipientInput.tsx","../src/components/in_stock_subscriptions/InStockSubscriptionButton.tsx","../src/components/in_stock_subscriptions/InStockSubscriptionsContainer.tsx","../src/components/line_items/LineItem.tsx","../src/components/line_items/LineItemAmount.tsx","../src/components/line_items/LineItemCode.tsx","../src/components/line_items/LineItemField.tsx","../src/components/line_items/LineItemImage.tsx","../src/components/line_items/LineItemName.tsx","../src/components/line_items/LineItemOption.tsx","../src/components/line_items/LineItemOptions.tsx","../src/components/line_items/LineItemQuantity.tsx","../src/components/line_items/LineItemRemoveLink.tsx","../src/components/line_items/LineItemsContainer.tsx","../src/components/line_items/LineItemsCount.tsx","../src/components/line_items/LineItemsEmpty.tsx","../src/components/orders/AddToCartButton.tsx","../src/components/orders/AdjustmentAmount.tsx","../src/components/orders/CartLink.tsx","../src/components/orders/CheckoutLink.tsx","../src/components/orders/DiscountAmount.tsx","../src/components/orders/GiftCardAmount.tsx","../src/components/orders/HostedCart.tsx","../src/components/orders/OrderContainer.tsx","../src/components/orders/OrderList.tsx","../src/components/orders/OrderListEmpty.tsx","../src/components/orders/OrderListPaginationButtons.tsx","../src/components/orders/OrderListPaginationInfo.tsx","../src/components/orders/OrderListRow.tsx","../src/components/orders/OrderNumber.tsx","../src/components/orders/OrderStorage.tsx","../src/components/orders/PaymentMethodAmount.tsx","../src/components/orders/PlaceOrderButton.tsx","../src/components/orders/PlaceOrderContainer.tsx","../src/components/orders/PrivacyAndTermsCheckbox.tsx","../src/components/orders/ShippingAmount.tsx","../src/components/orders/SubTotalAmount.tsx","../src/components/orders/TaxesAmount.tsx","../src/components/orders/TotalAmount.tsx","../src/components/parcels/ParcelField.tsx","../src/components/parcels/ParcelLineItem.tsx","../src/components/parcels/ParcelLineItemField.tsx","../src/components/parcels/ParcelLineItemsCount.tsx","../src/components/parcels/Parcels.tsx","../src/components/parcels/ParcelsCount.tsx","../src/components/payment_gateways/AdyenGateway.tsx","../src/components/payment_gateways/BraintreeGateway.tsx","../src/components/payment_gateways/CheckoutComGateway.tsx","../src/components/payment_gateways/ExternalGateway.tsx","../src/components/payment_gateways/KlarnaGateway.tsx","../src/components/payment_gateways/PaymentGateway.tsx","../src/components/payment_gateways/PaypalGateway.tsx","../src/components/payment_gateways/StripeGateway.tsx","../src/components/payment_gateways/WireTransferGateway.tsx","../src/components/payment_methods/PaymentMethod.tsx","../src/components/payment_methods/PaymentMethodName.tsx","../src/components/payment_methods/PaymentMethodPrice.tsx","../src/components/payment_methods/PaymentMethodRadioButton.tsx","../src/components/payment_methods/PaymentMethodsContainer.tsx","../src/components/payment_source/AdyenPayment.tsx","../src/components/payment_source/BraintreePayment.tsx","../src/components/payment_source/CheckoutComPayment.tsx","../src/components/payment_source/ExternalPayment.tsx","../src/components/payment_source/KlarnaPayment.tsx","../src/components/payment_source/PaymentSource.tsx","../src/components/payment_source/PaymentSourceBrandIcon.tsx","../src/components/payment_source/PaymentSourceBrandName.tsx","../src/components/payment_source/PaymentSourceDeleteButton.tsx","../src/components/payment_source/PaymentSourceDetail.tsx","../src/components/payment_source/PaymentSourceEditButton.tsx","../src/components/payment_source/PaypalPayment.tsx","../src/components/payment_source/StripeExpressPayment.tsx","../src/components/payment_source/StripePayment.tsx","../src/components/payment_source/WireTransferPayment.tsx","../src/components/prices/Price.tsx","../src/components/prices/PricesContainer.tsx","../src/components/shipments/Shipment.tsx","../src/components/shipments/ShipmentField.tsx","../src/components/shipments/ShipmentsContainer.tsx","../src/components/shipments/ShipmentsCount.tsx","../src/components/shipping_methods/ShippingMethod.tsx","../src/components/shipping_methods/ShippingMethodName.tsx","../src/components/shipping_methods/ShippingMethodPrice.tsx","../src/components/shipping_methods/ShippingMethodRadioButton.tsx","../src/components/skus/AvailabilityContainer.tsx","../src/components/skus/AvailabilityTemplate.tsx","../src/components/skus/DeliveryLeadTime.tsx","../src/components/skus/SkuField.tsx","../src/components/skus/SkuList.tsx","../src/components/skus/SkuListsContainer.tsx","../src/components/skus/Skus.tsx","../src/components/skus/SkusContainer.tsx","../src/components/stock_transfers/StockTransfer.tsx","../src/components/stock_transfers/StockTransferField.tsx","../src/components/utils/AddressCardsTemplate.tsx","../src/components/utils/BaseField.tsx","../src/components/utils/BaseInput.tsx","../src/components/utils/BaseOrderPrice.tsx","../src/components/utils/BaseSelect.tsx","../src/components/utils/ErrorBoundary.tsx","../src/components/utils/GenericFieldComponent.tsx","../src/components/utils/Parent.tsx","../src/components/utils/PaymentCardsTemplate.tsx","../src/components/utils/PriceTemplate.tsx","../src/components/utils/getAllErrors.tsx","../src/config/currency.ts","../src/context/AddressChildrenContext.ts","../src/context/AddressContext.ts","../src/context/AvailabilityContext.ts","../src/context/BillingAddressContext.ts","../src/context/BillingAddressFormContext.ts","../src/context/CommerceLayerContext.ts","../src/context/CouponAndGiftCardFormContext.ts","../src/context/CustomerAddressFormContext.ts","../src/context/CustomerContext.ts","../src/context/CustomerPaymentSourceContext.ts","../src/context/ExternalFunctionContext.ts","../src/context/GiftCardContext.ts","../src/context/InStockSubscriptionContext.ts","../src/context/LineItemChildrenContext.ts","../src/context/LineItemContext.ts","../src/context/LineItemOptionChildrenContext.ts","../src/context/OrderContext.ts","../src/context/OrderListChildrenContext.ts","../src/context/OrderListPaginationContext.ts","../src/context/OrderStorageContext.ts","../src/context/ParcelChildrenContext.ts","../src/context/ParcelLineItemChildrenContext.ts","../src/context/PaymentMethodChildrenContext.ts","../src/context/PaymentMethodContext.ts","../src/context/PaymentSourceContext.ts","../src/context/PlaceOrderContext.ts","../src/context/PricesContext.ts","../src/context/ShipmentChildrenContext.ts","../src/context/ShipmentContext.ts","../src/context/ShippingAddressContext.ts","../src/context/ShippingAddressFormContext.ts","../src/context/ShippingMethodChildrenContext.ts","../src/context/SkuChildrenContext.ts","../src/context/SkuContext.ts","../src/context/SkuListsContext.ts","../src/context/StockTransferChildrenContext.ts","../src/hooks/useCommerceLayer.ts","../src/hooks/useCustomerContainer.ts","../src/hooks/useOrderContainer.ts","../src/reducers/AddressReducer.ts","../src/reducers/AvailabilityReducer.ts","../src/reducers/BillingAddressReducer.ts","../src/reducers/CustomerReducer.ts","../src/reducers/GiftCardReducer.ts","../src/reducers/InStockSubscriptionReducer.ts","../src/reducers/LineItemReducer.ts","../src/reducers/OrderReducer.ts","../src/reducers/PaymentMethodReducer.ts","../src/reducers/PlaceOrderReducer.ts","../src/reducers/PriceReducer.ts","../src/reducers/ShipmentReducer.ts","../src/reducers/ShippingAddressReducer.ts","../src/reducers/SkuListsReducer.ts","../src/reducers/SkuReducer.ts","../src/typings/environment.d.ts","../src/typings/errors.ts","../src/typings/globals.ts","../src/typings/index.ts","../src/utils/PropsType.ts","../src/utils/addressesManager.ts","../src/utils/baseReducer.ts","../src/utils/browserInfo.ts","../src/utils/canPlaceOrder.ts","../src/utils/checkIncludeResource.ts","../src/utils/compareObjAttribute.ts","../src/utils/countryStateCity.ts","../src/utils/currencies.ts","../src/utils/customMessages.ts","../src/utils/customerOrderOptions.ts","../src/utils/events.ts","../src/utils/expressPaymentHelper.ts","../src/utils/filterChildren.ts","../src/utils/formCleaner.ts","../src/utils/getAmount.ts","../src/utils/getApplicationLink.ts","../src/utils/getCardDetails.ts","../src/utils/getCustomerIdByToken.ts","../src/utils/getDomain.ts","../src/utils/getErrors.ts","../src/utils/getLineItemsCount.ts","../src/utils/getLoaderComponent.tsx","../src/utils/getPaymentAttributes.ts","../src/utils/getPrices.tsx","../src/utils/getPublicIp.ts","../src/utils/getSdk.ts","../src/utils/getSkus.ts","../src/utils/hasSubscriptions.ts","../src/utils/icons.tsx","../src/utils/isDate.ts","../src/utils/isEmpty.ts","../src/utils/isGuestToken.ts","../src/utils/isJSON.ts","../src/utils/jwt.ts","../src/utils/localStorage.ts","../src/utils/omit.ts","../src/utils/organization.ts","../src/utils/pick.ts","../src/utils/placeholderImages.ts","../src/utils/promisify.ts","../src/utils/replace.ts","../src/utils/scrollbarWidth.ts","../src/utils/shipments.ts","../src/utils/snakeToCamelCase.ts","../src/utils/triggerAttributeHelper.ts","../src/utils/updateOrderSubscriptionCustomerPaymentSource.ts","../src/utils/validateFormFields.ts","../src/utils/adyen/manageGiftCard.ts","../src/utils/hooks/useCustomContext.ts","../src/utils/hooks/useExternalScript.ts","../src/utils/payment-methods/sortPaymentMethods.ts","../src/utils/stripe/retrievePaymentIntent.ts"],"version":"5.9.2"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/react-components",
3
- "version": "4.28.6",
3
+ "version": "4.28.8-beta.0",
4
4
  "description": "The Official Commerce Layer React Components",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/esm/index.js",