{"version":3,"sources":["apis/response.ts","apis/utils.ts","apis/auth.ts","apis/charges.ts","apis/configuration.ts","apis/customers.ts","apis/payLink.ts","apis/paymentSources.ts","store/types/customization.ts","store/types/global.ts","store/actions/splitio.ts","store/selectors/global.ts","store/selectors/number.ts","store/selectors/format.ts","store/selectors/authentication.ts","store/selectors/customizations.ts","store/selectors/paymentSources.ts","store/selectors/payLink.ts","store/selectors/index.ts","store/actions/attribution.ts","store/constants.ts","store/actions/authentication.ts","config.ts","store/actions/global.ts","store/actions/customer.ts","store/actions/payLink.ts","store/actions/charge.ts","store/actions/paymentSources.ts","store/actions/credit.ts","components/PortalRoute.tsx","message.ts","components/FormFeedback.tsx","components/VerificationCodeModal.tsx","components/NavMenu.tsx","components/Powered.tsx","components/Footer.tsx","components/Layout.tsx","components/PhoneNumberInput.tsx","components/MerchantImg.tsx","pages/LoginPage.tsx","components/dropin/AddPaymentSourceButton.tsx","components/StrongholdPay.tsx","components/Pagination.tsx","components/charge/ChargeStatusBadge.tsx","components/PlaceholderLoader.tsx","components/TableBody.tsx","components/charge/ChargesTable.tsx","components/SupportCard.tsx","components/ConfirmationModal.tsx","components/PaymentSourceActions.tsx","components/split/ToggleSplit.tsx","components/Merchant.tsx","components/NewPaymentSourceLinkedModal.tsx","pages/HomePage.tsx","pages/LinkAccountPage.tsx","pages/LogoutPage.tsx","components/dropin/AddChargeDropinButton.tsx","components/checkout/CheckoutTotal.tsx","components/NumberInput.tsx","components/TipSelection.tsx","components/TipMessage.tsx","components/dropin/PaymentAuthorizationAggreement.tsx","components/PaymentSourceList.tsx","components/PayLinkSuccessCard.tsx","components/PaymentSourceRequiredWarning.tsx","components/UploadedDocuments.tsx","components/checkout/OrderItem.tsx","pages/PayLink/CheckoutPage.tsx","pages/PayLink/BankLinkPage.tsx","components/dropin/AddTipDropinButton.tsx","pages/PayLink/TipPage.tsx","segment.ts","components/auth/SignupForm.tsx","pages/SignUpPage.tsx","pages/PayLink/PayLinkPage.tsx","pages/ErrorHandler.tsx","App.tsx","store/reducers/authentication.ts","store/reducers/global.ts","store/reducers/payLink.ts","store/reducers/charge.ts","store/reducers/paymentSources.ts","store/reducers/credit.ts","store/reducers/attribution.ts","store/index.ts","index.tsx","store/configureStore.ts"],"names":["ResponseErrorType","ResponseErrorCode","ResponseError","type","code","property","message","name","Error","request","config","a","token","localStorage","getItem","merge","headers","Authorization","axios","res","data","error","errorData","response","Unknown","resendVerificationToken","method","url","result","signup","verify","login","fetchMerchant","fetchProfile","CHARGE_STATUS","listCharges","options","query","stringify","limit","getConfiguration","get","getCustomerToken","addCustomer","payLinkId","customerId","deactivatePaymentSource","sourceId","CustomizationType","SPLIT_FLAG","fetchSplitTreatmentAction","flag","dispatch","getState","selectTreatmentValue","splitio","getTreatments","splitNames","fetchMerchantTreatmentsAction","merchant","sdkBrowserConfig","core","authorizationKey","global","configuration","split","api_key","key","id","initSplitSdk","Object","values","isActionRequesting","requests","status","find","el","isRequesting","getActionStatus","statuses","getResponseError","responseError","isPropertyError","propertyName","getErrorMessage","transform","InvalidField","length","MissingField","ValueTaken","getErrorCode","getActionError","actions","action","undefined","getTitle","state","display_name","headerTitle","join","separator","getPortalLink","merchantShortName","origin","replace","isMerchantRoute","window","location","match","getSplitFlagValue","flags","formattedFlag","SIMPLE_CHECKOUT","treatment","amountToString","amount","value","toFixed","getTipAmount","tipType","tipValue","originalAmount","Math","round","getAmountDetails","tipAmount","convenienceFee","processingFee","taxAmount","totalAmount","subAmount","creditValue","totalAmountWithFees","fullAmount","formatDateTimeMinutes","moment","format","formatDate","formatAmount","parseInt","toLocaleString","minimumFractionDigits","maximumFractionDigits","formatKB","size","getFullName","authenticationState","customer","individual","first_name","last_name","getCustomization","customizations","customization","CardType","getExitUrlCallback","payLink","callbacks","exit_url","getCallbackQuery","callback","getSuccessUrlCallback","callbackUrl","paymentSourceId","chargeId","tipId","success_url","paymentSources","paymentSourceSelected","charge","tip","parsed","parse","protocol","host","pathname","merchantQuery","search","querystring","mapKeys","obj","pay_link_id","pay_link_type","pay_link_callback","payment_source_id","charge_id","tip_id","getPaymentSourceSelected","arr","getTypeOfCard","provider","toLowerCase","Visa","MasterCard","DinersClub","AmericanExpress","selectors","number","authentication","setIntegrationIdAction","integrationId","payload","setApiVersionAction","apiVersion","isAuthenticatedAction","isAuthenticated","setTokenAction","save","setItem","removeItem","updateCustomerAction","loginAction","username","merchant_short_name","resetActionStatusAction","setActionRequestingAction","api","Promise","resolve","setTimeout","loadedSplits","treatments","showSimpleWorkflow","with_order_items","setActionResponseErrorAction","PayLinkExpired","setErrorMessageAction","PayLinkCanceled","MerchantSoftwareError","PaylinkChargeAmountModified","NotFound","InvalidApiKey","LiveNotApproved","InvalidChargeStatus","PayLinkMissingCharge","PayLinkMissingOrder","ServerError","link","integration_id","setPayLinkAction","version","CustomerRequired","api_version","setPaymentSourcesAction","payment_sources","filter","s","active","setCreditValueAction","available_credit","fetchChargesAction","resendTokenAction","mobile","email","authMethod","signupAction","date_of_birth","verifyAction","fetchProfileAction","logoutAction","api_environment","environment","stronghold_pay_host","sentry_dsn","analytics","getStrongholdPayClient","publishableKey","Stronghold","ROUTE","errorCode","updateHeaderTitleAction","headerPartial","fetchConfiguration","newConfiguration","Sentry","dsn","fetchCustomerTokenAction","updatePayLinkAction","setPayLinkCustomerAction","setChargesAction","list","body","addPaymentSourceAction","removePaymentSourceAction","selectPaymentSourceAction","deactivatePaymentSourceAction","isNewPaymentSourceLinkedAction","isNewPaymentSourceLinked","PortalRoute","ready","this","props","authenticate","setState","allowUnauthenticated","hasPaymentSource","hasCharge","paymentSourceRequired","to","href","React","withRouter","connect","items","bindActionCreators","MESSAGE","ERROR_COMMON_TITLE","ERROR_COMMON","CANCELED_LINK_TITLE","CANCELED_LINK","ORDER_NOT_FOUND_TITLE","ORDER_NOT_FOUND","ORDER_AMOUNT_MODIFIED_TITLE","ORDER_AMOUNT_MODIFIED","EXPIRED_LINK_TITLE","EXPIRED_LINK_SUB_TITLE","EXPIRED_LINK","PAYMENT_METHOD_SELECT_TITLE","PAYMENT_METHOD_CHANGE","PAYMENT_METHOD_NONE","PAYMENT_METHOD_NEEDED","ERROR_MERCHANT_SOFTWARE_TITLE","ERROR_MERCHANT_SOFTWARE","ERROR_INVALID_CONFIGURATION_TITLE","ERROR_INVALID_CONFIGURATION","ERROR_LIVE_NOT_APPROVED_TITLE","ERROR_LIVE_NOT_APPROVED","ERROR_USERNAME_NOT_FOUNT","identifier","ERROR_INCORRECT_CODE","CHECK_AND_TRY_AGAIN","SELECT_OR_ADD_TIP","INVALID_CHARGE_STATUS_TITLE","INVALID_CHARGE_STATUS","FormFeedback","InvalidCredentials","VerificationCodeModal","onToggle","onClose","onSubmit","event","preventDefault","onSuccess","show","isResending","Modal","isOpen","toggle","centered","ModalHeader","ModalBody","className","mask","placeholder","onChange","e","currentTarget","ref","input","inputElement","focus","responseErrorCode","ModalFooter","color","onClick","onResend","disabled","icon","faLongArrowAltRight","fixedWidth","NavMenu","merchantDisplayName","direction","outline","caret","faUserCircle","right","style","minWidth","divider","Powered","imgSrc","isBlack","src","alt","height","Footer","LayoutBreadcrumbs","isLastItem","index","listClassName","map","title","Layout","children","navbar","breadcrumbItems","footer","PhoneNumberInput","isInvalid","country","containerClass","inputProps","imageUrl","image_url","displayName","maxHeight","LoginPage","authenticationMethod","onLogin","short_name","showModal","reload","history","push","params","bind","paramsObject","slice","faMobileAlt","autoComplete","invalid","faAt","navToSignup","background","border","cursor","fontSize","padding","linkCustomer","AddPaymentSourceButton","paymentSource","customerToken","addPaymentSource","payLinkCode","onExit","onReady","isRequestingCustomerToken","addSourcesAction","showAsLink","iconColor","iconClass","faUniversity","isLoading","isDisabled","data-sh","publishableApiKey","attribution","marginTop","getPageSkip","page","Pagination","skipped","total","currentPage","floor","getCurrentPage","paginationInfo","Paginator","build","getPaginationInfo","lastPageSkip","total_pages","previousBigStep","current_page","has","hasPagesLeft","first_page","skip","getPreviousBigStep","nextBigStep","last_page","getNextBigStep","pages","i","first","last","has_next_page","ChargeStatusBadge","textColor","text","pill","PlaceholderLoader","width","TableBody","rows","row","columns","col","ChargesTable","hasNoRows","charges","renderNoRows","noRowsComponent","hover","responsive","chargesLimit","created_at","chargesTotal","chargesSkipped","onGoTo","SupportCard","faLifeRing","ConfirmationModal","formatErrorMessage","spinner","PaymentSourceActions","onActionClick","toggleModal","paymentSourcesToDelete","item","unique_hash","forEach","errorMessage","ToggleSplit","componentDidMount","unactiveComponent","street_location","street1","street2","street3","city","postcode","NewPaymentSourceLinkedModal","HomePage","fetchCharges","lg","faIdCard","xs","fullName","uniqBy","label","faReceipt","LinkAccountPage","maxWidth","LogoutPage","AddChargeDropinButton","skipSuccessScreen","skipPayScreen","beneficiaryName","tipBeneficiaryName","onError","updatePaymentMethod","updatePaymentSource","ERROR_CODE","PAYMENT_SOURCE_LOGIN_REQUIRED","PAYMENT_SOURCE_INACTIVE","payAmount","creditAmount","isAuthorizingPayment","noSource","paymentSourceLabel","subButtonElement","faMoneyBill","CheckoutTotal","amountDetails","taxAmountStr","convenienceFeeStr","subAmountStr","tipAmountStr","creditAmountStr","fullAmountStr","VALID_FIRST","VALID_NEXT","NumberInput","handleKeyDown","max","onValueChange","keyCode","blur","test","nextValue","valueString","toString","nextValueString","Number","valueDisplay","pow","digits","prefix","suffix","trunc","abs","isFinite","isNaN","inputMode","onKeyDown","Component","TipSelection","tipInput","selectTip","getAmount","onSetAmount","toggleAmountField","tips","tipAmounts","showAmountField","includes","setDefaultValueOnChange","tipModel","value1","value2","value3","isPercentage","tipAmount1","innerRef","isPercent","tipSubValue","renderTipButton","TipMessage","tipData","orderAmount","orderCreatedAt","forOrder","budtender","display","justifyContent","alignItems","textAlign","details","display_message","originalAmountStr","PaymentAuthorizationAggreement","amountStr","PaymentSourceList","onSelectPaymentSource","onSelect","renderCardTypeIcon","faCcVisa","faCcMastercard","faCcAmex","faCcDinersClub","buttonText","buttonIconColor","canAddPaymentSource","flush","buttonColor","content","provider_name","selectable","check","checked","readOnly","stopPropagation","button","PayLinkSuccessCard","updateProgressBar","successUrlCallback","progressEnabled","progress","redirecting","setInterval","merchantName","faCheck","striped","animated","PaymentSourceRequiredWarning","UploadedDocuments","order","documents","document","file_name","file_size","download","target","rel","OrderItem","total_amount","price","description","quantity","faImage","CheckoutPage","orderSummary","continueButton","onScroll","isFirstButtonInViewport","isEndButtonInViewport","showSticky","top","getBoundingClientRect","innerHeight","offset","scrollToPayment","scrollTo","convenience_fee","payment_processing_fee","tax_amount","sub_amount","renderQuickPay","totalAmountWithTip","renderItems","ListGroup","ListGroupItem","renderPaymentMethod","header","renderTip","hasTipError","renderPdf","renderTotal","payment","beneficiary_name","block","renderSuccessMsg","success_msg","fileList","addEventListener","removeEventListener","ownProps","SuccessScreen","credits","BankLinkPage","isUsed","paymentMethods","source","AddTipDropinButton","TipPage","getAmountStr","renderOrderDetails","tipCustomization","displayMessage","drawerId","drawer_id","terminalId","terminal_id","SignupForm","toggleAuthMethod","show_sms","dobRaw","tryLogin","isMobile","resend","onSignup","resetForm","fn","noValidate","placeholderText","selected","wrapperClassName","dateFormat","showYearDropdown","scrollableYearDropdown","yearDropdownItemNumber","showMonthDropdown","scrollableMonthYearDropdown","maxDate","add","toDate","calendarClassName","popperClassName","dayClassName","date","inline","htmlFor","SignUpPage","next","step","previous","onLinkSuccess","faCircle","classes","faDotCircle","faCircleRegular","steps","borderRadius","navToLogin","textDecoration","noGutters","getStep","PayLinkPage","navigateToLogin","navigateToSignup","loaded","exitUrlCallback","borderWidth","payLinkPage","exit","faArrowLeft","ErrorHandler","reloadPage","subTitle","faRedo","App","prevProps","analyticsWriteKey","load","configurationStatus","Helmet","path","component","write_key","identify","userid","unloadedState","clone","legal_name","ENVIRONMENT","live","publishable","last_used_at","unloadedActionStatusState","reducers","updated","segment","unionBy","publishable_api_key","tmp","api_keys","LOCATION_CHANGE","splitReducer","baseUrl","getElementsByTagName","getAttribute","createBrowserHistory","basename","store","initialState","middleware","thunk","routerMiddleware","rootReducer","combineReducers","router","connectRouter","enhancers","windowIfDefined","__REDUX_DEVTOOLS_EXTENSION__","createStore","compose","applyMiddleware","configureStore","ReactDOM","getElementById"],"mappings":"wjDAAYA,EAKAC,E,sKALAD,K,kBAAAA,E,oCAAAA,M,cAKAC,K,kBAAAA,E,yCAAAA,E,2BAAAA,E,mCAAAA,E,gDAAAA,E,gCAAAA,E,uCAAAA,E,0CAAAA,E,oCAAAA,E,qBAAAA,E,uBAAAA,E,kCAAAA,E,0CAAAA,E,2BAAAA,E,qCAAAA,E,2DAAAA,E,2DAAAA,E,sDAAAA,E,2CAAAA,E,mCAAAA,E,oCAAAA,E,kCAAAA,E,6DAAAA,E,wDAAAA,E,qCAAAA,E,4CAAAA,E,8CAAAA,E,4CAAAA,E,6BAAAA,E,6BAAAA,E,0BAAAA,M,KA0DL,IAAMC,EAAb,kDAMI,WACIC,EACAC,GAGD,IAAD,EAFEC,EAEF,uDAF4B,KAC1BC,EACF,mEACE,wBAASH,EAAT,aAAkBC,EAAlB,aAA2BC,KAX/BF,UAUE,IATFC,UASE,IARFC,cAQE,IAPFC,aAOE,EAEE,EAAKC,KAAO,gBACZ,EAAKJ,KAAOA,EACZ,EAAKC,KAAOA,EACZ,EAAKC,SAAWA,EAChB,EAAKC,QAAUA,EANjB,EAXN,mCAAmCE,Q,QCvD5B,SAAeC,EAAtB,kC,4CAAO,WAA0BC,GAA1B,uBAAAC,EAAA,6DACGC,EAAQC,aAAaC,QAAQ,YAE/BJ,EAASK,gBAAML,EAAQ,CACnBM,QAAS,CAAEC,cAAc,UAAD,OAAYL,OAJzC,kBASmBM,IAAMT,QAAQC,GATjC,cASOS,EATP,yBAUQA,EAAIC,MAVZ,mCAYOC,EAZP,KAaOC,EAAYD,GAASA,EAAME,UAAYF,EAAME,SAASH,KAAKC,MAblE,uBAeW,IAAInB,EACNF,EAAkBwB,QAClBvB,EAAkBuB,QAClB,KACA,yBAnBT,cAqBO,IAAItB,EACNoB,EAAUnB,KACVmB,EAAUlB,KACVkB,EAAUjB,SAHR,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O,2BACA6F,GADP,IAEImC,YAAatC,EAAO4G,QAAQtE,cAEpC,QACI,OAAOnC,IEqBf+V,YD5B4E,WAGxD,IAFpB/V,EAEmB,uDAFXyrB,GACR5rB,EACmB,uCACnB,OAAQA,EAAO1F,MACX,I/DyC0B,qB+DxCtB,OAAO,2BACA6F,GADP,IAEIwG,cAAe3G,EAAO4G,QAAQD,gBAEtC,I/DsCuB,kB+DrCnB,OAAO,2BACAxG,GADP,IAEI2G,WAAY9G,EAAO4G,QAAQE,aAEnC,QACI,OAAO3G,KEfnB,IAAM0sB,GAAUtJ,SAASuJ,qBAAqB,QAAQ,GAAGC,aAAa,QACzD/Y,GAAUgZ,YAAqB,CAAEC,SAAUJ,KAGlDK,GCPS,SAAwBlZ,EAAkBmZ,GACrD,IAAMC,EAAa,CAACC,KAAOC,aAAiBtZ,IAEtCuZ,EAAcC,YAAgB,2BAC7BpB,IAD4B,IAE/BqB,OAAQC,YAAc1Z,MAGpB2Z,EAAY,GACZC,EAAoC,qBAAX/sB,OAAyB,KAAQA,OAKhE,OAJI+sB,GAAmBA,EAAgBC,8BACnCF,EAAU1Z,KAAK2Z,EAAgBC,gCAG5BC,YAAYP,EAAaJ,EAAcY,IAAO,WAAP,GAAQC,IAAe,WAAf,EAAmBZ,IAA3B,OAA2CO,KDP/EM,CAAeja,IAE7Bka,SACI,gBAAC,IAAD,CAAUhB,MAAOA,IACb,gBAAC,IAAD,CAAiBlZ,QAASA,IACtB,gBAAC,GAAD,QAGRuP,SAAS4K,eAAe,W","file":"static/js/main.e790eac8.chunk.js","sourcesContent":["export enum ResponseErrorType {\n Unknown = 'unknown',\n ValidationError = 'validation_error',\n}\n\nexport enum ResponseErrorCode {\n // =========================\n // Portal\n Unknown = 'unknown',\n InvalidCredentials = 'invalid_credentials',\n\n // =========================\n // Pay API errors\n\n // Api error\n ServerError = 'server_error',\n ConnectionError = 'connection_error',\n\n // Merchant software error\n MerchantSoftwareError = 'merchant_software_error',\n\n // Authentication error\n InvalidApiKey = 'invalid_api_key',\n ForbiddenResource = 'forbidden_resource',\n InvalidAccessToken = 'invalid_access_token',\n LiveNotApproved = 'live_not_approved',\n\n // Invalid request\n NotFound = 'not_found',\n InvalidId = 'invalid_id',\n TicketNotFound = 'ticket_not_found',\n DispensaryNotFound = 'dispensary_not_found',\n SandboxOnly = 'sandbox_only',\n\n // Object error\n InvalidOperation = 'invalid_operation',\n PaymentSourceAlreadyExists = 'payment_source_already_exists',\n PaymentSourceLoginRequired = 'payment_source_login_required',\n PaymentSourceUnavailable = 'payment_source_unavailable',\n InsufficientBalance = 'insufficient_balance',\n CustomerBlocked = 'customer_blocked',\n PayLinkCanceled = 'pay_link_canceled',\n PayLinkExpired = 'pay_link_expired',\n PaylinkChargeAmountModified = 'paylink_charge_amount_modified',\n PayLinkChargeAlreadyPaid = 'pay_link_charge_already_paid',\n CustomerRequired = 'customer_required',\n InvalidChargeStatus = 'invalid_charge_status',\n PayLinkMissingCharge = 'paylink_missing_charge',\n PayLinkMissingOrder = 'paylink_missing_order',\n\n // Validation error\n MissingField = 'missing_field',\n InvalidField = 'invalid_field',\n ValueTaken = 'value_taken',\n}\n\nexport interface PortalResponseError {\n type: string;\n code: string;\n property: string | null;\n message: string | null;\n}\n\nexport class ResponseError extends Error implements PortalResponseError {\n type: ResponseErrorType;\n code: ResponseErrorCode;\n property: string | null;\n message: string;\n\n public constructor(\n type: ResponseErrorType,\n code: ResponseErrorCode,\n property: string | null = null,\n message: string,\n ) {\n super(`${type}: ${code}, ${property}`);\n this.name = 'ResponseError';\n this.type = type;\n this.code = code;\n this.property = property;\n this.message = message;\n }\n}\n\nexport interface PortalResponse {\n result: T;\n}\n\nexport interface ListSegment {\n total: number;\n limit: number;\n skipped: number;\n items: T[];\n}\n\nexport interface PortalResponseFailed {\n error: PortalResponseError | null;\n}\n","import axios, { AxiosError, AxiosRequestConfig } from 'axios';\nimport { PortalResponse, PortalResponseFailed, ResponseError, ResponseErrorCode, ResponseErrorType } from './response';\nimport { merge } from 'lodash';\n\nexport const segmentListLimit = 20;\n\nexport type RequestConfig = AxiosRequestConfig;\n\nexport async function request(config: RequestConfig): Promise> {\n const token = localStorage.getItem('token');\n if (token) {\n config = merge(config, {\n headers: { Authorization: `Bearer ${token}` },\n });\n }\n\n try {\n const res = await axios.request(config);\n return res.data;\n } catch (e) {\n const error = e as AxiosError;\n const errorData = error && error.response && error.response.data.error;\n if (!errorData)\n throw new ResponseError(\n ResponseErrorType.Unknown,\n ResponseErrorCode.Unknown,\n null,\n 'Something went wrong.',\n );\n throw new ResponseError(\n errorData.type as ResponseErrorType,\n errorData.code as ResponseErrorCode,\n errorData.property,\n errorData.message ?? '',\n );\n }\n}\n","import { request } from './utils';\nimport { DeepPartial } from 'redux';\nimport { PayLinkModel } from './payLink';\nimport { PaymentSource } from '@stronghold/pay-dropin';\nimport { MerchantModel } from './types';\n\nexport type AuthenticationMethod = 'sms' | 'email' | 'link';\n\nexport interface AuthenticationModel {\n method: AuthenticationMethod;\n}\n\nexport interface CustomerIndividualDetails {\n email: string | null;\n mobile: string | null;\n first_name: string | null;\n last_name: string | null;\n date_of_birth: string | null;\n}\n\nexport interface CustomerModel {\n id: string | null;\n country: string | null;\n state: string | null;\n individual: CustomerIndividualDetails;\n payment_sources: PaymentSource[];\n}\n\nexport interface SignupRequestModel {\n authentication: AuthenticationModel;\n customer: DeepPartial;\n merchant_short_name?: string;\n}\n\nexport interface LoginRequestModel {\n authentication: AuthenticationModel;\n username: string;\n with_order_items?: boolean;\n merchant_short_name?: string;\n}\n\nexport interface ProfileResponseModel {\n customer: CustomerModel;\n}\n\nexport interface VerifyRequestModel {\n token: string;\n code: string;\n}\n\nexport interface LoginResponseModel {\n authentication: AuthenticationModel;\n token: string;\n customer: CustomerModel;\n link?: PayLinkModel;\n}\n\nexport interface SignupResponseModel {\n authentication: AuthenticationModel;\n token: string;\n customer: CustomerModel;\n}\n\nexport async function resendVerificationToken(data: SignupRequestModel) {\n const res = await request({\n method: 'POST',\n url: '/api/auth/resend',\n data,\n });\n return res.result;\n}\n\nexport async function signup(data: SignupRequestModel) {\n const res = await request({\n method: 'POST',\n url: '/api/auth/signup',\n data,\n });\n return res.result;\n}\n\nexport async function verify(data: VerifyRequestModel) {\n const res = await request({\n method: 'POST',\n url: '/api/auth/verify',\n data,\n });\n return res.result;\n}\n\nexport async function login(data: LoginRequestModel) {\n const res = await request({\n method: 'POST',\n url: '/api/auth/login',\n data,\n });\n\n return res.result;\n}\n\nexport async function fetchMerchant(code: string) {\n const res = await request({\n method: 'GET',\n url: `/api/auth/merchant/${code}`,\n });\n\n return res.result;\n}\n\nexport async function fetchProfile() {\n const res = await request({\n method: 'GET',\n url: '/api/auth/profile',\n });\n return res.result;\n}\n","import { request, segmentListLimit } from './utils';\nimport { ListSegment } from './response';\nimport { stringify } from 'querystring';\n\nexport enum CHARGE_STATUS {\n CREATED = 'created',\n AUTHORIZED = 'authorized',\n CAPTURED = 'captured',\n CANCELED = 'canceled',\n ATTEMPTING_COLLECTION = 'attempting_collection',\n CAPTURE_FAILED = 'capture_failed',\n DISPUTED = 'disputed',\n REFUND_PENDING = 'refund_pending',\n REFUNDED = 'refunded',\n STOPPED_COLLECTION = 'stopped_collection',\n}\n\nexport interface ChargeModel {\n id: string;\n type: 'bank_debit' | 'bank_debit_cnp';\n status: CHARGE_STATUS;\n merchant_convenience_fee: number;\n fee: number;\n amount: number;\n currency: string;\n customer_id: string;\n payment_source_id: string;\n external_id: string | null;\n created_at: string;\n authorized_at: string | null;\n captured_at: string | null;\n convenience_fee: number | null;\n payment_processing_fee: number | null;\n}\n\nexport async function listCharges(\n options: {\n skip?: number;\n limit?: number;\n customerId?: string;\n status?: string[];\n from?: string;\n to?: string;\n search?: string;\n } = {},\n) {\n const query = stringify({\n limit: segmentListLimit,\n ...options,\n });\n\n const res = await request>({\n method: 'GET',\n url: `/api/customers/charges?${query}`,\n });\n return res.result;\n}\n","import axios from 'axios';\nimport { PortalResponse } from './response';\nimport { ApiKeyModel, Environment, MerchantModel } from './types';\n\nexport interface ConfigurationModel {\n api_environment: 'live' | 'sandbox';\n environment: Environment;\n merchant?: MerchantModel;\n publishable_api_key?: ApiKeyModel;\n stronghold_pay_host: string;\n sentry_dsn: string;\n analytics: {\n write_key?: string;\n environment: 'Development' | 'Sandbox' | 'Live';\n };\n split: {\n api_key: string;\n };\n integration_id: string;\n api_version: string;\n}\n\nexport async function getConfiguration() {\n const res = await axios.get>('/api/configuration');\n return res.data.result;\n}\n","import { TokenModel } from '../store/types';\nimport { request } from './utils';\n\nexport async function getCustomerToken() {\n const res = await request({\n method: 'GET',\n url: '/api/customers/token',\n });\n return res.result;\n}\n","import { CustomerModel } from './auth';\nimport { MerchantModel, OrderItemModel, ApiKeyModel } from './types';\nimport { ENVIRONMENT, Charge, Tip } from '@stronghold/pay-dropin';\nimport { DeepPartial } from 'redux';\nimport { request } from './utils';\n\nexport type PayLinkType = 'checkout' | 'bank_link' | 'tipping';\nexport type PayLinkStatus = 'created' | 'used';\n\nexport interface PayLinkTipModel extends DeepPartial {\n beneficiary_name: string;\n details: {\n display_message?: string;\n drawer_id?: string;\n terminal_id?: string;\n };\n}\n\nexport interface PayLinkOrderModel {\n sub_amount: number;\n total_amount: number;\n tax_amount: number;\n convenience_fee: number;\n payment_processing_fee: number;\n items: OrderItemModel[];\n documents: PayLinkOrderDocumentModel[];\n}\n\nexport interface PayLinkOrderDocumentModel {\n url: string;\n file_name: string;\n file_size: number;\n}\n\nexport interface PayLinkModel {\n id: string;\n created_at: string;\n expires_at: string;\n type: PayLinkType;\n customer: CustomerModel;\n environment: ENVIRONMENT;\n status: PayLinkStatus;\n charge?: Charge;\n tip?: PayLinkTipModel | Tip;\n order?: PayLinkOrderModel;\n callbacks?: {\n success_url: string;\n exit_url: string;\n };\n // Internal pay link\n api_keys: { publishable: ApiKeyModel };\n merchant: MerchantModel;\n available_credit: number;\n integration_id: string;\n version: string;\n}\n\nexport async function addCustomer(payLinkId: string, customerId: string) {\n const res = await request({\n method: 'PUT',\n url: '/api/links/' + payLinkId + '/customer/' + customerId,\n });\n return res.result;\n}\n","import { request } from './utils';\nimport { ListSegment } from './response';\nimport { PaymentSource } from '@stronghold/pay-dropin';\n\nexport async function fetchPaymentSources() {\n const res = await request>({\n method: 'GET',\n url: `/api/payment-sources`,\n });\n return res.result;\n}\n\nexport async function deactivatePaymentSource(sourceId: string) {\n const res = await request({\n method: 'DELETE',\n url: `/api/payment-sources/${sourceId}`,\n });\n return res.result;\n}\n","export type TipType = 'percentage' | 'fixed';\n\nexport enum CustomizationType {\n SuccessScreen = 'portal::checkout:success_text/v1',\n}\n\nexport interface TipCustomizationModel {\n type: TipType;\n value1: number;\n value2: number;\n value3: number;\n}\n\nexport interface Customization {\n data: string;\n type: CustomizationType;\n}\n\nexport interface CustomizationModel {\n tip: TipCustomizationModel;\n items: Customization[];\n}\n","// -----------------\n// STATE - This defines the type of data maintained in the Redux store.\n\nimport { ResponseError, ResponseErrorCode } from '../../apis';\nimport { ApiKeyModel, ConfigurationModel, MerchantModel } from '../../apis';\n\nexport type ActionName =\n | 'login'\n | 'signup'\n | 'verify'\n | 'error'\n | 'set_error_message'\n | 'authenticate'\n | 'fetch_api_keys'\n | 'fetch_charges'\n | 'fetch_configuration'\n | 'fetch_payouts'\n | 'fetch_transactions'\n | 'fetch_customer_token'\n | 'fetch_customer_sources'\n | 'authorize_payment'\n | 'fetch_pay_link'\n | 'update_payment_source'\n | 'fetch_payment_sources'\n | 'set_pay_link_customer';\n\nexport interface ActionStatus {\n name: ActionName;\n isRequesting: boolean;\n responseError?: ResponseError;\n}\n\nexport interface HeaderTitle {\n separator: string;\n values: string[];\n}\n\n// Split\nexport enum SPLIT_FLAG {\n SIMPLE_CHECKOUT = 'Simple_Checkout',\n}\n\nexport type ConfigurationStatus = 'unloaded' | 'loaded' | 'error';\n\nexport interface GlobalState {\n actions: ActionStatus[];\n configuration: ConfigurationModel;\n configurationStatus: ConfigurationStatus;\n error: {\n errorCode: ResponseErrorCode | null;\n show: boolean;\n };\n headerTitle: HeaderTitle;\n publishableApiKey: ApiKeyModel;\n merchant: MerchantModel;\n}\n","import { AppThunkAction } from '../index';\nimport { ApplicationAction } from './index';\nimport { MerchantModel } from '../../apis';\nimport { initSplitSdk, selectTreatmentValue } from '@splitsoftware/splitio-redux';\nimport { getTreatments } from '@splitsoftware/splitio-redux';\nimport { SPLIT_FLAG } from '../types';\n\n// ----------------\n// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.\n// They don't directly mutate state, but they can have external side-effects (such as loading data).\n\nexport function fetchSplitTreatmentAction(flag: string): AppThunkAction {\n return async (dispatch, getState) => {\n // If treatment already in the list, return directly\n if (selectTreatmentValue(getState().splitio, flag)) {\n return;\n }\n\n await getTreatments({ splitNames: [flag] });\n };\n}\n\nexport function fetchMerchantTreatmentsAction(merchant: MerchantModel): AppThunkAction {\n return async (dispatch, getState) => {\n // fetch splits\n // each environment has its own api-key can be found on the admin settings page app.split.io\n const sdkBrowserConfig = {\n core: {\n authorizationKey: getState().global.configuration.split.api_key,\n key: merchant.id,\n },\n };\n\n dispatch(initSplitSdk({ config: sdkBrowserConfig }) as unknown as ApplicationAction);\n dispatch(getTreatments({ splitNames: Object.values(SPLIT_FLAG) }) as unknown as ApplicationAction);\n };\n}\n","import { ActionName, ActionStatus, GlobalState, SPLIT_FLAG } from '../types';\nimport { ResponseError, ResponseErrorCode } from '../../apis';\nimport { ISplitTreatments } from '@splitsoftware/splitio-redux/lib/types';\n\nexport function isActionRequesting(requests: ActionStatus[], name: ActionName): boolean {\n const status = requests.find((el) => el.name === name);\n if (!status) return false;\n return status.isRequesting;\n}\n\nexport function getActionStatus(statuses: ActionStatus[], name: ActionName) {\n return statuses.find((el) => el.name === name);\n}\n\nexport function getResponseError(statuses: ActionStatus[], name: ActionName) {\n const status = getActionStatus(statuses, name);\n if (!status) return null;\n return status.responseError || null;\n}\n\nexport function isPropertyError(propertyName: string | null, error: ResponseError | null) {\n return (error && error.property === propertyName) || false;\n}\n\nexport interface GetErrorMessageOptions {\n transform?: (responseErrorCode: ResponseErrorCode) => string | undefined;\n}\n\nexport function getErrorMessage(error: ResponseError | null, options: GetErrorMessageOptions = {}) {\n if (!error) return null;\n\n if (options.transform) {\n const result = options.transform(error.code);\n if (result) {\n return result;\n }\n }\n\n switch (error.code) {\n case ResponseErrorCode.InvalidField:\n return error.message == null || error.message.length == 0 ? 'Value is not valid.' : error.message;\n case ResponseErrorCode.MissingField:\n return 'Value is required.';\n case ResponseErrorCode.ValueTaken:\n return 'Value is already taken.';\n default:\n return 'Something went wrong. Please try again.';\n }\n}\n\nexport function getErrorCode(error: ResponseError | null) {\n return error && error.code;\n}\n\nexport const getActionError = (name: ActionName, actions: ActionStatus[]) => {\n const action = getActionStatus(actions, name);\n return action ? action.responseError : undefined;\n};\n\nexport function getTitle(state: GlobalState): string {\n let result = (state.merchant && state.merchant.display_name) || 'Stronghold';\n const headerTitle = state.headerTitle;\n if (headerTitle.values.length > 0) {\n result = [...headerTitle.values, result].join(` ${headerTitle.separator} `);\n }\n return result;\n}\n\nexport function getPortalLink(merchantShortName: string, origin: string): string {\n origin = origin.replace('strongholdpay', 'onstrongholdpay');\n origin = origin.replace('://sandbox', `://${merchantShortName}-sandbox`);\n origin = origin.replace('://development', `://${merchantShortName}-development`);\n origin = origin.replace('://staging', `://${merchantShortName}-staging`);\n origin = origin.replace('://onstrongholdpay', `://${merchantShortName}.onstrongholdpay`);\n\n return origin;\n}\n\nexport function isMerchantRoute() {\n const regex = /\\/\\/(sandbox)?((-)?staging|(-)?development)?(\\.)?((on)?strongholdpay)/gm;\n\n return !window.location.origin.match(regex);\n}\n\n/**\n * This function set the default value for the flag\n * TODO: See if the return type is something else than a boolean, we could type the flags directly\n * @param name\n * @param flags\n */\nexport function getSplitFlagValue(name: SPLIT_FLAG, flags: ISplitTreatments): boolean {\n flags = flags || {};\n const formattedFlag = flags[SPLIT_FLAG.SIMPLE_CHECKOUT];\n const treatment = Object.values(formattedFlag)[0].treatment;\n switch (name) {\n case SPLIT_FLAG.SIMPLE_CHECKOUT:\n return treatment === 'on' ? true : false;\n default:\n throw new Error('Not implemented flag value');\n }\n}\n","import { TipType } from '../types';\n\nexport function amountToString(amount: number | null) {\n const value = ((amount || 0) / 100).toFixed(2);\n\n return `$${value}`;\n}\n\nexport function getTipAmount(tipType: TipType, tipValue: number, originalAmount: number) {\n // If fixed amount, return the value directly\n if (tipType === 'fixed') {\n return tipValue;\n }\n\n // Percent\n else if (tipType === 'percentage') {\n return Math.round((originalAmount * tipValue) / 10000);\n }\n\n throw new Error(`Tip type ${tipType} not implemented`);\n}\n\nexport function getAmountDetails(data: {\n subAmount: number;\n totalAmount: number;\n taxAmount: number;\n convenienceFee?: number;\n processingFee?: number;\n tipAmount?: number;\n tipType: TipType;\n creditValue?: number;\n}) {\n const {\n tipType,\n tipAmount = 0,\n convenienceFee = 0,\n processingFee = 0,\n taxAmount,\n totalAmount,\n subAmount,\n creditValue = 0,\n } = data;\n\n const totalAmountWithFees = totalAmount + convenienceFee;\n const fullAmount = totalAmountWithFees + tipAmount + processingFee - creditValue;\n\n return {\n totalAmount,\n taxAmount,\n convenienceFee,\n processingFee,\n subAmount,\n tipAmount,\n tipType,\n totalAmountWithFees,\n // Prevent charge amount going below zero\n fullAmount: fullAmount > 0 ? fullAmount : 0,\n creditValue: creditValue,\n };\n}\n","import moment from 'moment';\n\n// Date\nexport const formatDateTimeMinutes = (value: string | null) => (value ? moment(value).format('MMM DD h:mm a') : null);\nexport const formatDate = (value: string | null) => (value ? moment(value).format('MMM DD') : null);\n\n// Currency\nexport function formatAmount(amount: number | string) {\n const num = typeof amount === 'string' ? parseInt(amount) : amount;\n const value = ((num || 0) / 100).toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 });\n return `$${value}`;\n}\n\n// Bytes\nexport function formatKB(size: number) {\n return Math.round(size / 1024).toFixed(2);\n}\n","import { AuthenticationState } from '../types';\n\nexport function getFullName(authenticationState: AuthenticationState) {\n return `${authenticationState.customer.individual.first_name} ${authenticationState.customer.individual.last_name}`;\n}\n","import { CustomizationType, Customization } from '../types';\n\nexport function getCustomization(customizations: Customization[], type: CustomizationType) {\n const customization = customizations.find((el) => el.type === type);\n if (!customization) return null;\n return customization.data;\n}\n","import { ApplicationState } from '../index';\n\nexport enum CardType {\n Visa = 'visa',\n MasterCard = 'mastercard',\n AmericanExpress = 'amex',\n DinersClub = 'dinersclub',\n}\n\nexport function getPaymentSourceSelected(state: ApplicationState) {\n return state.paymentSources.arr.find((el) => el.id === state.paymentSources.paymentSourceSelected) || null;\n}\n\nexport function getTypeOfCard(provider: string): CardType | undefined {\n switch (provider.toLowerCase()) {\n case 'visa':\n return CardType.Visa;\n case 'mastercard':\n return CardType.MasterCard;\n case 'dinersclub':\n return CardType.DinersClub;\n case 'amex':\n return CardType.AmericanExpress;\n }\n}\n","import { PayLinkCallback } from '../types';\nimport querystring from 'querystring';\nimport url from 'url';\nimport { mapKeys } from 'lodash';\nimport { ApplicationState } from '../index';\n\nexport function getExitUrlCallback(state: ApplicationState) {\n if (!state.payLink.data) {\n return null;\n }\n const payLink = state.payLink.data;\n if (!payLink.callbacks || !payLink.callbacks.exit_url) {\n return null;\n }\n\n return getCallbackQuery(state, { callback: 'exit' });\n}\n\nexport function getSuccessUrlCallback(state: ApplicationState) {\n if (!state.payLink.data) {\n return null;\n }\n const payLink = state.payLink.data;\n if (!payLink.callbacks || !payLink.callbacks.exit_url || payLink.status === 'created') {\n return null;\n }\n\n return getCallbackQuery(state, { callback: 'success' });\n}\n\nexport function getCallbackQuery(state: ApplicationState, options: { callback: PayLinkCallback }) {\n if (!state.payLink.data) {\n throw new Error('No PayLink to get the callback query from.');\n }\n const payLink = state.payLink.data;\n\n if (!payLink.callbacks) {\n throw new Error('PayLink is not compatible with the callbacks feature.');\n }\n const callbacks = payLink.callbacks;\n\n const { callback } = options;\n let callbackUrl: string;\n\n let paymentSourceId: string | undefined;\n let chargeId: string | undefined;\n let tipId: string | undefined;\n if (callback === 'success') {\n callbackUrl = callbacks.success_url;\n paymentSourceId = state.paymentSources.paymentSourceSelected || undefined;\n chargeId = payLink.charge?.id;\n tipId = payLink.tip?.id;\n } else {\n callbackUrl = callbacks.exit_url;\n }\n\n const parsed = url.parse(callbackUrl);\n let result = `${parsed.protocol}//${parsed.host}${parsed.pathname}`;\n let merchantQuery = parsed.search ? querystring.parse(parsed.search.replace(/^(\\?)/i, '')) : {};\n merchantQuery = mapKeys(merchantQuery, (value, key) => `custom_${key}`);\n const obj = {\n ...merchantQuery,\n pay_link_id: payLink.id,\n pay_link_type: payLink.type,\n pay_link_callback: callback,\n payment_source_id: paymentSourceId,\n charge_id: chargeId,\n tip_id: tipId,\n };\n\n const query = querystring.stringify(obj);\n result += `?${query}`;\n return result;\n}\n","import * as global from './global';\nimport * as number from './number';\nimport * as format from './format';\nimport * as authentication from './authentication';\nimport * as customizations from './customizations';\nimport * as payLink from './payLink';\nimport * as paymentSources from './paymentSources';\n\nconst selectors = {\n global,\n number,\n authentication,\n customizations,\n format,\n payLink,\n paymentSources,\n};\n\nexport default selectors;\n","import { SET_INTEGRATION_ID, SET_API_VERSION } from '../constants';\n\nexport interface SetIntegrationIdAction {\n type: SET_INTEGRATION_ID;\n payload: {\n integrationId: string;\n };\n}\n\nexport const setIntegrationIdAction = (integrationId: string): SetIntegrationIdAction => ({\n type: SET_INTEGRATION_ID,\n payload: {\n integrationId: integrationId,\n },\n});\n\nexport interface SetApiVersionAction {\n type: SET_API_VERSION;\n payload: {\n apiVersion: string;\n };\n}\n\nexport const setApiVersionAction = (apiVersion: string): SetApiVersionAction => ({\n type: SET_API_VERSION,\n payload: {\n apiVersion: apiVersion,\n },\n});\n\nexport type AttributionAction = SetIntegrationIdAction | SetApiVersionAction;\n","export const SET_ACTION_REQUEST_STATUS = 'SET_ACTION_REQUEST_STATUS';\nexport type SET_ACTION_REQUEST_STATUS = typeof SET_ACTION_REQUEST_STATUS;\nexport const SET_ACTION_RESPONSE_ERROR = 'SET_ACTION_RESPONSE_ERROR';\nexport type SET_ACTION_RESPONSE_ERROR = typeof SET_ACTION_RESPONSE_ERROR;\nexport const SET_ERROR_MESSAGE = 'SET_ERROR_MESSAGE';\nexport type SET_ERROR_MESSAGE = typeof SET_ERROR_MESSAGE;\nexport const RESET_ACTION_STATUS = 'RESET_ACTION_STATUS';\nexport type RESET_ACTION_STATUS = typeof RESET_ACTION_STATUS;\nexport const SET_CONFIGURATION = 'SET_CONFIGURATION';\nexport type SET_CONFIGURATION = typeof SET_CONFIGURATION;\nexport const SET_CONFIGURATION_STATUS = 'SET_CONFIGURATION_STATUS';\nexport type SET_CONFIGURATION_STATUS = typeof SET_CONFIGURATION_STATUS;\nexport const UPDATE_HEADER_TITLE = 'UPDATE_HEADER_TITLE';\nexport type UPDATE_HEADER_TITLE = typeof UPDATE_HEADER_TITLE;\nexport const LOCATION_CHANGE = '@@router/LOCATION_CHANGE';\nexport type LOCATION_CHANGE = typeof LOCATION_CHANGE;\n\n// Authentication\nexport const SET_TOKEN = 'SET_TOKEN';\nexport type SET_TOKEN = typeof SET_TOKEN;\nexport const IS_AUTHENTICATED = 'IS_AUTHENTICATED';\nexport type IS_AUTHENTICATED = typeof IS_AUTHENTICATED;\nexport const UPDATE_CUSTOMER = 'UPDATE_CUSTOMER';\nexport type UPDATE_CUSTOMER = typeof UPDATE_CUSTOMER;\n\n// Payment sources\nexport const ADD_PAYMENT_SOURCE = 'ADD_PAYMENT_SOURCE';\nexport const SET_PAYMENT_SOURCES = 'SET_PAYMENT_SOURCES';\nexport const UPDATE_PAYMENT_SOURCE = 'UPDATE_PAYMENT_SOURCE';\nexport const REMOVE_PAYMENT_SOURCE = 'REMOVE_PAYMENT_SOURCE';\nexport const SELECT_PAYMENT_SOURCE = 'SELECT_PAYMENT_SOURCE';\nexport const IS_NEW_PAYMENT_SOURCE_LINKED = 'IS_NEW_PAYMENT_SOURCE_LINKED';\n\n// Pay Link\nexport const SET_PAY_LINK = 'SET_PAY_LINK';\nexport type SET_PAY_LINK = typeof SET_PAY_LINK;\nexport const UPDATE_PAY_LINK = 'UPDATE_PAY_LINK';\n\nexport const SET_PAY_LINK_CUSTOMER = 'SET_PAY_LINK_CUSTOMER';\nexport type SET_PAY_LINK_CUSTOMER = typeof SET_PAY_LINK_CUSTOMER;\n\n// Customer\nexport const SET_CUSTOMER_TOKEN = 'SET_CUSTOMER_TOKEN';\nexport type SET_CUSTOMER_TOKEN = typeof SET_CUSTOMER_TOKEN;\n\n// Charges\nexport const SET_CHARGES = 'SET_CHARGES';\nexport type SET_CHARGES = typeof SET_CHARGES;\nexport const CLEAN_CHARGES = 'CLEAN_CHARGES';\nexport type CLEAN_CHARGES = typeof CLEAN_CHARGES;\n\n// Credits\nexport const SET_CREDIT_VALUE = 'SET_CREDIT_VALUE';\nexport type SET_CREDIT_VALUE = typeof SET_CREDIT_VALUE;\n\n// Attribution\nexport const SET_INTEGRATION_ID = 'SET_INTEGRATION_ID';\nexport type SET_INTEGRATION_ID = typeof SET_INTEGRATION_ID;\nexport const SET_API_VERSION = 'SET_API_VERSION';\nexport type SET_API_VERSION = typeof SET_API_VERSION;\n","import { IS_AUTHENTICATED, SET_TOKEN, UPDATE_CUSTOMER } from '../constants';\nimport { AppThunkAction } from '../index';\nimport {\n ApplicationAction,\n fetchChargesAction,\n resetActionStatusAction,\n setActionRequestingAction,\n setActionResponseErrorAction,\n setCreditValueAction,\n setErrorMessageAction,\n setPayLinkAction,\n setPaymentSourcesAction,\n} from './index';\nimport * as api from '../../apis';\nimport { AuthenticationMethod, CustomerModel, LoginResponseModel, ResponseError, ResponseErrorCode } from '../../apis';\nimport { DeepPartial } from 'redux';\nimport { fetchMerchantTreatmentsAction } from './splitio';\nimport { SPLIT_FLAG } from '../types';\nimport selectors from '../selectors';\nimport { setApiVersionAction, setIntegrationIdAction } from './attribution';\n\n// -----------------\n// ACTIONS - These are serializable (hence replayable) descriptions of state transitions.\n// They do not themselves have any side-effects; they just describe something that is going to happen.\n\ninterface IsAuthenticatedAction {\n type: IS_AUTHENTICATED;\n payload: {\n isAuthenticated: boolean;\n };\n}\n\nexport function isAuthenticatedAction(isAuthenticated: boolean): IsAuthenticatedAction {\n return {\n type: IS_AUTHENTICATED,\n payload: { isAuthenticated },\n };\n}\n\ninterface SetTokenAction {\n type: SET_TOKEN;\n payload: {\n token: string | null;\n };\n}\n\nexport function setTokenAction(token: string | null = null, save = true): SetTokenAction {\n if (save) {\n if (!!token) {\n localStorage.setItem('token', token);\n } else {\n localStorage.removeItem('token');\n }\n }\n\n return {\n type: SET_TOKEN,\n payload: { token },\n };\n}\n\ninterface UpdateCustomerAction {\n type: UPDATE_CUSTOMER;\n payload: {\n customer: DeepPartial;\n };\n}\n\nexport function updateCustomerAction(customer: DeepPartial): UpdateCustomerAction {\n return {\n type: UPDATE_CUSTOMER,\n payload: { customer },\n };\n}\n\n// Declare a 'discriminated union' type. This guarantees that all references to 'type' properties contain one of the\n// declared type strings (and not any other arbitrary string).\nexport type AuthenticationAction = IsAuthenticatedAction | SetTokenAction | UpdateCustomerAction;\n\n// ----------------\n// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.\n// They don't directly mutate state, but they can have external side-effects (such as loading data).\n\nconst waitForSplits = () => {\n return new Promise((resolve) => {\n setTimeout(() => resolve(), 200);\n });\n};\n\nexport function loginAction(\n authentication: AuthenticationMethod,\n username: string,\n merchant_short_name?: string,\n): AppThunkAction {\n return async (dispatch, getState) => {\n if (getState().authentication.isAuthenticated) {\n return;\n }\n\n dispatch(resetActionStatusAction('login'));\n dispatch(setActionRequestingAction('login', true));\n\n let result: LoginResponseModel;\n let showSimpleWorkflow;\n try {\n // fetch merchant as we need an identifier to send to split to retrieve feature flags\n const merchant = await api.fetchMerchant(username);\n if (merchant) {\n dispatch(fetchMerchantTreatmentsAction(merchant) as unknown as ApplicationAction);\n }\n // allow split treatments to load\n await waitForSplits();\n const loadedSplits = getState().splitio.treatments;\n showSimpleWorkflow = selectors.global.getSplitFlagValue(SPLIT_FLAG.SIMPLE_CHECKOUT, loadedSplits);\n } catch (e) {\n // Login action should continue despite failure to retrieve SIMPLE_CHECKOUT split settings\n }\n\n try {\n result = await api.login({\n authentication: {\n method: authentication,\n },\n username,\n with_order_items: !showSimpleWorkflow,\n merchant_short_name,\n });\n } catch (e) {\n if (e instanceof ResponseError) {\n e.property = e.property && e.property.replace('customer.', '');\n dispatch(setActionResponseErrorAction('login', e));\n\n if (authentication === 'link') {\n // Handle link availability errors\n if (e.code === ResponseErrorCode.PayLinkExpired) {\n dispatch(setErrorMessageAction(ResponseErrorCode.PayLinkExpired));\n } else if (e.code === ResponseErrorCode.PayLinkCanceled) {\n dispatch(setErrorMessageAction(ResponseErrorCode.PayLinkCanceled));\n } else if (e.code === ResponseErrorCode.MerchantSoftwareError) {\n dispatch(setErrorMessageAction(ResponseErrorCode.MerchantSoftwareError));\n } else if (e.code === ResponseErrorCode.PaylinkChargeAmountModified) {\n dispatch(setErrorMessageAction(ResponseErrorCode.PaylinkChargeAmountModified));\n } else if (e.code === ResponseErrorCode.NotFound) {\n dispatch(setErrorMessageAction(ResponseErrorCode.NotFound));\n } else if (e.code === ResponseErrorCode.InvalidApiKey) {\n dispatch(setErrorMessageAction(ResponseErrorCode.InvalidApiKey));\n } else if (e.code === ResponseErrorCode.LiveNotApproved) {\n dispatch(setErrorMessageAction(ResponseErrorCode.LiveNotApproved));\n } else if (e.code === ResponseErrorCode.InvalidChargeStatus) {\n dispatch(setErrorMessageAction(ResponseErrorCode.InvalidChargeStatus));\n } else if (e.code === ResponseErrorCode.PayLinkMissingCharge) {\n dispatch(setErrorMessageAction(ResponseErrorCode.PayLinkMissingCharge));\n } else if (e.code === ResponseErrorCode.PayLinkMissingOrder) {\n dispatch(setErrorMessageAction(ResponseErrorCode.PayLinkMissingOrder));\n } else {\n dispatch(setErrorMessageAction(ResponseErrorCode.ServerError));\n }\n }\n }\n dispatch(setActionRequestingAction('login', false));\n throw e;\n }\n let integrationId;\n if (result.link) {\n integrationId = result.link.integration_id;\n dispatch(setPayLinkAction(result.link));\n dispatch(setApiVersionAction('v' + result.link.version));\n if (!result.link.customer) {\n dispatch(setActionRequestingAction('login', false));\n throw ResponseErrorCode.CustomerRequired;\n } else {\n // Is authenticated directly if login using link only\n dispatch(isAuthenticatedAction(true));\n }\n } else {\n integrationId = getState().global.configuration.integration_id;\n dispatch(setApiVersionAction(getState().global.configuration.api_version));\n }\n\n dispatch(setTokenAction(result.token));\n dispatch(updateCustomerAction(result.customer));\n dispatch(setPaymentSourcesAction(result.customer.payment_sources.filter((s) => s.active) || []));\n dispatch(setCreditValueAction(result.link?.available_credit || 0));\n dispatch(setIntegrationIdAction(integrationId));\n\n // If authentication not link, we fetch the charges as well\n if (authentication !== 'link') {\n await fetchChargesAction()(dispatch, getState);\n }\n\n dispatch(setActionRequestingAction('login', false));\n };\n}\n\nexport function resendTokenAction(\n mobile: string,\n email: string,\n authMethod: AuthenticationMethod,\n): AppThunkAction {\n return async (dispatch) => {\n dispatch(resetActionStatusAction('verify'));\n dispatch(setActionRequestingAction('verify', true));\n dispatch(setTokenAction(null));\n let error: Error | null = null;\n\n try {\n const result = await api.resendVerificationToken({\n authentication: { method: authMethod },\n customer: { individual: { mobile, email } },\n });\n dispatch(setTokenAction(result.token));\n } catch (e) {\n const responseError = e as ResponseError;\n responseError.property = responseError.property && responseError.property.replace('customer.', '');\n dispatch(setActionResponseErrorAction('verify', responseError));\n error = responseError;\n } finally {\n dispatch(setActionRequestingAction('verify', false));\n }\n if (error) {\n throw error;\n }\n };\n}\n\nexport function signupAction(\n first_name: string,\n last_name: string,\n date_of_birth: string,\n mobile: string,\n email: string,\n method: AuthenticationMethod,\n merchant_short_name?: string,\n): AppThunkAction {\n return async (dispatch) => {\n dispatch(resetActionStatusAction('signup'));\n dispatch(setActionRequestingAction('signup', true));\n\n let error: Error | null = null;\n\n try {\n const result = await api.signup({\n authentication: { method },\n customer: {\n individual: { first_name, last_name, date_of_birth, mobile, email },\n },\n merchant_short_name,\n });\n dispatch(updateCustomerAction(result.customer));\n dispatch(setTokenAction(result.token));\n } catch (e) {\n if (e instanceof ResponseError) {\n e.property = e.property && e.property.replace('customer.', '');\n dispatch(setActionResponseErrorAction('signup', e));\n }\n error = e;\n } finally {\n dispatch(setActionRequestingAction('signup', false));\n }\n if (error) {\n throw error;\n }\n };\n}\n\nexport function verifyAction(code: string): AppThunkAction {\n return async (dispatch, getState) => {\n dispatch(resetActionStatusAction('verify'));\n dispatch(setActionRequestingAction('verify', true));\n\n const token = getState().authentication.token || '';\n\n let error: Error | null = null;\n\n try {\n const result = await api.verify({ code, token });\n dispatch(setTokenAction(result.token));\n } catch (e) {\n if (e instanceof ResponseError) {\n dispatch(setActionResponseErrorAction('verify', e));\n }\n error = e;\n } finally {\n dispatch(setActionRequestingAction('verify', false));\n }\n\n if (error) {\n throw error;\n }\n };\n}\n\nexport function fetchProfileAction(): AppThunkAction {\n return async (dispatch, getState) => {\n // If authenticated, return directly\n if (getState().authentication.isAuthenticated) {\n return;\n }\n\n // Check existing token\n const token = localStorage.getItem('token');\n // If no token present, we dont try to authenticate\n if (!token) {\n return;\n }\n\n dispatch(setActionRequestingAction('authenticate', true));\n\n let error: Error | null = null;\n try {\n const result = await api.fetchProfile();\n dispatch(isAuthenticatedAction(true));\n dispatch(updateCustomerAction(result.customer));\n dispatch(setPaymentSourcesAction(result.customer.payment_sources.filter((s) => s.active) || []));\n\n // We fetch the charges as well\n await fetchChargesAction()(dispatch, getState);\n } catch (e) {\n error = e;\n localStorage.removeItem('token');\n } finally {\n dispatch(setActionRequestingAction('authenticate', false));\n }\n if (error) {\n throw error;\n }\n };\n}\n\nexport function logoutAction(): AppThunkAction {\n return async (dispatch) => {\n dispatch(isAuthenticatedAction(false));\n dispatch(setTokenAction(null));\n };\n}\n","import { merge } from 'lodash';\nimport * as Stronghold from '@stronghold/pay-dropin';\nimport * as Sentry from '@sentry/browser';\nimport { ConfigurationModel } from './apis';\n\nexport const FORMAT_DATE = 'YYYY-MM-DD';\n\n// Open ID authentication\nexport const configuration: ConfigurationModel = {\n api_environment: 'live',\n environment: 'development',\n stronghold_pay_host: '',\n sentry_dsn: '',\n analytics: {\n environment: 'Development',\n },\n split: {\n api_key: '',\n },\n integration_id: '',\n api_version: 'v2',\n};\n\nexport function setConfiguration(newConfiguration: ConfigurationModel) {\n merge(configuration, newConfiguration);\n\n if (configuration.sentry_dsn) {\n Sentry.init({\n dsn: configuration.sentry_dsn,\n environment: configuration.environment,\n });\n }\n}\n\nexport function getStrongholdPayClient(\n publishableKey: string,\n environment: Stronghold.ENVIRONMENT,\n apiVersion: string,\n integrationId?: string,\n) {\n return Stronghold.Pay({\n environment,\n host: configuration.stronghold_pay_host,\n publishableKey: publishableKey || '',\n integrationId: integrationId,\n apiVersion: apiVersion,\n });\n}\n\n// Router\nexport const ROUTE = {\n HOME: '/',\n LOGIN: '/login',\n LOGIN_CODE: '/login/code',\n SIGN_UP: '/signup',\n LOGOUT: '/logout',\n LINK_ACCOUNT: '/link-account',\n PROFILES: '/profiles',\n PAYMENT_SOURCES: '/payment-sources',\n SUPPORT: '/support',\n LINK: '/l/:code?',\n};\n","import { ActionName, ConfigurationStatus, HeaderTitle } from '../types';\nimport {\n RESET_ACTION_STATUS,\n SET_ACTION_REQUEST_STATUS,\n SET_ACTION_RESPONSE_ERROR,\n SET_CONFIGURATION,\n SET_CONFIGURATION_STATUS,\n SET_ERROR_MESSAGE,\n UPDATE_HEADER_TITLE,\n} from '../constants';\nimport { AppThunkAction } from '../index';\nimport { ApplicationAction } from './index';\nimport { setConfiguration } from '../../config';\nimport { ConfigurationModel, getConfiguration, ResponseErrorCode } from '../../apis';\nimport { ResponseError } from '../../apis';\nimport { LocationChangeAction } from 'connected-react-router';\n\n// -----------------\n// ACTIONS - These are serializable (hence replayable) descriptions of state transitions.\n// They do not themselves have any side-effects; they just describe something that is going to happen.\n\nexport interface SetActionRequestingAction {\n type: SET_ACTION_REQUEST_STATUS;\n payload: {\n name: ActionName;\n isRequesting: boolean;\n };\n}\n\nexport function setActionRequestingAction(name: ActionName, isRequesting: boolean): SetActionRequestingAction {\n return {\n type: SET_ACTION_REQUEST_STATUS,\n payload: {\n name,\n isRequesting,\n },\n };\n}\n\nexport interface SetActionResponseErrorAction {\n type: SET_ACTION_RESPONSE_ERROR;\n payload: {\n name: ActionName;\n error: ResponseError;\n };\n}\n\nexport function setActionResponseErrorAction(name: ActionName, error: ResponseError): SetActionResponseErrorAction {\n return {\n type: SET_ACTION_RESPONSE_ERROR,\n payload: {\n name,\n error,\n },\n };\n}\n\nexport interface SetErrorMessageAction {\n type: SET_ERROR_MESSAGE;\n payload: {\n errorCode: ResponseErrorCode;\n };\n}\n\nexport function setErrorMessageAction(errorCode: ResponseErrorCode = ResponseErrorCode.Unknown): SetErrorMessageAction {\n return {\n type: SET_ERROR_MESSAGE,\n payload: {\n errorCode,\n },\n };\n}\n\nexport interface ResetActionStatusAction {\n type: RESET_ACTION_STATUS;\n payload: {\n name: ActionName;\n };\n}\n\nexport function resetActionStatusAction(name: ActionName): ResetActionStatusAction {\n return {\n type: RESET_ACTION_STATUS,\n payload: {\n name,\n },\n };\n}\n\nexport interface SetConfigurationAction {\n type: SET_CONFIGURATION;\n payload: {\n configuration: ConfigurationModel;\n };\n}\n\nexport function setConfigurationAction(configuration: ConfigurationModel): SetConfigurationAction {\n return {\n type: SET_CONFIGURATION,\n payload: {\n configuration,\n },\n };\n}\n\nexport interface SetConfigurationStatusAction {\n type: SET_CONFIGURATION_STATUS;\n payload: { status: ConfigurationStatus };\n}\n\nexport function setConfigurationStatusAction(status: ConfigurationStatus): SetConfigurationStatusAction {\n return {\n type: SET_CONFIGURATION_STATUS,\n payload: { status },\n };\n}\n\nexport interface UpdateHeaderTitleAction {\n type: UPDATE_HEADER_TITLE;\n payload: {\n headerPartial: Partial;\n };\n}\n\nexport function updateHeaderTitleAction(headerPartial: Partial): UpdateHeaderTitleAction {\n return {\n type: UPDATE_HEADER_TITLE,\n payload: {\n headerPartial,\n },\n };\n}\n\n// Declare a 'discriminated union' type. This guarantees that all references to 'type' properties contain one of the\n// declared type strings (and not any other arbitrary string).\nexport type GlobalAction =\n | SetActionRequestingAction\n | SetActionResponseErrorAction\n | ResetActionStatusAction\n | SetConfigurationAction\n | SetConfigurationStatusAction\n | SetErrorMessageAction\n | UpdateHeaderTitleAction\n | LocationChangeAction;\n\n// ----------------\n// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.\n// They don't directly mutate state, but they can have external side-effects (such as loading data).\n\nexport function fetchConfiguration(): AppThunkAction {\n return async (dispatch) => {\n dispatch(setActionRequestingAction('fetch_configuration', true));\n try {\n const result = await getConfiguration();\n\n setConfiguration(result);\n dispatch(setConfigurationAction(result));\n } catch (e) {\n dispatch(setConfigurationStatusAction('error'));\n dispatch(setErrorMessageAction());\n }\n\n dispatch(setActionRequestingAction('fetch_configuration', false));\n };\n}\n","import * as api from '../../apis';\nimport { SET_CUSTOMER_TOKEN } from '../constants';\nimport { setActionRequestingAction } from './global';\nimport { AppThunkAction } from '../index';\nimport { ApplicationAction } from './index';\n\n// -----------------\n// ACTIONS - These are serializable (hence replayable) descriptions of state transitions.\n// They do not themselves have any side-effects; they just describe something that is going to happen.\n\nexport interface SetCustomerTokenAction {\n type: SET_CUSTOMER_TOKEN;\n payload: {\n token: string | null;\n };\n}\n\nexport const setCustomerTokenAction = (token: string | null): SetCustomerTokenAction => ({\n type: SET_CUSTOMER_TOKEN,\n payload: {\n token,\n },\n});\n\n// Declare a 'discriminated union' type. This guarantees that all references to 'type' properties contain one of the\n// declared type strings (and not any other arbitrary string).\nexport type CustomerAction = SetCustomerTokenAction;\n\n// ----------------\n// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.\n// They don't directly mutate state, but they can have external side-effects (such as loading data).\n\nexport function fetchCustomerTokenAction(): AppThunkAction {\n return async (dispatch) => {\n await dispatch(setActionRequestingAction('fetch_customer_token', true));\n try {\n const result = await api.getCustomerToken();\n await dispatch(setCustomerTokenAction(result.token));\n await dispatch(setActionRequestingAction('fetch_customer_token', false));\n } catch (e) {\n dispatch(setActionRequestingAction('fetch_customer_token', false));\n throw e;\n }\n };\n}\n","import { SET_PAY_LINK, UPDATE_PAY_LINK } from '../constants';\nimport { PayLinkModel } from '../../apis';\nimport { DeepPartial } from 'redux';\nimport { AppThunkAction } from '../index';\nimport { ApplicationAction, setActionRequestingAction } from './index';\nimport * as api from '../../apis';\n\n// -----------------\n// ACTIONS - These are serializable (hence replayable) descriptions of state transitions.\n// They do not themselves have any side-effects; they just describe something that is going to happen.\n\nexport interface SetPayLinkAction {\n type: SET_PAY_LINK;\n payload: {\n link: PayLinkModel;\n };\n}\n\nexport const setPayLinkAction = (link: PayLinkModel): SetPayLinkAction => ({\n type: SET_PAY_LINK,\n payload: {\n link,\n },\n});\n\nexport interface UpdatePayLinkAction {\n type: typeof UPDATE_PAY_LINK;\n payload: { payLink: DeepPartial };\n}\n\nexport const updatePayLinkAction = (payLink: DeepPartial): UpdatePayLinkAction => ({\n type: UPDATE_PAY_LINK,\n payload: { payLink },\n});\n\nexport function setPayLinkCustomerAction(payLinkId: string, customerId: string): AppThunkAction {\n return async (dispatch) => {\n await dispatch(setActionRequestingAction('set_pay_link_customer', true));\n try {\n await api.addCustomer(payLinkId, customerId);\n await dispatch(setActionRequestingAction('set_pay_link_customer', false));\n } catch (e) {\n dispatch(setActionRequestingAction('set_pay_link_customer', false));\n throw e;\n }\n };\n}\n\n// Declare a 'discriminated union' type. This guarantees that all references to 'type' properties contain one of the\n// declared type strings (and not any other arbitrary string).\nexport type PayLinkAction = SetPayLinkAction | UpdatePayLinkAction;\n\n// ----------------\n// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.\n// They don't directly mutate state, but they can have external side-effects (such as loading data).\n","import * as api from '../../apis';\nimport { ChargeModel, ListSegment, ResponseError } from '../../apis';\nimport { CLEAN_CHARGES, SET_CHARGES } from '../constants';\nimport { setActionRequestingAction, setActionResponseErrorAction } from './global';\nimport { AppThunkAction } from '../index';\nimport { ApplicationAction } from './index';\n\n// -----------------\n// ACTIONS - These are serializable (hence replayable) descriptions of state transitions.\n// They do not themselves have any side-effects; they just describe something that is going to happen.\n\nexport interface SetChargesAction {\n type: SET_CHARGES;\n payload: {\n list: ListSegment;\n };\n}\n\nexport const setChargesAction = (list: ListSegment): SetChargesAction => ({\n type: SET_CHARGES,\n payload: {\n list,\n },\n});\n\nexport interface CleanChargesAction {\n type: CLEAN_CHARGES;\n}\n\nexport const cleanChargesAction = (): CleanChargesAction => ({\n type: CLEAN_CHARGES,\n});\n\n// Declare a 'discriminated union' type. This guarantees that all references to 'type' properties contain one of the\n// declared type strings (and not any other arbitrary string).\nexport type ChargeAction = SetChargesAction | CleanChargesAction;\n\n// ----------------\n// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.\n// They don't directly mutate state, but they can have external side-effects (such as loading data).\nexport interface FetchChargesActionOptions {\n search?: string;\n settlementId?: string;\n skip?: number;\n limit?: number;\n status?: string[];\n from?: string;\n to?: string;\n}\n\nexport function fetchChargesAction(options: FetchChargesActionOptions = {}): AppThunkAction {\n return async (dispatch, getState) => {\n const customerId = getState().authentication.customer.id;\n if (!customerId) return;\n\n await dispatch(setActionRequestingAction('fetch_charges', true));\n\n try {\n const body = await api.listCharges(options);\n await dispatch(setChargesAction(body));\n } catch (e) {\n if (e instanceof ResponseError) {\n dispatch(setActionResponseErrorAction('fetch_charges', e));\n }\n } finally {\n await dispatch(setActionRequestingAction('fetch_charges', false));\n }\n };\n}\n","import * as api from '../../apis';\nimport {\n ADD_PAYMENT_SOURCE,\n REMOVE_PAYMENT_SOURCE,\n SELECT_PAYMENT_SOURCE,\n SET_PAYMENT_SOURCES,\n UPDATE_PAYMENT_SOURCE,\n IS_NEW_PAYMENT_SOURCE_LINKED,\n} from '../constants';\nimport { setActionRequestingAction, setActionResponseErrorAction } from './global';\nimport { AppThunkAction } from '../index';\nimport { ApplicationAction } from './index';\nimport { ResponseError } from '../../apis';\nimport { PaymentSource } from '@stronghold/pay-dropin';\n\n// -----------------\n// ACTIONS - These are serializable (hence replayable) descriptions of state transitions.\n// They do not themselves have any side-effects; they just describe something that is going to happen.\n\nexport interface SetPaymentSourcesAction {\n type: typeof SET_PAYMENT_SOURCES;\n payload: {\n arr: PaymentSource[];\n };\n}\n\nexport const setPaymentSourcesAction = (arr: PaymentSource[]): SetPaymentSourcesAction => ({\n type: SET_PAYMENT_SOURCES,\n payload: {\n arr,\n },\n});\n\nexport interface AddPaymentSourceAction {\n type: typeof ADD_PAYMENT_SOURCE;\n payload: {\n data: PaymentSource;\n };\n}\n\nexport const addPaymentSourceAction = (data: PaymentSource): AddPaymentSourceAction => ({\n type: ADD_PAYMENT_SOURCE,\n payload: {\n data,\n },\n});\n\nexport interface UpdatePaymentSourceAction {\n type: typeof UPDATE_PAYMENT_SOURCE;\n payload: {\n data: PaymentSource;\n };\n}\n\nexport const updatePaymentSourceAction = (data: PaymentSource): UpdatePaymentSourceAction => ({\n type: UPDATE_PAYMENT_SOURCE,\n payload: {\n data,\n },\n});\n\nexport interface RemovePaymentSourceAction {\n type: typeof REMOVE_PAYMENT_SOURCE;\n payload: {\n paymentSourceId: string;\n };\n}\n\nexport const removePaymentSourceAction = (paymentSourceId: string): RemovePaymentSourceAction => ({\n type: REMOVE_PAYMENT_SOURCE,\n payload: { paymentSourceId },\n});\n\nexport interface SelectPaymentSourceAction {\n type: typeof SELECT_PAYMENT_SOURCE;\n payload: { paymentSourceId: string };\n}\n\nexport const selectPaymentSourceAction = (paymentSourceId: string): SelectPaymentSourceAction => ({\n type: SELECT_PAYMENT_SOURCE,\n payload: { paymentSourceId },\n});\n\n// Declare a 'discriminated union' type. This guarantees that all references to 'type' properties contain one of the\n// declared type strings (and not any other arbitrary string).\nexport type PaymentSourcesAction =\n | SetPaymentSourcesAction\n | AddPaymentSourceAction\n | UpdatePaymentSourceAction\n | RemovePaymentSourceAction\n | SelectPaymentSourceAction\n | IsNewPaymentSourceLinkedAction;\n\n// ----------------\n// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.\n// They don't directly mutate state, but they can have external side-effects (such as loading data).\n\nexport interface FetchPaymentSourcesActionOptions {\n customerId?: string;\n active?: boolean;\n}\n\nexport function deactivatePaymentSourceAction(sourceId: string): AppThunkAction {\n return async (dispatch) => {\n await dispatch(setActionRequestingAction('update_payment_source', true));\n try {\n const result = await api.deactivatePaymentSource(sourceId);\n await dispatch(updatePaymentSourceAction(result));\n } catch (e) {\n if (e instanceof ResponseError) {\n dispatch(setActionResponseErrorAction('update_payment_source', e));\n }\n throw e;\n } finally {\n await dispatch(setActionRequestingAction('update_payment_source', false));\n }\n };\n}\n\nexport function fetchPaymentSourcesAction(): AppThunkAction {\n return async (dispatch) => {\n await dispatch(setActionRequestingAction('fetch_payment_sources', true));\n try {\n const result = await api.fetchPaymentSources();\n await dispatch(setPaymentSourcesAction(result.items));\n } catch (e) {\n if (e instanceof ResponseError) {\n dispatch(setActionResponseErrorAction('fetch_payment_sources', e));\n }\n } finally {\n await dispatch(setActionRequestingAction('fetch_payment_sources', false));\n }\n };\n}\n\ninterface IsNewPaymentSourceLinkedAction {\n type: typeof IS_NEW_PAYMENT_SOURCE_LINKED;\n payload: {\n isNewPaymentSourceLinked: boolean;\n };\n}\n\nexport function isNewPaymentSourceLinkedAction(isNewPaymentSourceLinked: boolean): IsNewPaymentSourceLinkedAction {\n return {\n type: IS_NEW_PAYMENT_SOURCE_LINKED,\n payload: { isNewPaymentSourceLinked },\n };\n}\n","import { SET_CREDIT_VALUE } from '../constants';\n\nexport interface SetCreditValueAction {\n type: SET_CREDIT_VALUE;\n payload: {\n creditValue: number;\n };\n}\n\nexport const setCreditValueAction = (creditValue: number): SetCreditValueAction => ({\n type: SET_CREDIT_VALUE,\n payload: {\n creditValue: creditValue,\n },\n});\n\nexport type CreditAction = SetCreditValueAction;\n","import 'react';\nimport * as React from 'react';\nimport { Redirect, Route, RouteComponentProps, RouteProps, withRouter } from 'react-router-dom';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../store';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { fetchProfileAction } from '../store/actions';\nimport { ROUTE } from '../config';\nimport selectors from '../store/selectors';\n\ninterface StateProps {\n isAuthenticated: boolean;\n hasPaymentSource: boolean;\n hasCharge: boolean;\n}\n\ntype OwnProps = RouteComponentProps &\n RouteProps & {\n authenticate: boolean;\n allowUnauthenticated?: boolean;\n paymentSourceRequired?: boolean;\n isMerchantRoute?: boolean;\n };\n\ninterface DispatchProps {\n fetchProfileAction: typeof fetchProfileAction;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\ntype State = {\n ready: boolean;\n};\n\nclass PortalRoute extends React.PureComponent {\n public state: State = {\n ready: false,\n };\n\n async componentDidMount() {\n try {\n if (this.props.authenticate) {\n await this.props.fetchProfileAction();\n }\n } catch {\n // Error\n } finally {\n this.setState({ ready: true });\n }\n }\n\n public render() {\n const {\n isAuthenticated,\n authenticate,\n allowUnauthenticated = false,\n isMerchantRoute = false,\n hasPaymentSource,\n hasCharge,\n paymentSourceRequired = false,\n } = this.props;\n const { ready } = this.state;\n if (!ready) {\n return null;\n }\n\n // If authentication asked and mandatory and the user is not authenticated\n // We redirect to the login page\n if (authenticate && !allowUnauthenticated && !isAuthenticated) {\n return ;\n }\n\n // If the payment sources are required and the customer do not have a payment source\n // We redirect to the link account page\n if (isAuthenticated && !hasPaymentSource && paymentSourceRequired && !hasCharge) {\n return ;\n }\n\n if (isMerchantRoute && !selectors.global.isMerchantRoute()) {\n window.location.href = 'https://strongholdpay.com';\n return null;\n }\n\n return ;\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n isAuthenticated: state.authentication.isAuthenticated,\n hasPaymentSource: state.paymentSources.arr.length > 0,\n hasCharge: state.charge.list.items.length > 0,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n fetchProfileAction,\n },\n dispatch,\n );\n\nexport default withRouter(connect(mapStateToProps, mapDispatchToProps)(PortalRoute));\n","const MESSAGE = {\n ERROR_COMMON_TITLE: 'Sorry, something went wrong',\n ERROR_COMMON: 'We weren’t able to process your request. Please go back and try again later.',\n CANCELED_LINK_TITLE: 'Canceled Link',\n CANCELED_LINK:\n 'This link to pay is no longer active. Please contact the merchant for another way to make your payment.',\n ORDER_NOT_FOUND_TITLE: 'Page Not Found',\n ORDER_NOT_FOUND: `We had a problem finding the associated page. Please try again in a few minutes.`,\n ORDER_AMOUNT_MODIFIED_TITLE: 'Order Total has changed',\n ORDER_AMOUNT_MODIFIED:\n \"Your order total has changed. Please reload and make sure you're aware of the changes before completing your order.\",\n EXPIRED_LINK_TITLE: 'Expired Link',\n EXPIRED_LINK_SUB_TITLE: 'The link has expired and can no longer be used.',\n EXPIRED_LINK: 'Please call the merchant and ask them to send you a new link.',\n PAYMENT_METHOD_SELECT_TITLE: 'Select a payment method',\n PAYMENT_METHOD_CHANGE: 'Change your payment method',\n PAYMENT_METHOD_NONE: 'In order to complete a payment, you must securely link a payment method.',\n PAYMENT_METHOD_NEEDED: 'You need to select an account to complete your payment.',\n ERROR_MERCHANT_SOFTWARE_TITLE: 'Merchant Software Error',\n ERROR_MERCHANT_SOFTWARE:\n 'We are unable to process your payment due to an error with the software the merchant uses.',\n ERROR_INVALID_CONFIGURATION_TITLE: 'Configuration problem',\n ERROR_INVALID_CONFIGURATION:\n 'Oops, it looks like the Portal configuration is wrong. Please check the credentials used.',\n ERROR_LIVE_NOT_APPROVED_TITLE: 'Live approval required',\n ERROR_LIVE_NOT_APPROVED:\n \"Your Stronghold account has not been fully approved. Please use test credentials or contact Stronghold's onboarding team.\",\n ERROR_USERNAME_NOT_FOUNT: (identifier?: 'mobile' | 'email') =>\n `We couldn't find any payments made with this ${identifier || 'identifier'}.`,\n ERROR_INCORRECT_CODE: 'Incorrect code.',\n CHECK_AND_TRY_AGAIN: 'Please check and try again.',\n SELECT_OR_ADD_TIP: 'Choose a suggested tip amount or add a custom amount:',\n INVALID_CHARGE_STATUS_TITLE: 'Charge Status Error',\n INVALID_CHARGE_STATUS:\n 'The charge associated with this link is not in a payable state so we have canceled this link. Please contact the merchant for another way to make your payment.',\n};\n\nexport default MESSAGE;\n","import * as React from 'react';\nimport selectors from '../store/selectors';\nimport { ResponseError, ResponseErrorCode } from '../apis';\nimport BsFormFeedback from 'reactstrap/lib/FormFeedback';\nimport MESSAGE from '../message';\nimport { GetErrorMessageOptions } from '../store/selectors/global';\n\ninterface Props {\n error?: ResponseError | null;\n options?: GetErrorMessageOptions;\n data?: {\n identifier?: 'mobile' | 'email';\n };\n}\n\nexport default function FormFeedback(props: Props) {\n const { error, options, data = {} } = props;\n\n if (!error) {\n return null;\n }\n\n let message = {selectors.global.getErrorMessage(error, options)};\n\n if (selectors.global.getErrorCode(error) === ResponseErrorCode.InvalidCredentials) {\n message = (\n \n {MESSAGE.ERROR_USERNAME_NOT_FOUNT(data.identifier)} {MESSAGE.CHECK_AND_TRY_AGAIN}\n \n );\n }\n\n return {message};\n}\n","import * as React from 'react';\nimport { FormEvent } from 'react';\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap';\nimport Spinner from 'reactstrap/lib/Spinner';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faLongArrowAltRight } from '@fortawesome/free-solid-svg-icons/faLongArrowAltRight';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../store';\nimport selectors from '../store/selectors';\nimport { AuthenticationMethod, ResponseError, ResponseErrorCode } from '../apis';\nimport { verifyAction } from '../store/actions';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport MaskedInput from 'react-text-mask';\nimport FormFeedback from './FormFeedback';\nimport FormGroup from 'reactstrap/lib/FormGroup';\nimport Form from 'reactstrap/lib/Form';\nimport MESSAGE from '../message';\n\ninterface StateProps {\n isRequesting: boolean;\n error: ResponseError | null;\n}\n\ntype OwnProps = {\n show: boolean;\n authenticationMethod: AuthenticationMethod;\n value: string;\n isResending: boolean;\n onClose: () => void;\n onResend: () => void;\n onSuccess?: () => void;\n};\n\ninterface DispatchProps {\n verify: typeof verifyAction;\n}\n\ntype Props = OwnProps & StateProps & DispatchProps;\n\ntype State = {\n code: string;\n};\n\nclass VerificationCodeModal extends React.Component {\n public state: State = {\n code: '',\n };\n\n onToggle = () => {\n this.props.onClose();\n };\n\n onSubmit = async (event: FormEvent) => {\n event.preventDefault();\n try {\n await this.props.verify(this.state.code);\n if (this.props.onSuccess) {\n this.props.onSuccess();\n }\n } catch {\n // Error\n }\n };\n\n render() {\n const { show, isRequesting, error, isResending } = this.props;\n\n return (\n \n
\n Verification\n \n

\n Enter the verification code sent to {this.props.value}.\n

\n \n {this.props.show ? (\n this.setState({ code: e.currentTarget.value })}\n ref={(input) => {\n setTimeout(() => {\n if (input && input.inputElement) {\n input.inputElement.focus();\n }\n }, 500);\n }}\n />\n ) : null}\n {\n if (responseErrorCode === ResponseErrorCode.InvalidField) {\n return `${MESSAGE.ERROR_INCORRECT_CODE} ${MESSAGE.CHECK_AND_TRY_AGAIN}`;\n }\n },\n }}\n />\n \n
\n \n \n \n \n
\n
\n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n error: selectors.global.getResponseError(state.global.actions, 'verify'),\n isRequesting: selectors.global.isActionRequesting(state.global.actions, 'verify'),\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n verify: verifyAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(VerificationCodeModal);\n","import * as React from 'react';\nimport { Link, RouteComponentProps, withRouter } from 'react-router-dom';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../store';\nimport Container from 'reactstrap/lib/Container';\nimport Dropdown from 'reactstrap/lib/Dropdown';\nimport DropdownToggle from 'reactstrap/lib/DropdownToggle';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faUserCircle } from '@fortawesome/free-solid-svg-icons/faUserCircle';\nimport DropdownMenu from 'reactstrap/lib/DropdownMenu';\nimport DropdownItem from 'reactstrap/lib/DropdownItem';\nimport { ROUTE } from '../config';\nimport selectors from '../store/selectors';\n\ninterface StateProps {\n isAuthenticated: boolean;\n name: string;\n merchantDisplayName: string;\n}\n\ntype OwnProps = RouteComponentProps;\n\ntype Props = StateProps & OwnProps;\n\ntype State = {\n isOpen: boolean;\n};\n\nclass NavMenu extends React.PureComponent {\n public state: State = {\n isOpen: false,\n };\n\n toggle = () => {\n this.setState({ isOpen: !this.state.isOpen });\n };\n\n public render() {\n return (\n \n
\n {this.props.merchantDisplayName} Customer Payments\n
\n \n \n \n \n \n \n
{this.props.name}
\n
\n \n \n
Sign out
\n \n
\n
\n
\n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n isAuthenticated: state.authentication.isAuthenticated,\n name: selectors.authentication.getFullName(state.authentication),\n merchantDisplayName: state.global.merchant.display_name,\n});\n\nexport default withRouter(connect(mapStateToProps)(NavMenu));\n","import * as React from 'react';\n\ninterface Props {\n isBlack: boolean;\n}\n\nexport default function Powered(props: Props) {\n let imgSrc = '/images/';\n\n if (props.isBlack) {\n imgSrc += 'Powered-by-Stronghold.png';\n } else {\n imgSrc += 'Powered-by-Stronghold_1-p-500.png';\n }\n\n return (\n
\n \"Stronghold\n
\n );\n}\n","import * as React from 'react';\nimport Powered from './Powered';\nimport Container from 'reactstrap/lib/Container';\n\nexport default function Footer() {\n return (\n
\n \n \n \n
\n );\n}\n","import * as React from 'react';\nimport NavMenu from './NavMenu';\nimport Breadcrumb from 'reactstrap/lib/Breadcrumb';\nimport BreadcrumbItem from 'reactstrap/lib/BreadcrumbItem';\nimport { Link } from 'react-router-dom';\nimport Footer from './Footer';\n\nexport interface LayoutBreadcrumbItem {\n href: string;\n title: string | JSX.Element;\n}\n\ninterface Props {\n navbar?: boolean;\n centered?: boolean;\n className?: string;\n children: JSX.Element | JSX.Element[];\n breadcrumbItems?: LayoutBreadcrumbItem[];\n footer?: boolean;\n}\n\nexport function LayoutBreadcrumbs(props: { items?: LayoutBreadcrumbItem[] }) {\n const { items = [] } = props;\n\n if (items.length === 0) return null;\n\n const isLastItem = (index: number) => index + 1 === items.length;\n\n return (\n
\n
\n \n {items.map((value, key) => (\n \n {isLastItem(key) ? value.title : {value.title}}\n \n ))}\n \n
\n
\n );\n}\n\nexport default function Layout(props: Props) {\n const { children, navbar = true, className = '', breadcrumbItems = [], centered = false } = props;\n\n if (centered) {\n return (\n
\n
\n {children}\n
\n {props.footer !== false &&
}\n
\n );\n }\n\n return (\n
\n {navbar && }\n \n
{children}
\n
\n
\n );\n}\n","import * as React from 'react';\nimport PhoneInput from 'react-phone-input-2';\n\ninterface Props {\n value: string;\n placeholder?: string;\n isInvalid: boolean;\n onChange: (phone: string) => void;\n disabled?: boolean;\n}\n\nclass PhoneNumberInput extends React.Component {\n render() {\n const { value, placeholder, isInvalid, onChange, disabled } = this.props;\n\n return (\n {\n mobile = mobile.replace(/[^0-9+]/g, '');\n onChange(`+${mobile}`);\n }}\n containerClass={['form-control', isInvalid ? 'is-invalid' : ''].join(' ')}\n disabled={disabled}\n inputProps={{\n name: 'mobile_phone_number',\n className: [\n disabled ? 'disabled' : '',\n 'border-top-0',\n 'border-right-0',\n 'border-left-0',\n 'border-bottom-0',\n ].join(' '),\n disabled: disabled,\n }}\n />\n );\n }\n}\n\nexport default PhoneNumberInput;\n","import * as React from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../store';\n\ninterface StateProps {\n imageUrl: string | null;\n displayName: string;\n}\n\ninterface OwnProps extends React.HTMLAttributes {\n maxHeight?: number;\n}\n\ntype Props = StateProps & OwnProps;\n\nfunction MerchantImg(props: Props) {\n const { imageUrl, displayName, maxHeight = 170, className = '' } = props;\n\n if (!imageUrl) {\n return null;\n }\n\n return (\n \n );\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n imageUrl: state.global.merchant.image_url,\n displayName: state.global.merchant.display_name,\n});\n\nexport default connect(mapStateToProps)(MerchantImg);\n","import 'react';\nimport * as React from 'react';\nimport Card from 'reactstrap/lib/Card';\nimport CardBody from 'reactstrap/lib/CardBody';\nimport Form from 'reactstrap/lib/Form';\nimport Input from 'reactstrap/lib/Input';\nimport { Link, RouteComponentProps, withRouter } from 'react-router-dom';\nimport Button from 'reactstrap/lib/Button';\nimport { FormEvent } from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../store';\nimport selectors from '../store/selectors';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport {\n isAuthenticatedAction,\n loginAction,\n resetActionStatusAction,\n setPayLinkCustomerAction,\n} from '../store/actions';\nimport { AuthenticationMethod, CustomerModel, addCustomer, ResponseError, PayLinkModel } from '../apis';\nimport Spinner from 'reactstrap/lib/Spinner';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { ROUTE } from '../config';\nimport { faAt } from '@fortawesome/free-solid-svg-icons/faAt';\nimport VerificationCodeModal from '../components/VerificationCodeModal';\nimport { faMobileAlt } from '@fortawesome/free-solid-svg-icons/faMobileAlt';\nimport FormGroup from 'reactstrap/lib/FormGroup';\nimport * as querystring from 'querystring';\nimport Layout from '../components/Layout';\nimport PhoneNumberInput from '../components/PhoneNumberInput';\nimport FormFeedback from '../components/FormFeedback';\nimport Label from 'reactstrap/lib/Label';\nimport Row from 'reactstrap/lib/Row';\nimport Col from 'reactstrap/lib/Col';\nimport MerchantImg from '../components/MerchantImg';\n\ninterface LoginParams {\n mobile: string;\n email: string;\n}\n\ninterface StateProps {\n isRequesting: boolean;\n error: ResponseError | null;\n merchantDisplayName: string;\n customer: CustomerModel | null;\n link: PayLinkModel | null;\n}\n\ntype OwnProps = { navToSignup?: () => void } & RouteComponentProps;\n\ninterface DispatchProps {\n login: typeof loginAction;\n isAuthenticatedAction: typeof isAuthenticatedAction;\n resetActionStatusAction: () => void;\n linkCustomer: typeof setPayLinkCustomerAction;\n}\n\ntype Props = OwnProps & StateProps & DispatchProps & RouteComponentProps<{ code: string }>;\n\ninterface State {\n authenticationMethod: AuthenticationMethod;\n mobile: string;\n email: string;\n showModal: boolean;\n code?: string;\n}\n\nclass LoginPage extends React.Component {\n constructor(props: Props) {\n super(props);\n\n this.state = {\n authenticationMethod: 'sms',\n mobile: '',\n email: '',\n showModal: false,\n code: this.props.match.params.code,\n };\n\n this.onSubmit = this.onSubmit.bind(this);\n }\n\n componentDidMount() {\n const params = querystring.parse(this.props.location.search.slice(1));\n const paramsObject = params as Partial;\n this.setState({\n mobile: paramsObject.mobile || '',\n email: paramsObject.email || '',\n });\n }\n\n username = (authenticationMethod?: AuthenticationMethod) => {\n return (authenticationMethod || this.state.authenticationMethod) === 'email'\n ? this.state.email\n : this.state.mobile;\n };\n\n onLogin = async (authenticationMethod: AuthenticationMethod) => {\n try {\n this.setState({ authenticationMethod });\n await this.props.login(\n authenticationMethod,\n this.username(authenticationMethod),\n this.props.link?.merchant.short_name,\n );\n this.setState({ showModal: true });\n } catch {\n // Error\n }\n };\n\n onSubmit = (authenticationMethod: AuthenticationMethod) => async (event: FormEvent) => {\n event.preventDefault();\n this.onLogin(authenticationMethod);\n };\n\n onResend = () => this.onLogin(this.state.authenticationMethod);\n\n onSuccess = async () => {\n this.props.isAuthenticatedAction(true);\n if (this.state.code && this.props.customer?.id) {\n await addCustomer(this.state.code, this.props.customer.id);\n window.location.reload();\n } else {\n this.props.history.push(ROUTE.HOME);\n }\n };\n\n toggle = () => {\n this.setState({ showModal: !this.state.showModal });\n };\n\n isInvalid = (method: AuthenticationMethod) => {\n return (\n this.state.authenticationMethod === method && selectors.global.isPropertyError('username', this.props.error)\n );\n };\n\n render() {\n const { isRequesting, error, merchantDisplayName } = this.props;\n const { authenticationMethod, mobile, email, showModal } = this.state;\n return (\n \n \n \n
\n {merchantDisplayName} Customer Payments\n
\n \n
Enter your email or mobile number to receive a login code.
\n
\n \n \n
\n \n
\n this.setState({ mobile })}\n disabled={isRequesting}\n />\n \n
\n
\n \n {isRequesting && authenticationMethod === 'sms' ? (\n \n ) : (\n \n )}\n \n
\n
\n
\n \n \n
\n \n \n
Or
\n \n \n
\n \n
\n \n
\n \n
\n {\n this.props.resetActionStatusAction();\n this.setState({\n email: e.currentTarget.value,\n });\n }}\n invalid={this.isInvalid('email')}\n />\n \n
\n\n
\n \n {isRequesting && authenticationMethod === 'email' ? (\n \n ) : (\n \n )}\n \n
\n
\n
\n \n
\n \n Don't have an account?\n {this.props.navToSignup ? (\n \n Sign Up\n \n ) : (\n \n Sign Up\n \n )}\n \n
\n
\n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n error: selectors.global.getResponseError(state.global.actions, 'login'),\n isRequesting: selectors.global.isActionRequesting(state.global.actions, 'login'),\n merchantDisplayName: state.global.merchant.display_name,\n customer: state.authentication.customer,\n link: state.payLink.data ? state.payLink.data : null,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n login: loginAction,\n isAuthenticatedAction: isAuthenticatedAction,\n resetActionStatusAction: () => dispatch(resetActionStatusAction('login')),\n linkCustomer: setPayLinkCustomerAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(LoginPage));\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport * as React from 'react';\nimport Button, { ButtonProps } from 'reactstrap/lib/Button';\nimport { getStrongholdPayClient } from '../../config';\nimport { addPaymentSourceAction, fetchCustomerTokenAction, selectPaymentSourceAction } from '../../store/actions';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { OnExit, AddPaymentSourceOnSuccess, PaymentSource } from '@stronghold/pay-dropin';\nimport { ApplicationState } from '../../store';\nimport selectors from '../../store/selectors';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faUniversity } from '@fortawesome/free-solid-svg-icons/faUniversity';\nimport Spinner from 'reactstrap/lib/Spinner';\nimport { ApiKeyModel } from '../../apis';\n\ninterface StateProps {\n publishableKey: ApiKeyModel | null;\n customerToken: string;\n isRequestingCustomerToken: boolean;\n integrationId?: string;\n apiVersion: string;\n}\n\ninterface OwnProps extends ButtonProps {\n onSuccess?: AddPaymentSourceOnSuccess;\n iconColor?: string;\n payLinkId?: string;\n}\n\ninterface DispatchProps {\n fetchCustomerTokenAction: typeof fetchCustomerTokenAction;\n addPaymentSourceAction: typeof addPaymentSourceAction;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\ninterface State {\n ready: boolean;\n paymentSource: PaymentSource | null;\n}\n\nclass AddPaymentSourceButton extends React.Component {\n public state: State = {\n ready: true,\n paymentSource: null,\n };\n\n onClick = async () => {\n if (!this.props.publishableKey) return;\n\n this.setState({ ready: false });\n\n try {\n await this.props.fetchCustomerTokenAction();\n } catch {\n this.setState({ ready: true });\n return;\n }\n\n // If for whatever reason there is no customer token, throw\n if (!this.props.customerToken) throw new Error('no customer token');\n\n const client = getStrongholdPayClient(\n this.props.publishableKey.key,\n this.props.publishableKey.environment,\n this.props.apiVersion,\n this.props.integrationId,\n );\n client.addPaymentSource(this.props.customerToken, {\n payLinkCode: this.props.payLinkId,\n onSuccess: this.onSuccess,\n onExit: this.onExit,\n onReady: () => this.setState({ ready: true }),\n });\n };\n\n onSuccess: AddPaymentSourceOnSuccess = (paymentSource) => {\n this.props.addPaymentSourceAction(paymentSource);\n this.props.selectPaymentSourceAction(paymentSource.id);\n this.setState({ paymentSource });\n };\n\n onExit: OnExit = () => {\n if (!this.state.ready) {\n this.setState({ ready: true });\n }\n if (this.state.paymentSource && this.props.onSuccess) {\n this.props.onSuccess(this.state.paymentSource);\n }\n };\n\n render() {\n const {\n children = Link a Payment Method,\n isRequestingCustomerToken,\n customerToken,\n addSourcesAction,\n fetchCustomerTokenAction,\n showAsLink,\n onExit,\n onSuccess,\n publishableKey,\n addPaymentSourceAction,\n iconColor,\n payLinkId,\n ...props\n } = this.props;\n const { ready } = this.state;\n\n const color = props.color || 'primary';\n const iconClass = `text-${iconColor || 'white'}`;\n\n let icon = ;\n\n const isLoading = !ready;\n const isDisabled = isLoading || props.disabled || !publishableKey;\n\n if (isLoading) {\n icon = ;\n }\n\n return (\n \n {children}\n {icon}\n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n publishableKey: state.global.publishableApiKey,\n customerToken: state.authentication.customerToken || '',\n isRequestingCustomerToken: selectors.global.isActionRequesting(state.global.actions, 'fetch_customer_token'),\n integrationId: state.attribution?.integrationId,\n apiVersion: state.attribution.apiVersion,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n fetchCustomerTokenAction,\n addPaymentSourceAction,\n selectPaymentSourceAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(AddPaymentSourceButton);\n","import * as React from 'react';\nimport Powered from './Powered';\nimport { MerchantModel } from '../apis';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../store';\nimport MerchantImg from '../components/MerchantImg';\n\ninterface Props {\n merchant: MerchantModel;\n}\n\nfunction StrongholdPay(props: Props) {\n return (\n
\n \n

\n {props.merchant.display_name}\n

\n\n \n
\n );\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n merchant: state.global.merchant,\n});\n\nexport default connect(mapStateToProps)(StrongholdPay);\n","import * as React from 'react';\nimport Paginator, { PaginationInformation } from 'paginator';\nimport PaginationBS from 'reactstrap/lib/Pagination';\nimport PaginationItem from 'reactstrap/lib/PaginationItem';\nimport PaginationLink from 'reactstrap/lib/PaginationLink';\n\nexport interface Props {\n total: number;\n skipped: number;\n limit: number;\n length?: number;\n onClick: (skip: number) => void;\n disabled?: boolean;\n}\n\nconst bigStep = 10;\n\nexport function getPaginationInfo(total: number, limit: number, length: number, currentPage: number) {\n const paginator = new Paginator(limit, length);\n return paginator.build(total, currentPage);\n}\n\nexport const getCurrentPage = (skipped: number, limit: number) => Math.floor(skipped / limit) + 1;\nexport const getPageSkip = (page: number, limit: number) => (page - 1) * limit;\nexport const getPreviousBigStep = (paginationInfo: PaginationInformation, limit: number) => {\n const page = paginationInfo.current_page - bigStep;\n const has = page > 1;\n const hasPagesLeft = paginationInfo.first_page > 2;\n const skip = getPageSkip(page, limit);\n return { page, has, hasPagesLeft, skip };\n};\nexport const getNextBigStep = (paginationInfo: PaginationInformation, limit: number) => {\n const page = paginationInfo.current_page + bigStep;\n const has = page < paginationInfo.total_pages;\n const hasPagesLeft = paginationInfo.last_page < paginationInfo.total_pages - 1;\n const skip = getPageSkip(page, limit);\n return { page, has, hasPagesLeft, skip };\n};\n\nexport default function Pagination(props: Props) {\n const { limit, length = 5, skipped, total, onClick, disabled = false } = props;\n\n if (total === 0) {\n return null;\n }\n\n const currentPage = getCurrentPage(skipped, limit);\n const paginationInfo = getPaginationInfo(total, limit, length, currentPage);\n\n const firstPageSkip = 0;\n const lastPageSkip = getPageSkip(paginationInfo.total_pages, limit);\n\n const previousBigStep = getPreviousBigStep(paginationInfo, limit);\n const nextBigStep = getNextBigStep(paginationInfo, limit);\n\n const pages: JSX.Element[] = [];\n for (let i = paginationInfo.first_page; i < paginationInfo.last_page + 1; i++) {\n pages.push(\n \n onClick(getPageSkip(i, limit)) : undefined}\n >\n {i}\n \n ,\n );\n }\n\n return (\n \n {paginationInfo.first_page > 1 ? (\n \n onClick(firstPageSkip)}>1\n \n ) : null}\n {previousBigStep.has ? (\n \n onClick(previousBigStep.skip)} />\n \n ) : null}\n {!previousBigStep.has && previousBigStep.hasPagesLeft ? (\n \n ...\n \n ) : null}\n {pages}\n {!nextBigStep.has && nextBigStep.hasPagesLeft ? (\n \n ...\n \n ) : null}\n {nextBigStep.has ? (\n \n onClick(nextBigStep.skip)} />\n \n ) : null}\n {paginationInfo.last_page < paginationInfo.total_pages ? (\n \n onClick(lastPageSkip)}>{paginationInfo.total_pages}\n \n ) : null}\n \n );\n}\n","import * as React from 'react';\nimport { CHARGE_STATUS } from '../../apis';\nimport Badge from 'reactstrap/lib/Badge';\n\nexport interface Props {\n status: CHARGE_STATUS;\n}\n\nexport default function ChargeStatusBadge(props: Props) {\n const { status } = props;\n let textColor = 'primary';\n let text = status.replace('_', ' ');\n\n if (status === 'captured') {\n textColor = 'success';\n text = 'Completed';\n } else if (status === 'authorized') {\n textColor = 'warning';\n text = 'Pending';\n } else if (status === 'attempting_collection') {\n textColor = 'warning';\n text = 'Retrying';\n } else if (status === 'disputed') {\n textColor = 'warning';\n text = 'Disputed';\n } else if (status === 'refund_pending') {\n textColor = 'warning';\n text = 'Processing refund';\n } else if (status === 'refunded') {\n textColor = 'primary';\n text = 'Refunded';\n } else if (status === 'capture_failed') {\n textColor = 'danger';\n text = 'Insufficient funds';\n } else if (status === 'stopped_collection') {\n textColor = 'danger';\n text = 'Stopped Collection';\n } else if (status === 'canceled') {\n textColor = 'danger';\n text = 'Canceled';\n }\n\n return (\n \n {text}\n \n );\n}\n","import * as React from 'react';\n\nexport interface Props {\n isLoading: boolean;\n width?: string;\n children?: React.ReactNode;\n}\n\nexport default class PlaceholderLoader extends React.Component {\n render() {\n const { isLoading, children, width } = this.props;\n\n if (!isLoading) {\n return children || null;\n }\n\n return (\n \n -\n \n );\n }\n}\n","import * as React from 'react';\nimport PlaceholderLoader from './PlaceholderLoader';\n\nexport type Props = React.PropsWithChildren<{\n isLoading: boolean;\n rows: number;\n columns: number;\n}>;\n\nexport default function TableBody(props: Props) {\n if (!props.isLoading) {\n return {props.children};\n }\n\n const rows: JSX.Element[] = [];\n\n for (let row = 0; row < props.rows; row++) {\n const columns: JSX.Element[] = [];\n for (let col = 0; col < props.columns; col++) {\n columns.push(\n \n \n ,\n );\n }\n rows.push({columns});\n }\n\n return {rows};\n}\n","import * as React from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../../store';\nimport { ChargeModel } from '../../apis';\nimport { isActionRequesting } from '../../store/selectors/global';\nimport Table from 'reactstrap/lib/Table';\nimport selectors from '../../store/selectors';\nimport Pagination from '../../components/Pagination';\nimport ChargeStatusBadge from './ChargeStatusBadge';\nimport TableBody from '../TableBody';\n\ninterface StateProps {\n charges: ChargeModel[];\n chargesTotal: number;\n chargesSkipped: number;\n chargesLimit: number;\n isLoading: boolean;\n}\n\ninterface OwnerProps {\n customerId?: string;\n isLoading?: boolean;\n onGoTo: (page: number, skip: number) => void;\n noRowsComponent?: () => React.ReactNode;\n}\n\ntype Props = StateProps & OwnerProps;\n\nclass ChargesTable extends React.Component {\n hasNoRows = () => this.props.charges.length === 0 && !this.props.isLoading;\n\n renderNoRows = () => {\n if (!this.hasNoRows()) return null;\n return (\n
\n {this.props.noRowsComponent ? this.props.noRowsComponent() : 'There are no transactions to display'}\n
\n );\n };\n\n render() {\n return (\n \n \n \n \n \n \n \n \n \n \n {this.props.charges.map((charge, index) => (\n \n \n \n \n \n ))}\n \n
DateStatusAmount
{selectors.format.formatDateTimeMinutes(charge.created_at)}\n \n {selectors.format.formatAmount(charge.amount)}
\n {this.renderNoRows()}\n this.props.onGoTo(skip / this.props.chargesLimit + 1, skip)}\n disabled={this.props.isLoading}\n />\n
\n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (\n state,\n { isLoading = false },\n) => ({\n charges: state.charge.list.items,\n chargesSkipped: state.charge.list.skipped,\n chargesTotal: state.charge.list.total,\n chargesLimit: state.charge.list.limit,\n isLoading: isActionRequesting(state.global.actions, 'fetch_charges') || isLoading,\n});\n\nexport default connect(mapStateToProps)(ChargesTable);\n","import * as React from 'react';\nimport { Card, CardBody, CardHeader } from 'reactstrap';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faLifeRing } from '@fortawesome/free-solid-svg-icons/faLifeRing';\n\nexport default function SupportCard() {\n return (\n \n \n
\n \n
Support
\n
\n
\n \n Need Help? Email{' '}\n happiness@stronghold.co{' '}\n for assistance.\n \n
\n );\n}\n","import * as React from 'react';\nimport { Button, Modal, ModalHeader, ModalBody, ModalFooter, Spinner } from 'reactstrap';\nimport { PaymentSourceActionType } from './PaymentSourceActions';\nimport { ResponseError } from '../apis';\nimport Alert from 'reactstrap/lib/Alert';\n\ntype Props = {\n showModal: boolean;\n amount: number;\n toggle: () => void;\n onSubmit: () => void;\n type: PaymentSourceActionType;\n error: ResponseError | null;\n isLoading: boolean;\n};\n\nexport default class ConfirmationModal extends React.Component {\n formatErrorMessage = (errorCode: string) => {\n switch (errorCode) {\n case 'payment_source_has_pending_charge':\n return 'Unable to unlink this payment source due to a recent change on an associated charge.';\n default:\n return 'An error has occured during the action.';\n }\n };\n\n render() {\n const { showModal, type, isLoading, error } = this.props;\n const spinner = ;\n const title = 'Payment Source';\n\n const message = (\n \n {' '}\n Are you sure you want to {type} the {title}?\n \n );\n\n return (\n \n {`${type} ${title}`}\n \n
{message}
\n {error && (\n {error.code ? this.formatErrorMessage(error.code) : error.message}\n )}\n
\n \n \n \n \n
\n );\n }\n}\n","import * as React from 'react';\nimport { Button, ButtonProps } from 'reactstrap';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport Badge from 'reactstrap/lib/Badge';\nimport { ResponseError } from '../apis';\nimport { PaymentSource } from '@stronghold/pay-dropin';\nimport { ApplicationState } from '../store';\nimport selectors from '../store/selectors';\nimport { deactivatePaymentSourceAction, removePaymentSourceAction } from '../store/actions';\nimport { filter } from 'lodash';\nimport ConfirmationModal from './ConfirmationModal';\n\ninterface StateProps {\n errorMessage: ResponseError | null;\n paymentSources: PaymentSource[];\n}\n\ninterface OwnProps extends ButtonProps {\n paymentSource: PaymentSource;\n customerId: string;\n}\n\ninterface DispatchProps {\n deactivatePaymentSourceAction: typeof deactivatePaymentSourceAction;\n removePaymentSourceAction: typeof removePaymentSourceAction;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\nexport type PaymentSourceActionType = 'remove' | null;\n\ninterface State {\n ready: boolean;\n showModal: boolean;\n action: PaymentSourceActionType;\n}\n\nclass PaymentSourceActions extends React.Component {\n public state: State = {\n ready: true,\n showModal: false,\n action: null,\n };\n\n onActionClick = async (action: PaymentSourceActionType) => {\n if (action === null) return;\n await this.setState({ action });\n this.toggleModal();\n };\n\n toggleModal = () => this.setState({ showModal: !this.state.showModal });\n\n onSubmit = async () => {\n const { paymentSource, paymentSources } = this.props;\n this.setState({ ready: false });\n try {\n if (this.state.action === null) return;\n\n const paymentSourcesToDelete = filter(\n paymentSources,\n (item) => item.unique_hash === paymentSource.unique_hash,\n );\n\n // remove payment sources\n for (const el of paymentSourcesToDelete) {\n await this.props.deactivatePaymentSourceAction(el.id);\n }\n\n this.toggleModal();\n setTimeout(() => {\n paymentSourcesToDelete.forEach((el) => this.props.removePaymentSourceAction(el.id));\n }, 500);\n } catch {\n this.setState({ ready: true });\n // Error\n }\n this.setState({ ready: true });\n };\n\n render() {\n const { paymentSource, errorMessage } = this.props;\n\n const { showModal } = this.state;\n const isLoading = !this.state.ready;\n const action = paymentSource.active ? 'remove' : null;\n\n return (\n \n \n {paymentSource.active ? (\n this.onActionClick(action)}\n >\n {action}\n \n ) : (\n Deactivated\n )}\n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n paymentSources: state.paymentSources.arr,\n errorMessage: selectors.global.getResponseError(state.global.actions, 'update_payment_source'),\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n deactivatePaymentSourceAction,\n removePaymentSourceAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(PaymentSourceActions);\n","import * as React from 'react';\nimport { SPLIT_FLAG } from '../../store/types';\nimport { PropsWithChildren, ReactNode } from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../../store';\nimport { selectTreatmentValue } from '@splitsoftware/splitio-redux';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { fetchSplitTreatmentAction } from '../../store/actions/splitio';\n\ntype OwnProps = PropsWithChildren<{\n flag: SPLIT_FLAG;\n unactiveComponent?: ReactNode;\n}>;\n\ninterface StateProps {\n treatment: string | null;\n}\n\ninterface DispatchProps {\n fetchSplitTreatmentAction: typeof fetchSplitTreatmentAction;\n}\n\ntype Props = OwnProps & StateProps & DispatchProps;\n\nclass ToggleSplit extends React.Component {\n componentDidMount = async () => {\n const { flag } = this.props;\n await this.props.fetchSplitTreatmentAction(flag);\n };\n\n render() {\n const { treatment, unactiveComponent, children } = this.props;\n\n if (treatment === 'on') {\n return children;\n }\n\n return unactiveComponent || null;\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state, props: OwnProps) => ({\n treatment: selectTreatmentValue(state.splitio, props.flag, state.global.merchant.id),\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n fetchSplitTreatmentAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ToggleSplit);\n","import * as React from 'react';\nimport { MerchantModel } from '../apis';\nimport MerchantImg from './MerchantImg';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../store';\n\ninterface StateProps {\n merchant: MerchantModel;\n}\n\ntype Props = StateProps;\n\nfunction Merchant(props: Props) {\n const { merchant } = props;\n\n return (\n
\n \n
{merchant.display_name}
\n {merchant.street_location.street1}, \n {merchant.street_location.street2} \n {merchant.street_location.street3} \n \n {merchant.street_location.city}, {merchant.street_location.state} {merchant.street_location.postcode}\n \n
\n );\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n merchant: state.global.merchant,\n});\n\nexport default connect(mapStateToProps)(Merchant);\n","import * as React from 'react';\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { isNewPaymentSourceLinkedAction } from '../store/actions';\nimport { connect } from 'react-redux';\n\ntype OwnProps = {\n showModal: boolean;\n};\n\ninterface DispatchProps {\n isNewPaymentSourceLinkedAction: typeof isNewPaymentSourceLinkedAction;\n}\n\ntype Props = OwnProps & DispatchProps;\n\nclass NewPaymentSourceLinkedModal extends React.Component {\n toggle = () => {\n this.props.isNewPaymentSourceLinkedAction(false);\n };\n\n render() {\n const { showModal } = this.props;\n const message = You’ve successfully linked your bank account and can use this payment method.;\n return (\n \n \n Congratulations!\n \n \n
{message}
\n
\n \n \n \n
\n );\n }\n}\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n isNewPaymentSourceLinkedAction,\n },\n dispatch,\n );\n\nexport default connect(null, mapDispatchToProps)(NewPaymentSourceLinkedModal);\n","import 'react';\nimport * as React from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../store';\nimport { Card, CardBody } from 'reactstrap';\nimport Layout from '../components/Layout';\nimport { Redirect } from 'react-router';\nimport { ROUTE } from '../config';\nimport selectors from '../store/selectors';\nimport Row from 'reactstrap/lib/Row';\nimport Col from 'reactstrap/lib/Col';\nimport CardHeader from 'reactstrap/lib/CardHeader';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faUniversity } from '@fortawesome/free-solid-svg-icons/faUniversity';\nimport { faIdCard } from '@fortawesome/free-solid-svg-icons/faIdCard';\nimport AddPaymentSourceButton from '../components/dropin/AddPaymentSourceButton';\nimport { PaymentSource } from '@stronghold/pay-dropin';\nimport StrongholdPay from '../components/StrongholdPay';\nimport { faReceipt } from '@fortawesome/free-solid-svg-icons/faReceipt';\nimport ChargesTable from '../components/charge/ChargesTable';\nimport { fetchChargesAction, deactivatePaymentSourceAction } from '../store/actions';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport SupportCard from '../components/SupportCard';\nimport PaymentSourceActions from '../components/PaymentSourceActions';\nimport { uniqBy } from 'lodash';\nimport ToggleSplit from '../components/split/ToggleSplit';\nimport { SPLIT_FLAG } from '../store/types';\nimport Merchant from '../components/Merchant';\nimport NewPaymentSourceLinkedModal from '../components/NewPaymentSourceLinkedModal';\n\ninterface StateProps {\n isAuthenticated: boolean;\n fullName: string;\n email: string | null;\n mobile: string | null;\n paymentSources: PaymentSource[];\n customerId: string | null;\n isNewPaymentSourceLinked: boolean;\n}\n\ninterface DispatchProps {\n fetchChargesAction: typeof fetchChargesAction;\n deactivatePaymentSourceAction: typeof deactivatePaymentSourceAction;\n}\n\ntype Props = DispatchProps & StateProps;\n\nclass HomePage extends React.Component {\n componentDidMount = async () => {\n this.fetchCharges();\n };\n\n fetchCharges = (skip?: number) => {\n this.props.fetchChargesAction({ skip });\n };\n\n render() {\n const { isAuthenticated, customerId, paymentSources, isNewPaymentSourceLinked } = this.props;\n\n if (!isAuthenticated) {\n return ;\n }\n\n return (\n \n \n \n \n \n \n
Profile
\n
\n \n \n \n Name\n \n {this.props.fullName}\n \n \n \n Mobile\n \n {this.props.mobile || '—'}\n \n \n \n Email\n \n {this.props.email || '—'}\n \n \n
\n \n \n
\n \n
Payment Methods
\n
\n
\n
    \n {customerId &&\n paymentSources &&\n uniqBy(paymentSources, 'unique_hash').map((el) => (\n \n
    {el.label}
    \n
    \n \n
    \n \n ))}\n
\n \n
\n \n
\n
\n
\n \n \n \n
Transactions
\n
\n this.fetchCharges(skip)} />\n
\n \n \n \n \n }>\n \n \n \n \n \n \n
\n \n
\n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n isAuthenticated: state.authentication.isAuthenticated,\n fullName: selectors.authentication.getFullName(state.authentication),\n customerId: state.authentication.customer.id,\n email: state.authentication.customer.individual.email,\n mobile: state.authentication.customer.individual.mobile,\n paymentSources: state.paymentSources.arr,\n isNewPaymentSourceLinked: state.paymentSources.isNewPaymentSourceLinked,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n fetchChargesAction,\n deactivatePaymentSourceAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(HomePage);\n","import 'react';\nimport * as React from 'react';\nimport Card from 'reactstrap/lib/Card';\nimport CardBody from 'reactstrap/lib/CardBody';\nimport Form from 'reactstrap/lib/Form';\nimport { RouteComponentProps, withRouter } from 'react-router';\nimport AddPaymentSourceButton from '../components/dropin/AddPaymentSourceButton';\nimport { ROUTE } from '../config';\nimport Layout from '../components/Layout';\nimport MerchantImg from '../components/MerchantImg';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../store';\nimport { isNewPaymentSourceLinkedAction } from '../store/actions';\nimport { bindActionCreators, Dispatch } from 'redux';\n\ninterface StateProps {\n merchantDisplayName: string;\n}\n\ninterface DispatchProps {\n isNewPaymentSourceLinkedAction: typeof isNewPaymentSourceLinkedAction;\n}\n\ntype Props = StateProps & DispatchProps & RouteComponentProps;\n\nclass LinkAccountPage extends React.PureComponent {\n onSuccess = () => {\n this.props.isNewPaymentSourceLinkedAction(true);\n this.props.history.push(ROUTE.HOME);\n };\n\n public render() {\n return (\n \n \n \n
\n Link account for {this.props.merchantDisplayName}\n
\n \n
\n

\n In order to make payments you will need to securely verify and link your bank details.\n

\n

Your credentials will never be stored or shared.

\n
\n
\n this.onSuccess()} />\n \n
\n
\n
\n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n merchantDisplayName: state.global.merchant.display_name,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n isNewPaymentSourceLinkedAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(LinkAccountPage));\n","import * as React from 'react';\nimport { RouteComponentProps, withRouter } from 'react-router-dom';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../store';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { logoutAction } from '../store/actions';\nimport { ROUTE } from '../config';\n\ntype OwnProps = RouteComponentProps;\n\ninterface DispatchProps {\n logoutAction: typeof logoutAction;\n}\n\ntype Props = DispatchProps & OwnProps;\n\nclass LogoutPage extends React.Component {\n componentDidMount(): void {\n this.props.logoutAction();\n this.props.history.push(ROUTE.LOGIN);\n }\n\n render() {\n return null;\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = () => ({});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n logoutAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(LogoutPage));\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport * as React from 'react';\nimport Button from 'reactstrap/lib/Button';\nimport { getStrongholdPayClient } from '../../config';\nimport { fetchCustomerTokenAction, setActionRequestingAction, removePaymentSourceAction } from '../../store/actions';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { ChargeOnSuccess, ERROR_CODE, OnError, OnExit } from '@stronghold/pay-dropin';\nimport { ApplicationState } from '../../store';\nimport selectors from '../../store/selectors';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport Spinner from 'reactstrap/lib/Spinner';\nimport { ButtonProps } from 'reactstrap';\nimport { faMoneyBill } from '@fortawesome/free-solid-svg-icons/faMoneyBill';\nimport { ApiKeyModel } from '../../apis';\n\ninterface StateProps {\n publishableKey: ApiKeyModel | null;\n customerToken: string;\n noSource: boolean;\n isAuthorizingPayment: boolean;\n integrationId?: string;\n apiVersion: string;\n}\n\ninterface OwnProps extends ButtonProps {\n payLinkCode: string;\n paymentSourceId: string;\n amount: number;\n tipAmount?: number;\n tipBeneficiaryName?: string;\n onSuccess: ChargeOnSuccess;\n creditAmount?: number;\n processingFee?: number;\n}\n\ninterface DispatchProps {\n fetchCustomerTokenAction: typeof fetchCustomerTokenAction;\n setActionRequestingAction: typeof setActionRequestingAction;\n removePaymentSourceAction: typeof removePaymentSourceAction;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\ninterface State {\n ready: boolean;\n}\n\nclass AddChargeDropinButton extends React.Component {\n constructor(props: Props) {\n super(props);\n\n this.state = { ready: true };\n }\n\n charge = async () => {\n // Return if no key\n if (!this.props.publishableKey) return;\n\n this.props.setActionRequestingAction('authorize_payment', true);\n try {\n await this.props.fetchCustomerTokenAction();\n } catch (e) {\n this.props.setActionRequestingAction('authorize_payment', false);\n // Something wrong happen, possibly display an error in the future\n return;\n }\n\n // If for whatever reason there is no customer token, throw\n if (!this.props.customerToken) throw new Error('no customer token');\n\n const client = getStrongholdPayClient(\n this.props.publishableKey.key,\n this.props.publishableKey.environment,\n this.props.apiVersion,\n this.props.integrationId,\n );\n client.charge(this.props.customerToken, {\n payLinkCode: this.props.payLinkCode,\n skipSuccessScreen: true,\n skipPayScreen: true,\n charge: {\n amount: this.props.amount,\n paymentSourceId: this.props.paymentSourceId,\n },\n tip: this.props.tipAmount\n ? {\n amount: this.props.tipAmount,\n beneficiaryName: this.props.tipBeneficiaryName || '',\n }\n : undefined,\n onSuccess: this.onSuccess,\n onExit: this.onExit,\n onError: this.onError,\n });\n };\n\n updatePaymentMethod = async () => {\n // Return if no key\n if (!this.props.publishableKey) return;\n\n this.setState({ ready: false });\n\n const client = getStrongholdPayClient(\n this.props.publishableKey.key,\n this.props.publishableKey.environment,\n this.props.apiVersion,\n this.props.integrationId,\n );\n client.updatePaymentSource(this.props.customerToken, {\n onSuccess: () => this.setState({ ready: true }),\n onExit: () => this.setState({ ready: true }),\n onError: (e) => {\n this.setState({ ready: true });\n },\n paymentSourceId: this.props.paymentSourceId,\n });\n };\n\n onSuccess: ChargeOnSuccess = (charge) => {\n this.props.setActionRequestingAction('authorize_payment', false);\n if (this.props.onSuccess) {\n this.props.onSuccess(charge);\n }\n };\n\n onError: OnError = async (e) => {\n if (e.code === ERROR_CODE.PAYMENT_SOURCE_LOGIN_REQUIRED) {\n this.setState({ ready: false });\n // TODO: see how to fix latency of event listener\n setTimeout(() => this.updatePaymentMethod(), 200);\n return;\n } else if (e.code === ERROR_CODE.PAYMENT_SOURCE_INACTIVE) {\n this.setState({ ready: false });\n this.props.removePaymentSourceAction(this.props.paymentSourceId);\n return;\n }\n this.props.setActionRequestingAction('authorize_payment', false);\n };\n\n onExit: OnExit = () => {\n this.props.setActionRequestingAction('authorize_payment', false);\n };\n\n render() {\n const payAmount =\n this.props.amount +\n (this.props.tipAmount || 0) -\n (this.props.creditAmount || 0) +\n (this.props.processingFee || 0);\n const {\n children = <>PAY {selectors.number.amountToString(payAmount > 0 ? payAmount : 0)},\n payLinkCode,\n isAuthorizingPayment,\n customerToken,\n paymentSourceId,\n onSuccess,\n onExit,\n fetchCustomerTokenAction,\n noSource,\n setActionRequestingAction,\n publishableKey,\n merchantDisplayName,\n paymentSourceLabel,\n amount,\n tipAmount = 0,\n tipBeneficiaryName,\n subButtonElement,\n ...props\n } = this.props;\n const { ready } = this.state;\n\n let icon = ;\n\n const isLoading = isAuthorizingPayment;\n const isDisabled = isLoading || noSource || props.disabled || !publishableKey || !ready || !amount;\n\n if (isLoading) {\n icon = ;\n }\n\n return (\n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n publishableKey: state.global.publishableApiKey,\n customerToken: state.authentication.customerToken || '',\n noSource: state.paymentSources.arr.length === 0,\n isAuthorizingPayment: selectors.global.isActionRequesting(state.global.actions, 'authorize_payment'),\n integrationId: state.attribution?.integrationId,\n apiVersion: state.attribution.apiVersion,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n fetchCustomerTokenAction,\n setActionRequestingAction,\n removePaymentSourceAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(AddChargeDropinButton);\n","import * as React from 'react';\nimport selectors from '../../store/selectors';\nimport { TipType } from '../../store/types';\n\nexport interface Props {\n subAmount: number;\n taxAmount: number;\n convenienceFee: number;\n processingFee: number;\n totalAmount: number;\n tipValue?: number;\n tipType: TipType;\n creditValue?: number;\n}\n\nexport default function CheckoutTotal(props: Props) {\n const amountDetails = selectors.number.getAmountDetails({\n convenienceFee: props.convenienceFee,\n processingFee: props.processingFee,\n taxAmount: props.taxAmount,\n totalAmount: props.totalAmount,\n subAmount: props.subAmount,\n tipAmount: props.tipValue,\n tipType: props.tipType,\n creditValue: props.creditValue,\n });\n\n const taxAmountStr = amountDetails.taxAmount ? selectors.number.amountToString(amountDetails.taxAmount) : null;\n const convenienceFeeStr =\n amountDetails.convenienceFee || amountDetails.processingFee\n ? selectors.number.amountToString(amountDetails.convenienceFee + amountDetails.processingFee)\n : null;\n const subAmountStr = selectors.number.amountToString(amountDetails.subAmount);\n const tipAmountStr = amountDetails.tipAmount ? selectors.number.amountToString(amountDetails.tipAmount) : null;\n const creditAmountStr = amountDetails.creditValue\n ? selectors.number.amountToString(amountDetails.creditValue)\n : null;\n const fullAmountStr = selectors.number.amountToString(amountDetails.fullAmount);\n\n return (\n
\n
\n
Subtotal
\n
\n {subAmountStr}\n
\n
\n {taxAmountStr ? (\n
\n
Tax
\n
\n {taxAmountStr}\n
\n
\n ) : null}\n {convenienceFeeStr ? (\n
\n
Convenience Fee
\n
\n {convenienceFeeStr}\n
\n
\n ) : null}\n {tipAmountStr ? (\n
\n
Tip
\n
\n {tipAmountStr}\n
\n
\n ) : null}\n {creditAmountStr ? (\n
\n
Credit Amount
\n
\n ({creditAmountStr})\n
\n
\n ) : null}\n
\n
Total
\n
\n {fullAmountStr}\n
\n
\n
\n );\n}\n","import React, { KeyboardEvent } from 'react';\nimport { Input, InputProps } from 'reactstrap';\n\ninterface Props extends InputProps {\n className?: string;\n max?: number;\n onValueChange: (value: number) => void;\n value: number;\n prefix?: string;\n suffix?: string;\n digits?: number;\n}\n\nconst VALID_FIRST = /^[1-9]{1}$/;\nconst VALID_NEXT = /^[0-9]{1}$/;\nconst DELETE_KEY_CODE = 8;\nconst RETURN_KEY_CODE = 13;\n\nexport default class NumberInput extends React.Component {\n handleKeyDown = (e: KeyboardEvent) => {\n const { value, max, onValueChange } = this.props;\n const { key, keyCode } = e;\n\n if (keyCode === RETURN_KEY_CODE) {\n e.currentTarget.blur();\n }\n\n if (\n (value === 0 && !VALID_FIRST.test(key)) ||\n (value !== 0 && !VALID_NEXT.test(key) && keyCode !== DELETE_KEY_CODE)\n ) {\n return;\n }\n const valueString = value.toString();\n let nextValue: number;\n\n if (keyCode !== DELETE_KEY_CODE) {\n const nextValueString: string = value === 0 ? key : `${valueString}${key}`;\n nextValue = Number.parseInt(nextValueString, 10);\n } else {\n const nextValueString = valueString.slice(0, -1);\n nextValue = nextValueString === '' ? 0 : Number.parseInt(nextValueString, 10);\n }\n\n if (max && nextValue > max) {\n return;\n }\n\n onValueChange(nextValue);\n };\n\n valueDisplay = () => {\n const value = this.props.value / Math.pow(10, this.props.digits || 0);\n return `${this.props.prefix || ''}${value.toFixed(this.props.digits || 0)}${this.props.suffix || ''}`;\n };\n\n render() {\n const { className, value, ...props } = this.props;\n const valueAbsTrunc = Math.trunc(Math.abs(value));\n\n if (value !== valueAbsTrunc || !Number.isFinite(value) || Number.isNaN(value)) {\n throw new Error(`invalid value property`);\n }\n return (\n \n );\n }\n}\n","import * as React from 'react';\nimport NumberInput from './NumberInput';\nimport { Button } from 'reactstrap';\nimport selectors from '../store/selectors';\nimport { TipCustomizationModel, TipType } from '../store/types';\nimport Row from 'reactstrap/lib/Row';\nimport Col from 'reactstrap/lib/Col';\n\ninterface Props {\n originalAmount: number;\n tipModel: TipCustomizationModel;\n amount: number;\n setDefaultValueOnChange?: boolean;\n onSetAmount: (value: number, error: boolean) => void;\n}\n\ninterface State {\n showAmountField: boolean;\n errorMessage: string | null;\n tips: number[];\n tipType: TipType;\n}\n\nexport default class TipSelection extends React.Component {\n private tipInput: HTMLInputElement | null = null;\n\n constructor(props: Props) {\n super(props);\n this.state = {\n showAmountField: false,\n errorMessage: null,\n tips: [],\n tipType: 'fixed',\n };\n }\n\n async componentDidMount() {\n const tips = [this.props.tipModel.value1, this.props.tipModel.value2, this.props.tipModel.value3];\n const isPercentage = this.props.tipModel.type === 'percentage';\n // tips less than $1 throw an error at checkout, an issue when using type is percentage\n // default to [1,2,3]\n const tipAmount1 = selectors.number.getTipAmount(\n this.props.tipModel.type,\n this.props.tipModel.value1,\n this.props.originalAmount,\n );\n if (isPercentage && tipAmount1 < 100) {\n await this.setState({ tips: [100, 200, 300], tipType: 'fixed' });\n } else {\n await this.setState({ tips, tipType: this.props.tipModel.type });\n }\n }\n\n selectTip = (tipValue: number): void => {\n const amount = this.getAmount(tipValue);\n this.onSetAmount(this.props.amount === amount ? 0 : amount);\n };\n\n toggleAmountField = async (): Promise => {\n const { tips, tipType } = this.state;\n const tipAmounts = tips.map((tip) => selectors.number.getTipAmount(tipType, tip, this.props.originalAmount));\n let tipAmount = this.props.amount;\n // If we show the amount, we set to zero\n if (this.props.amount === 0) {\n this.props.onSetAmount(0, false);\n } else {\n if (this.state.showAmountField) {\n // If tip amount does not match a default value, we set the second as a default\n if (!tipAmounts.includes(this.props.amount)) {\n tipAmount = this.props.setDefaultValueOnChange ? tipAmounts[1] : 0;\n }\n }\n this.props.onSetAmount(tipAmount, false);\n }\n\n await this.setState({\n showAmountField: !this.state.showAmountField,\n errorMessage: null,\n });\n\n if (this.tipInput && this.state.showAmountField) {\n this.tipInput.focus();\n }\n };\n\n onSetAmount = (tip: number): void => {\n let errorMessage: string | null = null;\n // We don't use custom percent amounts, it will always be fixed\n if (this.state.showAmountField) {\n if (tip === 0) {\n // Not an error\n } else if (tip < 100) {\n errorMessage = 'Minimum tip amount is $1.00';\n } else if (tip >= 10000) {\n errorMessage = 'Maximum tip amount is $100';\n }\n }\n\n this.setState({ errorMessage }, () => this.props.onSetAmount(tip, !!errorMessage));\n };\n\n getAmount = (value: number): number => {\n const { originalAmount } = this.props;\n const { tipType } = this.state;\n return selectors.number.getTipAmount(tipType, value, originalAmount);\n };\n\n render() {\n const { amount } = this.props;\n const { tips, tipType } = this.state;\n\n const renderTipButton = (tip: number) => {\n const isPercent = tipType === 'percentage';\n const tipSubValue = isPercent\n ? selectors.number.amountToString(\n selectors.number.getTipAmount(tipType, tip, this.props.originalAmount),\n )\n : null;\n\n const tipValue = isPercent\n ? `${Math.round(tip / 100)}%`\n : selectors.number.amountToString(\n selectors.number.getTipAmount(tipType, tip, this.props.originalAmount),\n );\n\n return (\n \n this.selectTip(tip)}\n outline={amount !== tip}\n active={amount === this.getAmount(tip)}\n size=\"lg\"\n className={'btn-tip'}\n >\n {tipValue}\n {/* only show for percentage tips */}\n {tipSubValue &&
{tipSubValue}
}\n \n \n );\n };\n\n return (\n
\n
\n {this.state.showAmountField ? (\n
\n {\n this.tipInput = input as HTMLInputElement;\n }}\n className=\"mx-auto form-control-tip active\"\n onValueChange={this.onSetAmount}\n max={100000}\n value={this.props.amount}\n prefix={'$'}\n digits={2}\n />\n {this.state.errorMessage ? (\n
{this.state.errorMessage}
\n ) : null}\n
\n ) : (\n {tips.map((tip) => renderTipButton(tip))}\n )}\n
\n \n
\n );\n }\n}\n","import * as React from 'react';\nimport { PayLinkTipModel, MerchantModel } from '../apis';\nimport selectors from '../store/selectors';\n\ninterface Props {\n tipData: PayLinkTipModel;\n merchant: MerchantModel;\n orderAmount?: number;\n orderCreatedAt?: string;\n}\n\nexport default function TipMessage(props: Props) {\n const { tipData, orderAmount, orderCreatedAt } = props;\n let forOrder = null;\n\n let budtender = (\n \n \n
Tips go directly to our employees. Thank you for shopping with us.
\n \n
\n );\n if (tipData.details.display_message) {\n budtender = (\n
\n {tipData.details.display_message}\n
\n );\n }\n if (orderAmount) {\n const originalAmountStr = selectors.number.amountToString(orderAmount);\n forOrder = (\n \n for {originalAmountStr}\n {orderCreatedAt ? on {selectors.format.formatDateTimeMinutes(orderCreatedAt)} : null}\n \n );\n }\n\n return (\n
\n {budtender}\n {forOrder}\n
\n );\n}\n","import * as React from 'react';\nimport selectors from '../../store/selectors';\n\ninterface Props {\n merchantDisplayName: string;\n paymentSourceLabel: string;\n amount: number;\n}\n\nexport default function PaymentAuthorizationAggreement(props: Props) {\n const { amount, merchantDisplayName, paymentSourceLabel } = props;\n const amountStr = selectors.number.amountToString(amount);\n\n return (\n
\n \n By clicking Pay above, you agree to the{' '}\n Stronghold Pay End User Agreement and you authorize{' '}\n {merchantDisplayName} to electronically debit your{' '}\n {paymentSourceLabel} for {amountStr}.\n \n
\n );\n}\n","import * as React from 'react';\nimport Row from 'reactstrap/lib/Row';\nimport Col from 'reactstrap/lib/Col';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../store';\nimport { PaymentSource } from '@stronghold/pay-dropin';\nimport ListGroupItem from 'reactstrap/lib/ListGroupItem';\nimport FormGroup from 'reactstrap/lib/FormGroup';\nimport { Input } from 'reactstrap';\nimport Label from 'reactstrap/lib/Label';\nimport ListGroup from 'reactstrap/lib/ListGroup';\nimport MESSAGE from '../message';\nimport AddPaymentSourceButton from './dropin/AddPaymentSourceButton';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { deactivatePaymentSourceAction } from '../store/actions';\nimport PaymentSourceActions from './PaymentSourceActions';\nimport { uniqBy } from 'lodash';\nimport selectors from '../store/selectors';\nimport { CardType } from '../store/selectors/paymentSources';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCcVisa } from '@fortawesome/free-brands-svg-icons';\nimport { faCcMastercard } from '@fortawesome/free-brands-svg-icons';\nimport { faCcDinersClub } from '@fortawesome/free-brands-svg-icons';\nimport { faCcAmex } from '@fortawesome/free-brands-svg-icons';\n\ninterface StateProps {\n paymentSources: PaymentSource[];\n customerId: string | null;\n payLinkId?: string;\n}\n\ntype OwnProps = {\n paymentSourceId?: string | null;\n onSelect?: (paymentSource: PaymentSource) => void;\n disabled?: boolean;\n canAddPaymentSource?: boolean;\n flush?: boolean;\n};\n\ninterface DispatchProps {\n deactivatePaymentSourceAction: typeof deactivatePaymentSourceAction;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\nclass PaymentSourceList extends React.PureComponent {\n get selectable(): boolean {\n return !!this.props.onSelect;\n }\n\n onSelectPaymentSource = (paymentSource: PaymentSource) => {\n if (this.props.onSelect) {\n this.props.onSelect(paymentSource);\n }\n };\n\n renderCardTypeIcon = (provider: string) => {\n switch (selectors.paymentSources.getTypeOfCard(provider)) {\n case CardType.Visa:\n return ;\n case CardType.MasterCard:\n return ;\n case CardType.AmericanExpress:\n return ;\n case CardType.DinersClub:\n return ;\n default:\n return null;\n }\n };\n\n render() {\n const {\n customerId,\n disabled,\n paymentSourceId,\n paymentSources,\n canAddPaymentSource = true,\n flush = false,\n payLinkId,\n } = this.props;\n\n let list =
{MESSAGE.PAYMENT_METHOD_NONE}
;\n let buttonColor = 'primary';\n let buttonText;\n let buttonIconColor;\n\n if (this.props.paymentSources.length > 0) {\n buttonColor = 'light';\n buttonIconColor = 'dark';\n buttonText = MESSAGE.PAYMENT_METHOD_CHANGE;\n list = (\n \n {customerId &&\n paymentSources &&\n uniqBy(paymentSources, 'unique_hash').map((el, key) => {\n let content = (\n \n );\n\n if (this.selectable) {\n content = (\n \n \n {content}\n
e.stopPropagation()}>\n \n
\n
\n );\n }\n\n return (\n this.onSelectPaymentSource(el)}\n active={el.id === paymentSourceId}\n action={this.selectable}\n >\n {content}\n \n );\n })}\n
\n );\n }\n\n let button = <>;\n\n if (canAddPaymentSource) {\n button = (\n
\n \n {buttonText}\n \n
\n );\n }\n\n return (\n \n \n {this.props.paymentSources.length > 0 ? (\n {list}\n ) : (\n {button}\n )}\n \n \n {this.props.paymentSources.length > 0 ? (\n {button}\n ) : (\n {list}\n )}\n \n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n paymentSources: state.paymentSources.arr,\n customerId: state.authentication.customer.id,\n payLinkId: state.payLink.data?.id,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n deactivatePaymentSourceAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(PaymentSourceList);\n","import * as React from 'react';\nimport { PropsWithChildren } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport CardBody from 'reactstrap/lib/CardBody';\nimport MerchantImg from './MerchantImg';\nimport Card from 'reactstrap/lib/Card';\nimport Progress from 'reactstrap/lib/Progress';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../store';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport selectors from '../store/selectors';\nimport { faCheck } from '@fortawesome/free-solid-svg-icons/faCheck';\n\ninterface StateProps {\n successUrlCallback: string | null;\n merchantName: string;\n}\n\ntype OwnProps = PropsWithChildren<{\n title: string;\n}>;\n\ntype Props = StateProps & OwnProps;\n\ninterface State {\n progressEnabled: boolean;\n progress: number;\n redirecting: boolean;\n}\n\nclass PayLinkSuccessCard extends React.Component {\n constructor(props: Props) {\n super(props);\n\n this.state = {\n progressEnabled: false,\n progress: 0,\n redirecting: false,\n };\n }\n\n componentDidMount() {\n if (this.props.successUrlCallback) {\n this.setState({ progressEnabled: true });\n setInterval(() => {\n this.updateProgressBar();\n }, 100);\n }\n }\n\n updateProgressBar = () => {\n if (!this.props.successUrlCallback) return;\n if (!this.state.progressEnabled) return;\n\n if (this.state.progress < 100) {\n this.setState({ progress: this.state.progress + 3 });\n } else {\n setTimeout(() => {\n if (this.props.successUrlCallback && !this.state.redirecting) {\n this.setState({ redirecting: true });\n window.location.href = this.props.successUrlCallback;\n }\n }, 500);\n }\n };\n\n componentWillUnmount() {\n this.setState({ progressEnabled: false });\n }\n\n render() {\n const { title, children, merchantName } = this.props;\n const { progress, progressEnabled } = this.state;\n\n return (\n
\n \n \n \n

\n {title} \n

\n {children}\n
\n {progressEnabled ? (\n <>\n \n Taking you back to {merchantName}...\n \n \n \n ) : null}\n
\n
\n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => {\n return {\n successUrlCallback: selectors.payLink.getSuccessUrlCallback(state),\n merchantName: state.global.merchant.display_name,\n };\n};\n\nconst mapDispatchToProps = (dispatch: Dispatch) => bindActionCreators({}, dispatch);\n\nexport default connect(mapStateToProps, mapDispatchToProps)(PayLinkSuccessCard);\n","import * as React from 'react';\nimport MESSAGE from '../message';\n\nexport default function PaymentSourceRequiredWarning() {\n return (\n \n
{MESSAGE.PAYMENT_METHOD_NONE}
\n \n );\n}\n","import React from 'react';\nimport { PayLinkModel, PayLinkOrderModel } from '../apis';\nimport TableBody from './TableBody';\nimport Table from 'reactstrap/lib/Table';\nimport selectors from '../store/selectors';\n\ninterface StateProps {\n order: PayLinkOrderModel;\n}\n\ninterface OwnProps {\n link: PayLinkModel | null;\n}\ntype Props = StateProps & OwnProps;\n\nexport default class UploadedDocuments extends React.Component {\n render() {\n return (\n
\n {this.props.order.documents && (\n \n \n \n \n \n \n \n \n \n {this.props.order.documents.map((document, index) => (\n \n \n \n \n \n ))}\n \n
NameSizeLink
{document.file_name}{`${selectors.format.formatKB(document.file_size)} KB`}\n \n Download\n \n
\n )}\n
\n );\n }\n}\n","import * as React from 'react';\nimport Media from 'reactstrap/lib/Media';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faImage } from '@fortawesome/free-solid-svg-icons/faImage';\nimport selectors from '../../store/selectors';\nimport { OrderItemModel } from '../../apis';\n\nexport interface Props {\n item: OrderItemModel;\n}\n\nexport default function OrderItem(props: Props) {\n const { total_amount, price, description, image_url, name, quantity } = props.item;\n return (\n \n {image_url ? (\n {name}\n ) : (\n \n )}\n
\n
\n
{name}
\n {description ? (\n \n {description}\n \n ) : null}\n {!!price && price !== total_amount ? (\n {selectors.number.amountToString(price)} per item\n ) : null}\n x {quantity}\n
\n
\n
\n {selectors.number.amountToString(total_amount)}\n
\n
\n
\n
\n );\n}\n","import * as React from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../../store';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { Card, CardBody, Button, ListGroupItem, ListGroup } from 'reactstrap';\nimport {\n selectPaymentSourceAction,\n setErrorMessageAction,\n updateHeaderTitleAction,\n updatePayLinkAction,\n} from '../../store/actions';\nimport { MerchantModel, PayLinkModel, PayLinkOrderModel, PayLinkTipModel } from '../../apis';\nimport { ChargeOnSuccess, PaymentSource } from '@stronghold/pay-dropin';\nimport CardHeader from 'reactstrap/lib/CardHeader';\nimport AddChargeDropinButton from '../../components/dropin/AddChargeDropinButton';\nimport CheckoutTotal from '../../components/checkout/CheckoutTotal';\nimport selectors from '../../store/selectors';\nimport MESSAGE from '../../message';\nimport TipSelection from '../../components/TipSelection';\nimport TipMessage from '../../components/TipMessage';\nimport PaymentAuthorizationAggreement from '../../components/dropin/PaymentAuthorizationAggreement';\nimport PaymentSourceList from '../../components/PaymentSourceList';\nimport { CustomizationType, SPLIT_FLAG, TipCustomizationModel } from '../../store/types';\nimport PayLinkSuccessCard from '../../components/PayLinkSuccessCard';\nimport PaymentSourceRequiredWarning from '../../components/PaymentSourceRequiredWarning';\nimport UploadedDocuments from '../../components/UploadedDocuments';\nimport StrongholdPay from '../../components/StrongholdPay';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faLongArrowAltRight } from '@fortawesome/free-solid-svg-icons';\nimport OrderItem from '../../components/checkout/OrderItem';\nimport ToggleSplit from '../../components/split/ToggleSplit';\n\nimport Row from 'reactstrap/lib/Row';\nimport Col from 'reactstrap/lib/Col';\n\ninterface StateProps {\n paymentSources: PaymentSource[];\n paymentSourceSelected: PaymentSource | null;\n isAuthorizingPayment: boolean;\n success_msg: string | null;\n order: PayLinkOrderModel;\n tipModel: TipCustomizationModel;\n tipData: PayLinkTipModel;\n merchant: MerchantModel;\n creditValue: number;\n}\n\ninterface OwnProps {\n link: PayLinkModel;\n}\n\ninterface DispatchProps {\n setErrorMessageAction: typeof setErrorMessageAction;\n updateHeaderTitleAction: typeof updateHeaderTitleAction;\n updatePayLinkAction: typeof updatePayLinkAction;\n selectPaymentSourceAction: typeof selectPaymentSourceAction;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\ninterface State {\n showSticky: boolean;\n tipValue: number;\n hasTipError: boolean;\n fileList: PayLinkOrderModel | null;\n}\n\nclass CheckoutPage extends React.Component {\n private orderSummary: HTMLDivElement | null = null;\n private continueButton: HTMLDivElement | null = null;\n\n constructor(props: Props) {\n super(props);\n this.state = {\n showSticky: true,\n tipValue: 0,\n hasTipError: false,\n fileList: null,\n };\n }\n\n async componentDidMount() {\n await this.props.updateHeaderTitleAction({\n values: ['Checkout'],\n });\n\n window.addEventListener('scroll', this.onScroll);\n }\n\n componentWillUnmount() {\n window.removeEventListener('scroll', this.onScroll);\n }\n\n onScroll = () => {\n if (this.isFirstButtonInViewport() || !this.isEndButtonInViewport()) {\n this.setState({ showSticky: true });\n } else {\n this.setState({ showSticky: false });\n }\n };\n\n isFirstButtonInViewport = () => {\n if (!this.continueButton) return false;\n const top = this.continueButton.getBoundingClientRect().top;\n return top >= 0 && top <= window.innerHeight;\n };\n\n isEndButtonInViewport = (offset = 0) => {\n if (!this.orderSummary) return false;\n const top = this.orderSummary.getBoundingClientRect().top;\n return top + offset >= 0 && top - offset <= window.innerHeight;\n };\n\n scrollToPayment = () => {\n if (!this.orderSummary) return false;\n window.scrollTo(0, this.orderSummary.getBoundingClientRect().top);\n };\n\n onSuccess: ChargeOnSuccess = (charge) => {\n this.props.updatePayLinkAction({ status: 'used', charge });\n };\n\n getAmountDetails = () => {\n return selectors.number.getAmountDetails({\n tipAmount: this.state.tipValue,\n tipType: this.props.tipModel.type,\n convenienceFee: this.props.order.convenience_fee,\n processingFee: this.props.order.payment_processing_fee,\n taxAmount: this.props.order.tax_amount,\n totalAmount: this.props.order.total_amount,\n subAmount: this.props.order.sub_amount,\n creditValue: this.props.creditValue,\n });\n };\n\n renderQuickPay = () => {\n const amountDetails = this.getAmountDetails();\n const totalAmountWithTip = selectors.number.amountToString(amountDetails.fullAmount);\n return (\n <>\n \n \n
\n

Order Total

\n

\n {totalAmountWithTip}\n

\n
\n \n Pay Now\n \n \n
\n \n
(this.continueButton = el)} className=\"mb-3\" />\n \n \n );\n };\n\n renderItems = () => {\n if (this.props.order.items.length === 0) {\n return null;\n }\n\n return (\n \n Items\n \n \n {this.props.order.items.map((el, key) => (\n \n \n \n ))}\n \n \n \n );\n };\n\n renderPaymentMethod = () => {\n const header = MESSAGE.PAYMENT_METHOD_SELECT_TITLE;\n\n return (\n <>\n \n {header}\n \n \n
\n this.props.selectPaymentSourceAction(paymentSource.id)}\n disabled={this.props.isAuthorizingPayment}\n />\n
\n
\n \n );\n };\n\n renderTip = () => {\n const { tipModel, tipData, merchant } = this.props;\n\n const amountDetails = this.getAmountDetails();\n if (!tipData) return null;\n\n return (\n \n \n Add a tip\n \n \n
\n \n \n
{MESSAGE.SELECT_OR_ADD_TIP}
\n this.setState({ tipValue, hasTipError })}\n />\n \n
\n \n \n \n \n \n
\n
\n
\n );\n };\n\n renderPdf = () => {\n const { order, link } = this.props;\n\n if (this.props.order.documents && this.props.order.documents.length === 0) {\n return null;\n }\n return (\n \n Order Documents\n \n
\n \n
\n
\n
\n );\n };\n\n renderTotal = () => {\n const { isAuthorizingPayment, order, link, tipModel, paymentSourceSelected } = this.props;\n const { id, merchant } = link;\n const { tipValue, hasTipError } = this.state;\n\n const amountDetails = this.getAmountDetails();\n\n const payment = (\n \n \n {paymentSourceSelected ? (\n \n ) : (\n \n )}\n \n );\n\n return (\n \n
\n \n {payment}\n
(this.orderSummary = el)} />\n
\n \n );\n };\n\n renderSuccessMsg = () => {\n const { display_name } = this.props.link.merchant;\n const { success_msg } = this.props;\n\n return (\n
\n

{`Your payment to ${display_name} was received.`}

\n
{success_msg}
\n
\n );\n };\n\n render() {\n const { status } = this.props.link;\n\n if (status === 'used') {\n return {this.renderSuccessMsg()};\n }\n\n return (\n
\n \n \n \n \n \n {null}\n \n {this.renderPdf()}\n {this.renderPaymentMethod()}\n {this.renderTip()}\n {this.renderTotal()}\n \n
\n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state, ownProps) => {\n return {\n paymentSources: state.paymentSources.arr,\n paymentSourceSelected: selectors.paymentSources.getPaymentSourceSelected(state),\n tipModel: state.global.merchant.customization.tip,\n success_msg: selectors.customizations.getCustomization(\n state.global.merchant.customization.items,\n CustomizationType.SuccessScreen,\n ),\n isAuthorizingPayment: selectors.global.isActionRequesting(state.global.actions, 'authorize_payment'),\n order: ownProps.link.order as PayLinkOrderModel, // Link must have an order here\n tipData: ownProps.link.tip as PayLinkTipModel,\n merchant: state.global.merchant,\n creditValue: state.credits.creditValue,\n };\n};\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n setErrorMessageAction,\n updateHeaderTitleAction,\n updatePayLinkAction,\n selectPaymentSourceAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(CheckoutPage);\n","import * as React from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../../store';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport Card from 'reactstrap/lib/Card';\nimport CardBody from 'reactstrap/lib/CardBody';\nimport {\n setErrorMessageAction,\n updatePayLinkAction,\n updateHeaderTitleAction,\n selectPaymentSourceAction,\n} from '../../store/actions';\nimport { PayLinkModel } from '../../apis';\nimport { PaymentSource } from '@stronghold/pay-dropin';\nimport StrongholdPay from '../../components/StrongholdPay';\nimport CardHeader from 'reactstrap/lib/CardHeader';\nimport AddPaymentSourceButton from '../../components/dropin/AddPaymentSourceButton';\nimport PaymentSourceList from '../../components/PaymentSourceList';\nimport PayLinkSuccessCard from '../../components/PayLinkSuccessCard';\nimport ToggleSplit from '../../components/split/ToggleSplit';\nimport { SPLIT_FLAG } from '../../store/types';\nimport Merchant from '../../components/Merchant';\n\ninterface StateProps {\n paymentSources: PaymentSource[];\n isUsed: boolean;\n}\n\ninterface OwnProps {\n link: PayLinkModel;\n}\n\ninterface DispatchProps {\n setErrorMessageAction: typeof setErrorMessageAction;\n updateHeaderTitleAction: typeof updateHeaderTitleAction;\n updatePayLinkAction: typeof updatePayLinkAction;\n selectPaymentSourceAction: typeof selectPaymentSourceAction;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\nclass BankLinkPage extends React.Component {\n async componentDidMount() {\n await this.props.updateHeaderTitleAction({\n values: ['Bank Link'],\n });\n }\n\n render() {\n const { isUsed } = this.props;\n\n if (isUsed) {\n return (\n \n
\n Your bank account has been linked successfully and you are{' '}\n ready to make payments.\n
\n
\n );\n }\n\n let paymentMethods = <>;\n\n if (this.props.paymentSources.length > 0) {\n paymentMethods = (\n \n Linked Payment Methods\n \n \n );\n }\n\n return (\n <>\n \n \n }>\n \n \n
\n
\n
\n {paymentMethods}\n \n \n
\n Link a bank account to make payments with{' '}\n {this.props.link.merchant.display_name}.\n
\n {\n this.props.updatePayLinkAction({ status: 'used' });\n this.props.selectPaymentSourceAction(source.id);\n }}\n payLinkId={this.props.link.id}\n block\n size=\"lg\"\n />\n
\n
\n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state, ownProps) => ({\n paymentSources: state.paymentSources.arr,\n isUsed: ownProps.link.status === 'used',\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n setErrorMessageAction,\n updateHeaderTitleAction,\n updatePayLinkAction,\n selectPaymentSourceAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(BankLinkPage);\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport * as React from 'react';\nimport Button from 'reactstrap/lib/Button';\nimport { getStrongholdPayClient } from '../../config';\nimport { fetchCustomerTokenAction, setActionRequestingAction } from '../../store/actions';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { ERROR_CODE, OnError, OnExit, TipDropin, TipOnSuccess } from '@stronghold/pay-dropin';\nimport { ApplicationState } from '../../store';\nimport selectors from '../../store/selectors';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport Spinner from 'reactstrap/lib/Spinner';\nimport { ButtonProps } from 'reactstrap';\nimport { faMoneyBill } from '@fortawesome/free-solid-svg-icons/faMoneyBill';\nimport { ApiKeyModel } from '../../apis';\n\ninterface StateProps {\n publishableKey: ApiKeyModel | null;\n customerToken: string;\n noSource: boolean;\n isAuthorizingPayment: boolean;\n integrationId?: string;\n apiVersion: string;\n}\n\ninterface OwnProps extends ButtonProps {\n payLinkCode: string;\n tip: TipDropin;\n onSuccess: TipOnSuccess;\n}\n\ninterface DispatchProps {\n fetchCustomerTokenAction: typeof fetchCustomerTokenAction;\n setActionRequestingAction: typeof setActionRequestingAction;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\ninterface State {\n ready: boolean;\n}\n\nclass AddTipDropinButton extends React.Component {\n constructor(props: Props) {\n super(props);\n\n this.state = { ready: true };\n }\n\n charge = async () => {\n // Return if no key\n if (!this.props.publishableKey) return;\n\n this.props.setActionRequestingAction('authorize_payment', true);\n try {\n await this.props.fetchCustomerTokenAction();\n } catch (e) {\n this.props.setActionRequestingAction('authorize_payment', false);\n // Something wrong happen, possibly display an error in the future\n return;\n }\n\n // If for whatever reason there is no customer token, throw\n if (!this.props.customerToken) throw new Error('no customer token');\n\n const client = getStrongholdPayClient(\n this.props.publishableKey.key,\n this.props.publishableKey.environment,\n this.props.apiVersion,\n this.props.integrationId,\n );\n client.tip(this.props.customerToken, {\n payLinkCode: this.props.payLinkCode,\n skipPayScreen: true,\n skipSuccessScreen: true,\n tip: {\n amount: this.props.tip.amount,\n beneficiaryName: this.props.tip.beneficiaryName,\n paymentSourceId: this.props.tip.paymentSourceId,\n chargeId: this.props.tip.chargeId,\n details: this.props.tip.details,\n },\n onSuccess: this.onSuccess,\n onExit: this.onExit,\n onError: this.onError,\n });\n };\n\n updatePaymentMethod = async () => {\n // Return if no key\n if (!this.props.publishableKey) return;\n\n this.setState({ ready: false });\n\n const client = getStrongholdPayClient(\n this.props.publishableKey.key,\n this.props.publishableKey.environment,\n this.props.apiVersion,\n this.props.integrationId,\n );\n client.updatePaymentSource(this.props.customerToken, {\n onSuccess: () => this.setState({ ready: true }),\n onExit: () => this.setState({ ready: true }),\n onError: (e) => {\n this.setState({ ready: true });\n },\n paymentSourceId: this.props.paymentSourceId,\n });\n };\n\n onSuccess: TipOnSuccess = (charge) => {\n this.props.setActionRequestingAction('authorize_payment', false);\n if (this.props.onSuccess) {\n this.props.onSuccess(charge);\n }\n };\n\n onError: OnError = async (e) => {\n if (e.code === ERROR_CODE.PAYMENT_SOURCE_LOGIN_REQUIRED) {\n this.setState({ ready: false });\n // TODO: see how to fix latency of event listener\n setTimeout(() => this.updatePaymentMethod(), 200);\n return;\n }\n this.props.setActionRequestingAction('authorize_payment', false);\n };\n\n onExit: OnExit = () => {\n this.props.setActionRequestingAction('authorize_payment', false);\n };\n\n render() {\n const {\n children = PAY,\n payLinkCode,\n isAuthorizingPayment,\n customerToken,\n paymentSourceId,\n onSuccess,\n onExit,\n fetchCustomerTokenAction,\n noSource,\n setActionRequestingAction,\n publishableKey,\n chargeId,\n tip,\n ...props\n } = this.props;\n const { ready } = this.state;\n\n let icon = ;\n\n const isLoading = isAuthorizingPayment;\n const isDisabled = isLoading || noSource || props.disabled || !publishableKey || !ready || !tip.amount;\n\n if (isLoading) {\n icon = ;\n }\n\n return (\n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n publishableKey: state.global.publishableApiKey,\n customerToken: state.authentication.customerToken || '',\n noSource: state.paymentSources.arr.length === 0,\n isAuthorizingPayment: selectors.global.isActionRequesting(state.global.actions, 'authorize_payment'),\n integrationId: state.attribution?.integrationId,\n apiVersion: state.attribution.apiVersion,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n fetchCustomerTokenAction,\n setActionRequestingAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(AddTipDropinButton);\n","import * as React from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../../store';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport Card from 'reactstrap/lib/Card';\nimport CardBody from 'reactstrap/lib/CardBody';\nimport {\n selectPaymentSourceAction,\n setErrorMessageAction,\n updateHeaderTitleAction,\n updatePayLinkAction,\n} from '../../store/actions';\nimport CardHeader from 'reactstrap/lib/CardHeader';\nimport selectors from '../../store/selectors';\nimport StrongholdPay from '../../components/StrongholdPay';\nimport { Charge, PaymentSource, TipOnSuccess } from '@stronghold/pay-dropin';\nimport { PayLinkModel, PayLinkTipModel } from '../../apis';\nimport PaymentSourceList from '../../components/PaymentSourceList';\nimport MESSAGE from '../../message';\nimport TipSelection from '../../components/TipSelection';\nimport TipMessage from '../../components/TipMessage';\nimport PaymentAuthorizationAggreement from '../../components/dropin/PaymentAuthorizationAggreement';\nimport AddTipDropinButton from '../../components/dropin/AddTipDropinButton';\nimport { SPLIT_FLAG, TipCustomizationModel } from '../../store/types';\nimport PayLinkSuccessCard from '../../components/PayLinkSuccessCard';\nimport PaymentSourceRequiredWarning from '../../components/PaymentSourceRequiredWarning';\nimport ToggleSplit from '../../components/split/ToggleSplit';\nimport Merchant from '../../components/Merchant';\n\ninterface StateProps {\n paymentSources: PaymentSource[];\n paymentSourceSelected: PaymentSource | null;\n isAuthorizingPayment: boolean;\n tipCustomization: TipCustomizationModel;\n tipData: PayLinkTipModel;\n charge: Charge;\n}\n\ninterface DispatchProps {\n setErrorMessageAction: typeof setErrorMessageAction;\n updateHeaderTitleAction: typeof updateHeaderTitleAction;\n updatePayLinkAction: typeof updatePayLinkAction;\n selectPaymentSourceAction: typeof selectPaymentSourceAction;\n}\n\ninterface OwnProps {\n link: PayLinkModel;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\ninterface State {\n tipValue: number;\n hasTipError: boolean;\n}\n\nclass TipPage extends React.Component {\n constructor(props: Props) {\n super(props);\n this.state = {\n tipValue: selectors.number.getTipAmount(\n this.props.tipCustomization.type,\n this.props.tipCustomization.value2,\n this.props.charge.amount,\n ),\n hasTipError: false,\n };\n }\n\n async componentDidMount() {\n let title = 'Tip';\n if (this.props.tipData.beneficiary_name) {\n title = `${this.props.tipData.beneficiary_name} ${title}`;\n }\n this.props.updateHeaderTitleAction({\n values: [title],\n });\n }\n\n onSuccess: TipOnSuccess = (tip) => {\n this.props.updatePayLinkAction({\n status: 'used',\n tip,\n });\n };\n\n getAmount = () => this.state.tipValue;\n getAmountStr = () => selectors.number.amountToString(this.getAmount());\n\n renderOrderDetails = () => {\n const { charge, link, tipData } = this.props;\n\n return (\n \n \n \n );\n };\n\n renderTip = () => {\n const { charge, tipCustomization } = this.props;\n return (\n \n Add a tip\n \n this.setState({ tipValue, hasTipError })}\n />\n \n \n );\n };\n\n renderPaymentMethod = () => {\n const header = MESSAGE.PAYMENT_METHOD_SELECT_TITLE;\n\n return (\n <>\n {header}\n \n this.props.selectPaymentSourceAction(paymentSource.id)}\n disabled={this.props.isAuthorizingPayment}\n />\n \n \n );\n };\n\n renderTotal = () => {\n const { isAuthorizingPayment, link, charge, tipData, paymentSourceSelected } = this.props;\n const { hasTipError } = this.state;\n\n return (\n \n
\n Your order was {selectors.number.amountToString(charge.amount)}\n
\n \n Tip {this.getAmountStr()}\n \n {paymentSourceSelected ? (\n \n ) : (\n \n )}\n
\n );\n };\n\n render() {\n const { link, tipData } = this.props;\n const { status } = link;\n\n if (status === 'used') {\n return (\n \n

\n Your tip{' '}\n \n to {tipData.beneficiary_name}\n {' '}\n was received.\n

\n
{\"Thanks for tipping! — We've updated your order receipt.\"}
\n
\n );\n }\n\n return (\n \n \n }>\n \n \n \n {this.renderOrderDetails()}\n {this.renderTip()}\n {this.renderPaymentMethod()}\n {this.renderTotal()}\n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state, ownProps) => {\n return {\n paymentSources: state.paymentSources.arr,\n paymentSourceSelected: selectors.paymentSources.getPaymentSourceSelected(state),\n tipCustomization: state.global.merchant.customization.tip,\n isAuthorizingPayment: selectors.global.isActionRequesting(state.global.actions, 'authorize_payment'),\n tipData: ownProps.link.tip as PayLinkTipModel,\n charge: ownProps.link.charge as Charge,\n };\n};\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n setErrorMessageAction,\n updateHeaderTitleAction,\n updatePayLinkAction,\n selectPaymentSourceAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(TipPage);\n","let environment: string | null;\n\nexport default {\n set environment(value: string | null) {\n environment = value;\n },\n\n identify(userid: string) {\n if (!environment) return;\n analytics.identify(userid);\n },\n};\n","import * as React from 'react';\nimport { FormEvent } from 'react';\nimport Form from 'reactstrap/lib/Form';\nimport Input from 'reactstrap/lib/Input';\nimport Button from 'reactstrap/lib/Button';\nimport FormGroup from 'reactstrap/lib/FormGroup';\nimport Label from 'reactstrap/lib/Label';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport {\n resendTokenAction,\n resetActionStatusAction,\n setPayLinkCustomerAction,\n signupAction,\n} from '../../store/actions';\nimport { ApplicationState } from '../../store';\nimport {\n AuthenticationMethod,\n CustomerModel,\n addCustomer,\n ResponseError,\n ResponseErrorCode,\n PayLinkModel,\n} from '../../apis';\nimport selectors from '../../store/selectors';\nimport ReactDatePicker from 'react-datepicker';\nimport moment from 'moment';\nimport { FORMAT_DATE } from '../../config';\nimport FormFeedback from 'reactstrap/lib/FormFeedback';\nimport Spinner from 'reactstrap/lib/Spinner';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faLongArrowAltRight } from '@fortawesome/free-solid-svg-icons/faLongArrowAltRight';\nimport PhoneNumberInput from '../PhoneNumberInput';\nimport querystring from 'querystring';\nimport { Link } from 'react-router-dom';\nimport VerificationCodeModal from '../VerificationCodeModal';\n\ninterface StateProps {\n isRequesting: boolean;\n error: ResponseError | null;\n customer: CustomerModel | null;\n link: PayLinkModel | null;\n environment: string;\n}\n\ninterface DispatchProps {\n resetForm: typeof resetActionStatusAction;\n signup: typeof signupAction;\n resend: typeof resendTokenAction;\n linkCustomer: typeof setPayLinkCustomerAction;\n}\n\ninterface OwnProps {\n onSuccess: () => void;\n payLinkId?: string;\n}\n\ntype Props = StateProps & DispatchProps & OwnProps;\n\ninterface State {\n first_name: string;\n last_name: string;\n date_of_birth: Date | null;\n mobile: string;\n email: string;\n authenticationMethod: AuthenticationMethod;\n show_sms: boolean;\n showModal: boolean;\n}\n\nfunction onSubmit(fn: () => void) {\n return (event: FormEvent) => {\n event.preventDefault();\n fn();\n };\n}\n\nclass SignupForm extends React.Component {\n constructor(props: Props) {\n super(props);\n\n this.state = {\n date_of_birth: null,\n first_name: '',\n last_name: '',\n email: '',\n mobile: '',\n authenticationMethod: 'sms',\n show_sms: true,\n showModal: false,\n };\n\n this.onSignup = this.onSignup.bind(this);\n }\n\n toggleAuthMethod = (authMethod: AuthenticationMethod) =>\n this.setState({\n show_sms: authMethod === 'sms',\n authenticationMethod: authMethod,\n });\n\n toggleModal = () => {\n this.setState({ showModal: !this.state.showModal });\n };\n\n componentDidMount(): void {\n this.props.resetForm('signup');\n }\n\n dobRaw = () => (this.state.date_of_birth ? moment(this.state.date_of_birth).format(FORMAT_DATE) : '');\n\n async onSignup() {\n try {\n await this.props.signup(\n this.state.first_name,\n this.state.last_name,\n this.dobRaw(),\n this.state.mobile,\n this.state.email,\n this.state.authenticationMethod,\n this.props.link?.merchant.short_name,\n );\n if (!this.props.error) {\n // Display verification modal\n this.setState({ showModal: true });\n }\n if (this.props.payLinkId && this.props.customer?.id) {\n await addCustomer(this.props.payLinkId, this.props.customer.id);\n }\n } catch (error) {\n // catching error now\n }\n }\n\n tryLogin = (isMobile: boolean) => {\n let query;\n if (isMobile) {\n query = querystring.stringify({ mobile: this.state.mobile });\n } else {\n query = querystring.stringify({ email: this.state.email });\n }\n return (\n \n {isMobile ? 'Mobile phone number' : 'Email'} already taken. Please{' '}\n login using this {isMobile ? 'phone number' : 'email address'}.\n \n );\n };\n\n onResend = async () => {\n try {\n await this.props.resend(this.state.mobile, this.state.email, this.state.authenticationMethod);\n this.setState({ showModal: true });\n } catch (error) {\n // Error\n }\n };\n\n render() {\n const { error, isRequesting } = this.props;\n\n return (\n \n
\n \n \n this.setState({ first_name: e.currentTarget.value })}\n invalid={selectors.global.isPropertyError('individual.first_name', error)}\n />\n {selectors.global.getErrorMessage(error)}\n \n \n \n this.setState({ last_name: e.currentTarget.value })}\n invalid={selectors.global.isPropertyError('individual.last_name', error)}\n />\n {selectors.global.getErrorMessage(error)}\n \n \n \n 'DAY'}\n onChange={(date) => {\n this.setState({ date_of_birth: date });\n }}\n />\n

\n {selectors.global.isPropertyError('individual.date_of_birth', error)\n ? selectors.global.getErrorMessage(error)\n : ''}\n

\n
\n \n \n
\n \n \n
\n {this.state.show_sms ? (\n \n this.setState({ mobile })}\n />\n \n {selectors.global.getErrorCode(error) === ResponseErrorCode.ValueTaken\n ? this.tryLogin(true)\n : selectors.global.getErrorMessage(error)}\n \n \n ) : (\n \n this.setState({ email: e.currentTarget.value })}\n invalid={selectors.global.isPropertyError('individual.email', error)}\n />\n \n {selectors.global.getErrorCode(error) === ResponseErrorCode.ValueTaken\n ? this.tryLogin(false)\n : selectors.global.getErrorMessage(error)}\n \n \n )}\n
\n \n \n {this.state.show_sms && this.props.environment !== 'live' && (\n \n )}\n \n
\n this.props.onSuccess()}\n />\n
\n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n link: state.payLink.data ? state.payLink.data : null,\n error: selectors.global.getResponseError(state.global.actions, 'signup'),\n isRequesting: selectors.global.isActionRequesting(state.global.actions, 'signup'),\n customer: state.authentication.customer,\n environment: state.global.configuration.api_environment,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n resetForm: resetActionStatusAction,\n signup: signupAction,\n resend: resendTokenAction,\n linkCustomer: setPayLinkCustomerAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(SignupForm);\n","import * as React from 'react';\nimport Card from 'reactstrap/lib/Card';\nimport CardBody from 'reactstrap/lib/CardBody';\nimport { Link, RouteComponentProps, withRouter } from 'react-router-dom';\nimport Progress from 'reactstrap/lib/Progress';\nimport Row from 'reactstrap/lib/Row';\nimport Col from 'reactstrap/lib/Col';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCircle } from '@fortawesome/free-solid-svg-icons/faCircle';\nimport { faDotCircle } from '@fortawesome/free-solid-svg-icons/faDotCircle';\nimport { faCircle as faCircleRegular } from '@fortawesome/free-regular-svg-icons/faCircle';\nimport { ROUTE } from '../config';\nimport SignupForm from '../components/auth/SignupForm';\nimport AddPaymentSourceButton from '../components/dropin/AddPaymentSourceButton';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../store';\nimport Layout from '../components/Layout';\nimport MerchantImg from '../components/MerchantImg';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { isNewPaymentSourceLinkedAction } from '../store/actions';\n\ninterface StateProps {\n merchantDisplayName: string;\n}\n\ninterface DispatchProps {\n isNewPaymentSourceLinkedAction: typeof isNewPaymentSourceLinkedAction;\n}\n\ntype OwnProps = { navToLogin?: () => void } & RouteComponentProps;\n\ntype Props = OwnProps & StateProps & DispatchProps & RouteComponentProps<{ code: string }>;\n\ninterface State {\n step: number;\n code?: string;\n}\n\ninterface Step {\n step: number;\n title: string;\n}\n\nclass SignUpPage extends React.Component {\n constructor(props: Props) {\n super(props);\n\n this.state = {\n step: 1,\n code: this.props.match.params.code,\n };\n }\n\n next = () => {\n if (this.state.code) {\n window.location.reload();\n } else {\n this.setState({ step: this.state.step + 1 });\n }\n };\n\n previous = () => {\n this.setState({ step: this.state.step - 1 });\n };\n\n getStep(step: Step, key: number) {\n let icon = faCircle;\n let title = {step.title};\n const classes = ['p-2', 'd-flex', 'align-items-center'];\n if (step.step === this.state.step) {\n icon = faDotCircle;\n title = {title};\n } else if (step.step > this.state.step) {\n icon = faCircleRegular;\n }\n\n if (step.step !== this.state.step) {\n classes.push('border-bottom');\n }\n\n if (step.step > 1) {\n classes.push('border-left');\n }\n\n return (\n \n \n {title}\n \n );\n }\n\n onLinkSuccess = () => {\n this.props.isNewPaymentSourceLinkedAction(true);\n this.props.history.push(ROUTE.HOME);\n };\n\n render() {\n const steps: Step[] = [\n {\n step: 1,\n title: 'Personal Details',\n },\n {\n step: 2,\n title: 'Link Account',\n },\n ];\n\n const step = steps.find((el) => el.step === this.state.step) || steps[0];\n\n let content = ;\n\n if (step.step === 2) {\n content = (\n <>\n

In order to make payments, you must securely link a bank account.

\n

Your credentials will never be stored or shared.

\n\n
\n \n Link and Finish Sign Up\n \n
\n \n );\n }\n\n return (\n \n \n
\n
\n Sign up for Payments at {this.props.merchantDisplayName}\n
\n \n
We need a few details in order to create your account.
\n
\n\n {step.step < 2 ? (\n
\n
\n Paid using Stronghold ACH before?\n {this.props.navToLogin ? (\n \n Log In\n \n ) : (\n \n Log In{' '}\n \n )}\n
\n
\n ) : null}\n\n \n {steps.map((el, index) => this.getStep(el, index))}\n {content}\n
\n
\n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (\n state: ApplicationState,\n): StateProps => ({\n merchantDisplayName: state.global.merchant.display_name,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n isNewPaymentSourceLinkedAction: isNewPaymentSourceLinkedAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(SignUpPage));\n","import 'react';\n\nimport * as React from 'react';\nimport { RouteComponentProps, withRouter } from 'react-router-dom';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../../store';\nimport Layout from '../../components/Layout';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { PayLinkModel, ResponseErrorCode } from '../../apis';\nimport { isAuthenticatedAction, loginAction } from '../../store/actions';\nimport Spinner from 'reactstrap/lib/Spinner';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faArrowLeft } from '@fortawesome/free-solid-svg-icons/faArrowLeft';\nimport selectors from '../../store/selectors';\nimport CheckoutPage from './CheckoutPage';\nimport BankLinkPage from './BankLinkPage';\nimport TipPage from './TipPage';\nimport SignUpPage from '../SignUpPage';\nimport LoginPage from '../LoginPage';\n\ninterface StateProps {\n link: PayLinkModel | null;\n exitUrlCallback: string | null;\n}\n\ntype OwnProps = RouteComponentProps<{ code?: string }>;\n\ninterface DispatchProps {\n isAuthenticatedAction: typeof isAuthenticatedAction;\n loginAction: typeof loginAction;\n}\n\ntype Props = OwnProps & StateProps & DispatchProps;\n\ntype Page = 'signup' | 'login';\n\ninterface State {\n loaded: boolean;\n page?: Page;\n}\n\nclass PayLinkPage extends React.Component {\n constructor(props: Props) {\n super(props);\n\n this.state = {\n loaded: false,\n };\n }\n\n async componentDidMount() {\n await this.props.isAuthenticatedAction(false);\n const code = this.props.match.params.code || '';\n\n try {\n await this.props.loginAction('link', code);\n this.setState({ loaded: true });\n } catch (e) {\n if (e === ResponseErrorCode.CustomerRequired) {\n this.setState({ page: 'signup' });\n this.setState({ loaded: true });\n }\n }\n }\n\n navigateToLogin = () => {\n this.setState({ page: 'login' });\n };\n\n navigateToSignup = () => {\n this.setState({ page: 'signup' });\n };\n\n render() {\n const { link, exitUrlCallback, history, location, match } = this.props;\n\n if (this.state.loaded && this.state.page) {\n if (this.state.page === 'login') {\n return (\n \n \n \n );\n } else {\n return (\n \n \n \n );\n }\n }\n\n if (!this.state.loaded || !link) {\n return (\n \n \n \n );\n }\n\n let payLinkPage = <>;\n let exit = ;\n let className = '';\n\n if (exitUrlCallback && link.status !== 'used') {\n exit = (\n
\n \n \n Back\n \n
\n );\n }\n\n if (link.type === 'bank_link') {\n className = 'mw-sm';\n payLinkPage = ;\n } else if (link.type === 'tipping') {\n payLinkPage = ;\n } else if (link.type === 'checkout') {\n payLinkPage = ;\n } else {\n throw new Error(`PayLink of type ${link.type} not implemented`);\n }\n\n return (\n \n {exit}\n {payLinkPage}\n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => {\n const link = state.payLink.data ? state.payLink.data : null;\n\n return {\n link,\n exitUrlCallback: selectors.payLink.getExitUrlCallback(state),\n };\n};\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n isAuthenticatedAction,\n loginAction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(PayLinkPage));\n","import 'react';\nimport * as React from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from '../store';\nimport Layout from '../components/Layout';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport Card from 'reactstrap/lib/Card';\nimport CardBody from 'reactstrap/lib/CardBody';\nimport MESSAGE from '../message';\nimport { ResponseErrorCode } from '../apis';\nimport Button from 'reactstrap/lib/Button';\nimport { faRedo } from '@fortawesome/free-solid-svg-icons/faRedo';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\ninterface StateProps {\n show: boolean;\n errorCode: ResponseErrorCode | null;\n}\n\ninterface OwnProps {\n children: JSX.Element | JSX.Element[];\n}\n\ntype Props = StateProps & OwnProps;\n\nclass ErrorHandler extends React.Component {\n reloadPage = () => {\n window.location.reload();\n };\n\n render() {\n const { errorCode, show, children } = this.props;\n\n if (!show) {\n return children;\n }\n\n let title = <>{MESSAGE.ERROR_COMMON_TITLE};\n let subTitle = null;\n let message = <>{MESSAGE.ERROR_COMMON};\n\n if (errorCode === ResponseErrorCode.PayLinkCanceled) {\n title = <>{MESSAGE.CANCELED_LINK_TITLE};\n message = <>{MESSAGE.CANCELED_LINK};\n } else if (errorCode === ResponseErrorCode.PayLinkExpired) {\n title = <>{MESSAGE.EXPIRED_LINK_TITLE};\n subTitle = <>{MESSAGE.EXPIRED_LINK_SUB_TITLE};\n message = <>{MESSAGE.EXPIRED_LINK};\n } else if (\n errorCode === ResponseErrorCode.InvalidChargeStatus ||\n errorCode === ResponseErrorCode.PayLinkMissingOrder ||\n errorCode === ResponseErrorCode.PayLinkMissingCharge\n ) {\n title = <>{MESSAGE.INVALID_CHARGE_STATUS_TITLE};\n message = <>{MESSAGE.INVALID_CHARGE_STATUS};\n } else if (errorCode === ResponseErrorCode.NotFound) {\n title = <>{MESSAGE.ORDER_NOT_FOUND_TITLE};\n message = <>{MESSAGE.ORDER_NOT_FOUND};\n } else if (errorCode === ResponseErrorCode.PaylinkChargeAmountModified) {\n title = <>{MESSAGE.ORDER_AMOUNT_MODIFIED_TITLE};\n message = <>{MESSAGE.ORDER_AMOUNT_MODIFIED};\n } else if (errorCode === ResponseErrorCode.MerchantSoftwareError) {\n title = <>{MESSAGE.ERROR_MERCHANT_SOFTWARE_TITLE};\n message = <>{MESSAGE.ERROR_MERCHANT_SOFTWARE};\n } else if (errorCode === ResponseErrorCode.InvalidApiKey) {\n title = <>{MESSAGE.ERROR_INVALID_CONFIGURATION_TITLE};\n message = <>{MESSAGE.ERROR_INVALID_CONFIGURATION};\n } else if (errorCode === ResponseErrorCode.LiveNotApproved) {\n title = <>{MESSAGE.ERROR_LIVE_NOT_APPROVED_TITLE};\n message = <>{MESSAGE.ERROR_LIVE_NOT_APPROVED};\n }\n\n return (\n \n \n \n
{title}
\n {subTitle &&
{subTitle}
}\n
{message}
\n {errorCode === ResponseErrorCode.PaylinkChargeAmountModified ? (\n \n ) : (\n
\n \n Support\n \n
\n )}\n
\n
\n
\n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n errorCode: state.global.error.errorCode,\n show: state.global.error.show,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) => bindActionCreators({}, dispatch);\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ErrorHandler);\n","import './styles/styles.scss';\nimport * as React from 'react';\nimport { Redirect, Route, Switch } from 'react-router';\nimport PortalRoute from './components/PortalRoute';\nimport { ROUTE } from './config';\nimport LoginPage from './pages/LoginPage';\nimport HomePage from './pages/HomePage';\nimport LinkAccountPage from './pages/LinkAccountPage';\nimport LogoutPage from './pages/LogoutPage';\nimport PayLinkPage from './pages/PayLink/PayLinkPage';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { ApplicationState } from './store';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { fetchConfiguration } from './store/actions';\nimport { Helmet } from 'react-helmet';\nimport selectors from './store/selectors';\nimport ErrorHandler from './pages/ErrorHandler';\nimport { ConfigurationStatus } from './store/types';\nimport SignUpPage from './pages/SignUpPage';\n\ninterface StateProps {\n configurationStatus: ConfigurationStatus;\n title: string;\n analyticsWriteKey?: string;\n}\n\ninterface DispatchProps {\n fetchConfiguration: typeof fetchConfiguration;\n}\n\ntype Props = StateProps & DispatchProps;\n\nclass App extends React.PureComponent {\n async componentDidMount() {\n await this.props.fetchConfiguration();\n this.setState({ ready: true });\n }\n\n componentDidUpdate(prevProps: Readonly): void {\n if (prevProps.analyticsWriteKey === this.props.analyticsWriteKey) return;\n if (!this.props.analyticsWriteKey) return;\n\n window.analytics.load(this.props.analyticsWriteKey);\n }\n\n public render() {\n const { configurationStatus, title } = this.props;\n if (configurationStatus === 'unloaded') {\n return null;\n }\n\n return (\n \n \n {title}\n \n \n \n {/* Route processing pay links: l/{code} */}\n \n\n {/* Routes merchant specific, ex: merchant.onstrongholdpay.com */}\n \n\n {/* Restrict to login only for now */}\n \n \n \n \n \n \n \n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n configurationStatus: state.global.configurationStatus,\n title: selectors.global.getTitle(state.global),\n analyticsWriteKey: state.global.configuration.analytics.write_key,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n fetchConfiguration,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n","import { AuthenticationState } from '../types';\nimport { DeepPartial, Reducer } from 'redux';\nimport { IS_AUTHENTICATED, SET_CUSTOMER_TOKEN, SET_TOKEN, UPDATE_CUSTOMER } from '../constants';\nimport { ApplicationAction } from '../actions';\nimport { merge } from 'lodash';\nimport { CustomerModel } from '../../apis';\nimport segment from '../../segment';\n\n// ----------------\n// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state.\n\nexport const unloadedState: AuthenticationState = {\n isAuthenticated: false,\n token: null,\n customer: {\n country: null,\n id: null,\n state: null,\n individual: {\n email: null,\n mobile: null,\n date_of_birth: null,\n first_name: null,\n last_name: null,\n },\n payment_sources: [],\n },\n customerToken: null,\n};\n\nexport const authenticationReducer: Reducer = (\n state = unloadedState,\n action,\n): AuthenticationState => {\n switch (action.type) {\n case IS_AUTHENTICATED:\n if (!action.payload.isAuthenticated) {\n return unloadedState;\n }\n return {\n ...state,\n isAuthenticated: action.payload.isAuthenticated,\n };\n case SET_TOKEN:\n return {\n ...state,\n token: action.payload.token,\n };\n case UPDATE_CUSTOMER:\n const updated = merge, CustomerModel, DeepPartial>(\n {},\n state.customer,\n action.payload.customer,\n );\n segment.identify(updated.id as string);\n return {\n ...state,\n customer: updated,\n };\n case SET_CUSTOMER_TOKEN:\n return {\n ...state,\n customerToken: action.payload.token,\n };\n }\n\n return state;\n};\n","import { ActionStatus, GlobalState } from '../types';\nimport { Reducer } from 'redux';\nimport {\n RESET_ACTION_STATUS,\n SET_ACTION_REQUEST_STATUS,\n SET_ACTION_RESPONSE_ERROR,\n SET_CONFIGURATION,\n SET_CONFIGURATION_STATUS,\n SET_ERROR_MESSAGE,\n SET_PAY_LINK,\n UPDATE_HEADER_TITLE,\n} from '../constants';\nimport { ApplicationAction } from '../actions';\nimport { clone, unionBy } from 'lodash';\nimport { configuration } from '../../config';\nimport { ENVIRONMENT } from '@stronghold/pay-dropin';\nimport { LOCATION_CHANGE } from 'connected-react-router';\nimport segment from '../../segment';\n\n// ----------------\n// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state.\n\nconst unloadedState: GlobalState = {\n actions: [],\n configuration: clone(configuration),\n configurationStatus: 'unloaded',\n error: {\n errorCode: null,\n show: false,\n },\n headerTitle: {\n separator: '-',\n values: [],\n },\n merchant: {\n display_name: '',\n created_at: '',\n id: '',\n image_url: '',\n legal_name: '',\n short_name: '',\n street_location: { city: '', country: '', postcode: '', state: '', street1: '' },\n customization: {\n tip: {\n type: 'fixed',\n value1: 0,\n value2: 0,\n value3: 0,\n },\n items: [],\n },\n },\n publishableApiKey: {\n environment: ENVIRONMENT.live,\n publishable: true,\n key: '',\n created_at: '',\n last_used_at: '',\n },\n};\nconst unloadedActionStatusState: ActionStatus = { name: 'login', isRequesting: false };\n\nexport const globalReducer: Reducer = (\n state: GlobalState = unloadedState,\n action,\n): GlobalState => {\n switch (action.type) {\n case SET_CONFIGURATION:\n segment.environment = action.payload.configuration.analytics.environment;\n return {\n ...state,\n configuration: action.payload.configuration,\n configurationStatus: 'loaded',\n merchant: action.payload.configuration.merchant || state.merchant,\n publishableApiKey: action.payload.configuration.publishable_api_key || state.publishableApiKey,\n };\n case SET_CONFIGURATION_STATUS:\n return {\n ...state,\n configurationStatus: action.payload.status,\n };\n case SET_ERROR_MESSAGE:\n return {\n ...state,\n error: {\n show: true,\n errorCode: action.payload.errorCode,\n },\n };\n case SET_ACTION_REQUEST_STATUS:\n let tmp = state.actions.find((el) => el.name === action.payload.name);\n tmp = tmp\n ? clone(tmp)\n : ({\n ...unloadedActionStatusState,\n name: action.payload.name,\n } as ActionStatus);\n tmp.isRequesting = action.payload.isRequesting;\n return {\n ...state,\n actions: unionBy([tmp], state.actions, (el) => el.name),\n };\n case SET_ACTION_RESPONSE_ERROR:\n return {\n ...state,\n actions: state.actions.map((el) => {\n if (el.name !== action.payload.name) return el;\n return {\n ...el,\n responseError: action.payload.error,\n };\n }),\n };\n case RESET_ACTION_STATUS:\n return {\n ...state,\n actions: unionBy(\n [\n {\n ...unloadedActionStatusState,\n name: action.payload.name,\n },\n ],\n state.actions,\n (el) => el.name,\n ),\n };\n case UPDATE_HEADER_TITLE:\n return {\n ...state,\n headerTitle: {\n ...state.headerTitle,\n ...action.payload.headerPartial,\n },\n };\n case SET_PAY_LINK:\n return {\n ...state,\n publishableApiKey: action.payload.link.api_keys.publishable,\n merchant: action.payload.link.merchant,\n };\n\n case LOCATION_CHANGE:\n return state;\n }\n\n return state;\n};\n","import { PayLinkState } from '../types';\nimport { DeepPartial, Reducer } from 'redux';\nimport { ApplicationAction } from '../actions';\nimport { SET_PAY_LINK, UPDATE_PAY_LINK } from '../constants';\nimport { merge } from 'lodash';\nimport { PayLinkModel } from '../../apis';\n\n// ----------------\n// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state.\n\nconst unloadedState: PayLinkState = {\n data: null,\n};\n\nexport const payLinkReducer: Reducer = (\n state = unloadedState,\n action,\n): PayLinkState => {\n switch (action.type) {\n case SET_PAY_LINK:\n return {\n ...state,\n data: action.payload.link,\n };\n case UPDATE_PAY_LINK:\n if (!state.data) {\n return state;\n }\n return {\n ...state,\n data: merge, PayLinkModel, DeepPartial>(\n {},\n state.data,\n action.payload.payLink,\n ),\n };\n default:\n return state;\n }\n};\n","import { ChargeState } from '../types';\nimport { CLEAN_CHARGES, SET_CHARGES } from '../constants';\nimport { Reducer } from 'redux';\nimport { ApplicationAction } from '../actions';\nimport { segmentListLimit } from '../../apis';\n\n// ----------------\n// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state.\n\nconst unloadedState: ChargeState = {\n list: {\n items: [],\n limit: segmentListLimit,\n skipped: 0,\n total: 0,\n },\n};\n\nexport const chargeReducer: Reducer = (state = unloadedState, action): ChargeState => {\n switch (action.type) {\n case SET_CHARGES:\n return {\n ...state,\n list: action.payload.list,\n };\n case CLEAN_CHARGES:\n return {\n ...state,\n list: unloadedState.list,\n };\n default:\n return state;\n }\n};\n","import {\n ADD_PAYMENT_SOURCE,\n REMOVE_PAYMENT_SOURCE,\n SELECT_PAYMENT_SOURCE,\n SET_PAYMENT_SOURCES,\n UPDATE_PAYMENT_SOURCE,\n IS_NEW_PAYMENT_SOURCE_LINKED,\n} from '../constants';\nimport { Reducer } from 'redux';\nimport { ApplicationAction } from '../actions';\nimport { PaymentSourcesState } from '../types';\nimport { filter, unionBy } from 'lodash';\n\n// ----------------\n// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state.\n\nconst unloadedState: PaymentSourcesState = {\n arr: [],\n paymentSourceSelected: null,\n isNewPaymentSourceLinked: false,\n};\n\nexport const paymentSourcesReducer: Reducer = (\n state = unloadedState,\n action,\n): PaymentSourcesState => {\n switch (action.type) {\n case SET_PAYMENT_SOURCES:\n return {\n ...state,\n arr: action.payload.arr,\n paymentSourceSelected: action.payload.arr.length === 1 ? action.payload.arr[0].id : null,\n };\n case ADD_PAYMENT_SOURCE:\n return {\n ...state,\n arr: [...state.arr, action.payload.data],\n };\n case UPDATE_PAYMENT_SOURCE:\n return {\n ...state,\n arr: unionBy([action.payload.data], state.arr, (el) => el.id),\n paymentSourceSelected:\n action.payload.data.id === state.paymentSourceSelected && !action.payload.data.active\n ? null\n : state.paymentSourceSelected,\n };\n case REMOVE_PAYMENT_SOURCE:\n return {\n ...state,\n arr: filter(state.arr, (item) => item.id !== action.payload.paymentSourceId),\n paymentSourceSelected:\n state.paymentSourceSelected === action.payload.paymentSourceId ? null : state.paymentSourceSelected,\n };\n case SELECT_PAYMENT_SOURCE:\n return {\n ...state,\n paymentSourceSelected: action.payload.paymentSourceId,\n };\n case IS_NEW_PAYMENT_SOURCE_LINKED:\n return {\n ...state,\n isNewPaymentSourceLinked: action.payload.isNewPaymentSourceLinked,\n };\n default:\n return state;\n }\n};\n","import { Reducer } from 'redux';\nimport { ApplicationAction } from '../actions';\nimport { CreditState } from '../types';\nimport { SET_CREDIT_VALUE } from '../constants';\n\nconst unloadedState: CreditState = {\n creditValue: 0,\n};\n\nexport const creditReducer: Reducer = (state = unloadedState, action): CreditState => {\n switch (action.type) {\n case SET_CREDIT_VALUE:\n return {\n ...state,\n creditValue: action.payload.creditValue,\n };\n default:\n return state;\n }\n};\n","import { Reducer } from 'redux';\nimport { ApplicationAction } from '../actions';\nimport { AttributionState } from '../types/attribution';\nimport { SET_INTEGRATION_ID, SET_API_VERSION } from '../constants';\n\nconst unloadedState: AttributionState = {\n integrationId: undefined,\n apiVersion: 'v2',\n};\n\nexport const attributionReducer: Reducer = (\n state = unloadedState,\n action,\n): AttributionState => {\n switch (action.type) {\n case SET_INTEGRATION_ID:\n return {\n ...state,\n integrationId: action.payload.integrationId,\n };\n case SET_API_VERSION:\n return {\n ...state,\n apiVersion: action.payload.apiVersion,\n };\n default:\n return state;\n }\n};\n","import {\n AuthenticationState,\n GlobalState,\n PayLinkState,\n ChargeState,\n PaymentSourcesState,\n SplitIoState,\n CreditState,\n} from './types';\nimport { authenticationReducer, globalReducer, payLinkReducer, chargeReducer, paymentSourcesReducer } from './reducers';\nimport { splitReducer } from '@splitsoftware/splitio-redux';\nimport { creditReducer } from './reducers';\nimport { AttributionState } from './types/attribution';\nimport { attributionReducer } from './reducers/attribution';\n\n// The top-level state object\nexport interface ApplicationState {\n authentication: AuthenticationState;\n payLink: PayLinkState;\n paymentSources: PaymentSourcesState;\n global: GlobalState;\n charge: ChargeState;\n splitio: SplitIoState;\n credits: CreditState;\n attribution: AttributionState;\n}\n\n// Whenever an action is dispatched, Redux will update each top-level application state property using\n// the reducer with the matching name. It's important that the names match exactly, and that the reducer\n// acts on the corresponding ApplicationState property type.\nexport const reducers = {\n authentication: authenticationReducer,\n payLink: payLinkReducer,\n paymentSources: paymentSourcesReducer,\n global: globalReducer,\n charge: chargeReducer,\n splitio: splitReducer,\n credits: creditReducer,\n attribution: attributionReducer,\n};\n\n// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are\n// correctly typed to match your store.\nexport interface AppThunkAction {\n (dispatch: (action: TAction) => void, getState: () => ApplicationState): void;\n}\n","import 'react';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { Provider } from 'react-redux';\nimport { ConnectedRouter } from 'connected-react-router';\nimport { createBrowserHistory } from 'history';\nimport App from './App';\nimport configureStore from './store/configureStore';\n\n// Create browser history to use in the Redux store\nconst baseUrl = document.getElementsByTagName('base')[0].getAttribute('href') as string;\nexport const history = createBrowserHistory({ basename: baseUrl });\n\n// Get the application-wide store instance, prepopulating with state from the server where available.\nconst store = configureStore(history);\n\nReactDOM.render(\n \n \n \n \n ,\n document.getElementById('root'),\n);\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { applyMiddleware, combineReducers, compose, createStore, Store } from 'redux';\nimport thunk from 'redux-thunk';\nimport { connectRouter, routerMiddleware } from 'connected-react-router';\nimport { History } from 'history';\nimport { ApplicationState, reducers } from './';\n\nexport default function configureStore(history: History, initialState?: ApplicationState): Store {\n const middleware = [thunk, routerMiddleware(history)];\n\n const rootReducer = combineReducers({\n ...reducers,\n router: connectRouter(history),\n });\n\n const enhancers = [];\n const windowIfDefined = typeof window === 'undefined' ? null : (window as any);\n if (windowIfDefined && windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__) {\n enhancers.push(windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__());\n }\n\n return createStore(rootReducer, initialState, compose(applyMiddleware(...middleware), ...enhancers));\n}\n"],"sourceRoot":""}