{"version":3,"sources":["webpack:///./node_modules/@stripe/stripe-js/dist/stripe.esm.js","webpack:///./src/components/StripeForm.js","webpack:///./src/pages/payment/index.js","webpack:///./node_modules/uuid/dist/esm-browser/rng.js","webpack:///./node_modules/uuid/dist/esm-browser/regex.js","webpack:///./node_modules/uuid/dist/esm-browser/stringify.js","webpack:///./node_modules/uuid/dist/esm-browser/validate.js","webpack:///./node_modules/uuid/dist/esm-browser/v4.js","webpack:///./node_modules/@stripe/react-stripe-js/dist/react-stripe.umd.js"],"names":["V3_URL","V3_URL_REGEX","EXISTING_SCRIPT_MESSAGE","stripePromise","loadScript","params","Promise","resolve","reject","window","document","Stripe","console","warn","script","scripts","querySelectorAll","concat","i","length","test","src","findScript","queryString","advancedFraudSignals","createElement","headOrBody","head","body","Error","appendChild","injectScript","addEventListener","error","initStripe","maybeStripe","args","startTime","stripe","apply","undefined","_registerWrapper","name","version","registerWrapper","stripePromise$1","then","loadCalled","err","CARD_ELEMENT_OPTIONS","style","base","fontSize","color","fontFamily","letterSpacing","lineHeight","invalid","AdminFeeInfo","___EmotionJSX","className","data-toggle","data-tooltip","data-placement","role","aria-label","StripeForm","_ref","setField","paymentInfo","useStripe","elements","useElements","isCreditReady","setIsCreditReady","useState","formStatus","setFormStatus","message","loading","onSubmit","async","event","preventDefault","_await$axios$post","floatSafePaymentAmt","Math","floor","totalAmount","paymentIntent","axios","post","qs","stringify","amount","currency","payment_method_types","headers","Authorization","data","result","confirmCardPayment","client_secret","payment_method","card","getElement","CardElement","billing_details","email","_paymentInfo$totalAmo","API","createPayment","id","uuid","clientName","clientEmail","businessName","stripeID","Lambda","sendEmail","IS_NOTIFICATION","TO","FROM","subject","toLocaleString","Date","toDateString","clear","Util","LogError","errors","Text","center","fontStyle","paddingBottom","Input","type","prepend","placeholder","value","onChange","required","disabled","step","label","append","adminFee","inputStyles","height","width","border","borderRadius","paddingLeft","customComponent","options","complete","ClipLoader","size","Button","Object","keys","_len","arguments","Array","_key","now","loadStripe","process","Payment","props","setPaymentInfo","Layout","bodyClass","SEO","title","Elements","e","target","payAmt","Number","toFixed","getRandomValues","rnds8","Uint8Array","rng","crypto","bind","msCrypto","byteToHex","push","toString","substr","arr","offset","toLowerCase","TypeError","buf","rnds","random","exports","React","ownKeys","object","enumerableOnly","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","_objectSpread2","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_typeof","obj","Symbol","iterator","constructor","prototype","configurable","writable","_slicedToArray","isArray","_arrayWithHoles","_i","_s","_e","_arr","_n","_d","call","next","done","_iterableToArrayLimit","o","minLen","_arrayLikeToArray","n","slice","from","_unsupportedIterableToArray","_nonIterableRest","len","arr2","emptyFunction","emptyFunctionWithReset","hasOwnProperty","resetWarningCache","propTypes","fn","module","createCommonjsModule","shim","propName","componentName","location","propFullName","secret","getShim","isRequired","ReactPropTypes","array","bool","func","number","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","factoryWithThrowingShims","usePrevious","ref","useRef","useEffect","current","isUnknownObject","raw","extractAllowedOptionsUpdates","prevOptions","immutableKeys","reduce","newOptions","isUpdated","isEqual","left","right","leftArray","leftPlainObject","leftKeys","rightKeys","keySet","allKeys","l","r","every","includes","validateStripe","createToken","createPaymentMethod","parseStripeProp","isPromise","tag","ElementsContext","createContext","displayName","CartElementContext","useElementsContextWithUseCase","useCaseMessage","ctx","useCase","parseElementsContext","useContext","useCartElementContextWithUseCase","parseCartElementContext","ElementsConsumer","_ref2","children","useAttachEvent","cb","cbDefined","cbRef","decoratedCb","on","off","createElementComponent","isServer","str","charAt","toUpperCase","Element","readyCallback","_ref$options","onBlur","onFocus","onReady","onEscape","onClick","onLoadError","onLoaderStart","onNetworksChange","onCheckout","onLineItemClick","onConfirm","onCancel","onShippingAddressChange","onShippingRateChange","_React$useState2","setElement","elementRef","domNode","_useCartElementContex","setCart","setCartState","useLayoutEffect","newElement","create","mount","updates","update","destroy","__elementType","AuBankAccountElement","CardNumberElement","CardExpiryElement","CardCvcElement","FpxBankElement","IbanElement","IdealBankElement","P24BankElement","EpsBankElement","PaymentElement","PayButtonElement","PaymentRequestButtonElement","LinkAuthenticationElement","AddressElement","ShippingAddressElement","CartElement","PaymentMethodMessagingElement","AffirmMessageElement","AfterpayClearpayMessageElement","rawStripeProp","parsed","useMemo","cart","_React$useState4","cartState","_React$useState6","setContext","isMounted","safeSetContext","prevStripe","anyStripe","registerAppInfo","url","Provider","useCartElement","useCartElementState","factory"],"mappings":"qHAAIA,EAAS,2BACTC,EAAe,4CACfC,EAA0B,mJAiC1BC,EAAgB,KAChBC,EAAa,SAAoBC,GAEnC,OAAsB,OAAlBF,EACKA,EAETA,EAAgB,IAAIG,SAAQ,SAAUC,EAASC,GAC7C,GAAsB,oBAAXC,QAA8C,oBAAbC,SAS5C,GAHID,OAAOE,QAAUN,GACnBO,QAAQC,KAAKX,GAEXO,OAAOE,OACTJ,EAAQE,OAAOE,aAGjB,IACE,IAAIG,EArDO,WAEf,IADA,IAAIC,EAAUL,SAASM,iBAAiB,gBAAiBC,OAAOjB,EAAQ,OAC/DkB,EAAI,EAAGA,EAAIH,EAAQI,OAAQD,IAAK,CACvC,IAAIJ,EAASC,EAAQG,GACrB,GAAKjB,EAAamB,KAAKN,EAAOO,KAG9B,OAAOP,EAET,OAAO,KA4CUQ,GACTR,GAAUT,EACZO,QAAQC,KAAKX,GACHY,IACVA,EA9CW,SAAsBT,GACvC,IAAIkB,EAAclB,IAAWA,EAAOmB,qBAAuB,8BAAgC,GACvFV,EAASJ,SAASe,cAAc,UACpCX,EAAOO,IAAM,GAAGJ,OAAOjB,GAAQiB,OAAOM,GACtC,IAAIG,EAAahB,SAASiB,MAAQjB,SAASkB,KAC3C,IAAKF,EACH,MAAM,IAAIG,MAAM,+EAGlB,OADAH,EAAWI,YAAYhB,GAChBA,EAqCQiB,CAAa1B,IAExBS,EAAOkB,iBAA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AAU9W,iBAAiB,CACzBC,KAAM,kBACNC,QAAS,WAEX4W,EAAUC,gBAAgB,CACxB9W,KAAM,kBACNC,QAAS,SACT8W,IAAK,+CAEN,CAACrF,EAAI9R,SACYkK,EAAM/K,cAAcqS,EAAgB4F,SAAU,CAChE/Q,MAAOyL,GACO5H,EAAM/K,cAAcwS,EAAmByF,SAAU,CAC/D/Q,MAAO,CACLoQ,KAAMA,EACNhC,QAASA,EACTkC,UAAWA,EACXjC,aAAcA,IAEfpC,KAuWLrI,EAAQmI,iBAAmBA,EAC3BnI,EAAQ0L,eAAiBA,EACzB1L,EAAQsL,eAAiBA,EACzBtL,EAAQuL,YAAcA,EACtBvL,EAAQwL,iBAAmBA,EAC3BxL,EAAQ8L,0BAA4BA,EACpC9L,EAAQyL,eAAiBA,EACzBzL,EAAQ4L,iBAAmBA,EAC3B5L,EAAQ2L,eAAiBA,EACzB3L,EAAQkM,8BAAgCA,EACxClM,EAAQ6L,4BAA8BA,EACtC7L,EAAQgM,uBAAyBA,EACjChM,EAAQoN,eAnVa,WAGnB,OAF4BnF,EAAiC,0BAC9BuE,MAkVjCxM,EAAQqN,oBA3UkB,WAGxB,OAF6BpF,EAAiC,+BACzByE,WA0UvC1M,EAAQ/H,YAvWU,WAGhB,OAF4B0P,EAA8B,uBACvB3P,UAsWrCgI,EAAQjI,UA/VQ,WAGd,OAF6B4P,EAA8B,qBACzB5R,QA8VpCyH,OAAO0D,eAAelB,EAAS,aAAc,CAC3C5D,OAAO,IA7wBsDkR,CAAQtN,EAAS,EAAQ","file":"component---src-pages-payment-index-js-645f2562f3b90bec64ca.js","sourcesContent":["var V3_URL = 'https://js.stripe.com/v3';\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(V3_URL, \"\\\"]\"));\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n if (!V3_URL_REGEX.test(script.src)) {\n continue;\n }\n return script;\n }\n return null;\n};\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(V3_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a
element.');\n }\n headOrBody.appendChild(script);\n return script;\n};\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"1.54.2\",\n startTime: startTime\n });\n};\nvar stripePromise = null;\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise !== null) {\n return stripePromise;\n }\n stripePromise = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n try {\n var script = findScript();\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n }\n script.addEventListener('load', function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n });\n script.addEventListener('error', function () {\n reject(new Error('Failed to load Stripe.js'));\n });\n } catch (error) {\n reject(error);\n return;\n }\n });\n return stripePromise;\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\n// own script injection.\n\nvar stripePromise$1 = Promise.resolve().then(function () {\n return loadScript(null);\n});\nvar loadCalled = false;\nstripePromise$1[\"catch\"](function (err) {\n if (!loadCalled) {\n console.warn(err);\n }\n});\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n loadCalled = true;\n var startTime = Date.now();\n return stripePromise$1.then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\nexport { loadStripe };","import React, { useState } from 'react'\nimport PropTypes from 'prop-types'\nimport { useStripe, useElements, CardElement } from '@stripe/react-stripe-js'\nimport axios from 'axios'\nimport qs from 'qs'\nimport { ClipLoader } from 'react-spinners'\nimport { v4 as uuid } from 'uuid'\n\nimport { API, Lambda, Util } from '../amplify'\n\nimport Input from './Input'\nimport Button from './Button'\nimport Text from './Text'\n\nconst CARD_ELEMENT_OPTIONS = {\n style: {\n base: {\n fontSize: '17px',\n color: '#495057',\n fontFamily:\n '\"Open Sans\", \"Helvetica Neue\", Arial, sans-serif, -apple-system',\n letterSpacing: '0.025em',\n lineHeight: '40px',\n '::placeholder': {\n color: '#aab7c4',\n },\n },\n invalid: {\n color: '#c23d4b',\n },\n },\n}\n\nconst AdminFeeInfo = () => (\n \n ❓\n \n)\n\nconst StripeForm = ({ setField, paymentInfo }) => {\n const stripe = useStripe()\n const elements = useElements()\n\n const [isCreditReady, setIsCreditReady] = useState(false)\n const [formStatus, setFormStatus] = useState({\n message: null,\n error: false,\n loading: false,\n })\n\n const onCardChange = event => {\n setIsCreditReady(event.complete)\n }\n\n const handleSubmit = async event => {\n event.preventDefault()\n\n if (!stripe || !elements) {\n return\n }\n setFormStatus({\n message: null,\n error: false,\n loading: true,\n })\n\n try {\n const floatSafePaymentAmt = Math.floor(paymentInfo.totalAmount * 100)\n\n // TODO: Move this to lambda if we really want this to be proper\n const paymentIntent = (\n await axios.post(\n 'https://api.stripe.com/v1/payment_intents',\n qs.stringify({\n amount: floatSafePaymentAmt, // stripe deals in cents\n currency: 'cad', // will we only have to deal with CAD?\n payment_method_types: ['card'],\n }),\n {\n headers: {\n Authorization: `Bearer ${process.env.GATSBY_STRIPE_SECRET_API_KEY}`,\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n },\n )\n )?.data\n\n const result = await stripe.confirmCardPayment(\n paymentIntent.client_secret,\n {\n payment_method: {\n card: elements.getElement(CardElement),\n billing_details: {\n name: paymentInfo.name,\n email: paymentInfo.email,\n },\n },\n },\n )\n\n if (result.error) {\n setFormStatus({\n message: result.error.message,\n error: true,\n loading: false,\n })\n } else {\n // create payment record\n await API.createPayment({\n id: uuid(),\n clientName: paymentInfo.name,\n clientEmail: paymentInfo.email,\n businessName: paymentInfo.businessName,\n totalAmount: floatSafePaymentAmt,\n stripeID: result.paymentIntent.id,\n })\n\n // send emails after payment succeeds\n await Lambda.sendEmail({\n IS_NOTIFICATION: false,\n TO: paymentInfo.email,\n FROM: 'CREDIT',\n subject: 'ADD Capital Payment Receipt',\n body: `Thank you for your payment to ADD Capital. This is a confirmation email for you to keep.