{"version":3,"sources":["webpack://order/./app/packs/src/line/pages/Payment/CheckoutForm.jsx","webpack://order/./app/packs/src/line/pages/Payment/index.jsx","webpack://order/./app/packs/src/line/components/Layout/routes.js","webpack://order/./app/packs/src/line/components/Layout/index.jsx","webpack://order/./app/packs/src/line/pages/Login/index.jsx","webpack://order/./app/packs/src/line/pages/Login/LoginVerify.jsx","webpack://order/./app/packs/src/line/LineApp.jsx","webpack://order/./app/packs/src/line/index.jsx","webpack://order/./app/packs/entrypoints/line.js","webpack://order/./app/packs/src/api/axiosClient.js","webpack://order/./app/packs/src/line/components/Header/index.jsx","webpack://order/./app/packs/src/line/components/Loading/index.jsx","webpack://order/./app/packs/src/store/reducer.js","webpack://order/./app/packs/src/store/index.js","webpack://order/./app/packs/src/store/useStore.js"],"names":["inputStyle","fontSize","lineHeight","clientSecret","useState","loading","setLoading","history","useHistory","stripe","useStripe","elements","useElements","errorMessage","setErrorMessage","handleSubmit","event","preventDefault","confirmCardPayment","payment_method","card","getElement","CardNumberElement","billing_details","name","target","value","paymentIntent","error","console","log","message","push","pathname","onSubmit","className","options","style","base","CardExpiryElement","CardCvcElement","Alert","variant","Button","type","disabled","stripePromise","loadStripe","props","orderId","match","params","id","setClientSecret","paymentType","setPaymentType","onChangeType","e","useEffect","axiosClient","then","response","client_secret","height","margin","checked","onChange","class","color","Elements","onClick","WebTop","React","NewOrder","Order","OrderConfirm","OrderSuccess","Setting","Request","path","component","exact","Payment","store","currentUser","isAuthenticated","setAppState","accessToken","localStorage","getItem","fetch","headers","json","current_user","removeItem","Loading","Container","Suspense","key","fallback","routes","route","index","location","useLocation","next","URLSearchParams","search","get","setItem","nextUrl","to","Header","href","src","split","state","Spinner","animation","Login","LoginVerify","render","Layout","App","document","addEventListener","ReactDOM","body","appendChild","createElement","Rails","ActiveStorage","axios","baseURL","paramsSerializer","queryString","interceptors","request","use","config","tokenKey","includes","token","sessionStorage","data","title","width","top","left","action","rest","initState","isAndroid","navigator","userAgent","Context","createContext","children","useRe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H,KAAM,aACHyH,MAGP,CAACL,IAEH,OAAOM,cACL,yBACKlD,GADL,IAEE4C,WACA1E,cACA6E,eAEF,CAACI,KAAKC,UAAUpD,Q","file":"js/line-2e527c7f896a16a5ff21.js","sourcesContent":["import React, {useState} from 'react';\nimport { Alert, Button } from 'react-bootstrap';\nimport {useStripe, useElements, CardNumberElement, CardExpiryElement, CardCvcElement} from '@stripe/react-stripe-js';\nimport { useHistory } from \"react-router-dom\";\nimport \"./checkout.scss\";\n\nconst inputStyle = {\n fontSize: '16px',\n lineHeight: '38px',\n}\nconst CheckoutForm = ({ clientSecret }) => {\n const [loading, setLoading] = useState(false);\n const history = useHistory();\n const stripe = useStripe();\n const elements = useElements();\n\n const [errorMessage, setErrorMessage] = useState(null);\n\n const handleSubmit = async (event) => {\n event.preventDefault();\n\n if (!stripe || !elements) {\n return;\n }\n setLoading(true)\n const {paymentIntent, error} = await stripe.confirmCardPayment(clientSecret, {\n payment_method: {\n card: elements.getElement(CardNumberElement),\n billing_details: {\n name: event.target.name.value\n }\n }\n });\n console.log(\"paymentIntent\", paymentIntent)\n console.log(\"error\", error);\n if (error) {\n setErrorMessage(error.message);\n } else {\n history.push({ pathname: \"/line/orders/success\" });\n }\n setLoading(false);\n };\n\n return (\n
\n )\n};\n\nexport default CheckoutForm;","import { Elements } from '@stripe/react-stripe-js';\nimport { loadStripe } from '@stripe/stripe-js';\nimport React, { useEffect, useState } from \"react\";\nimport { Button } from \"react-bootstrap\";\nimport { useHistory } from \"react-router-dom\";\nimport axiosClient from \"../../../api/axiosClient\";\nimport CheckoutForm from \"./CheckoutForm\";\n\nconst stripePromise = loadStripe('pk_test_kUlISJkix0GeJ7fpNjidnrdy00DyF24Qmo');\n\nconst Payment = (props) => {\n const history = useHistory();\n const orderId = props.match.params.id;\n\n const [clientSecret, setClientSecret] = useState(null);\n const [paymentType, setPaymentType] = useState(\"credit_card\")\n const onChangeType = (e) => {\n setPaymentType(e.target.value)\n }\n\n useEffect(() => {\n if (orderId) {\n axiosClient.post(`/line/api/orders/${orderId}/create_payment_intent`).then(response => {\n console.log(\"resonse\", response)\n setClientSecret(response.client_secret)\n })\n }\n }, [orderId])\n\n return (\n <>\n