{"version":3,"sources":["client/index.ts","client/queries.ts","store/configuration.ts","store/customer.ts","store/request.ts","notification.tsx","store/paymentSource.tsx","store/transaction.tsx","store/payLink.ts","store/cardSource.ts","store/index.ts","components/NavMenu.tsx","components/ReferenceLink.tsx","components/Footer.tsx","components/Layout.tsx","pages/Home.tsx","components/TableOfContents.tsx","components/SideBySideLayout.tsx","components/LeftSide.tsx","components/RightSide.tsx","components/CodeSnippet.tsx","components/Loader.tsx","pages/UseCases.tsx","components/sdk/AddPaymentSourceButton.tsx","components/sdk/UpdatePaymentSourceButton.tsx","components/sdk/AddChargeButton.tsx","components/sdk/AddTipButton.tsx","components/AggregatorCredentialsAlert.tsx","pages/SDK.tsx","components/PayLinkButton.tsx","pages/PayLink.tsx","pages/PayLinkCallback.tsx","pages/PayLinkTryIt.tsx","components/sdk/AddCardChargeButton.tsx","components/Configuration.tsx","App.tsx","registerServiceWorker.ts","index.tsx","store/configureStore.ts"],"names":["Client","_client","this","GraphQLClient","a","request","configurationQuery","data","configuration","id","variables","getCustomerTokenQuery","customer","aggregator","resetPaymentSourceMutation","customerId","createSandboxPaymentSourceMutation","createSandboxPaymentSource","paymentSourceId","createChargeMutation","createCharge","amount","token","expirationDate","cvv2","cardType","cardHolderName","zipCode","createCardChargeMutation","console","log","generateTsepManifest","createPayLinkMutation","createPayLink","gql","actionCreators","fetchConfiguration","dispatch","getState","client","getConfiguration","type","payload","search","querystring","url","parse","document","location","href","query","unloadedState","config","apiHost","tsepScriptPath","showCardProcessing","showTsepLogging","aggregators","setCustomerTokenAction","setRequestingAction","requestName","requesting","notify","element","toast","className","setPaymentSourceAction","paymentSource","setChargeAction","charge","setPayLinkConfiguration","tipBeneficiaryName","tipDetailsDisplayMessage","treez","withCallbacks","setCardSourceConfiguration","tsepToken","maskedCardNumber","reducers","state","action","configFound","find","el","name","transaction","payLink","cardSource","replace","trim","addPaymentSource","publishableKey","getCustomerToken","Stronghold","Pay","host","environment","ENVIRONMENT","sandbox","onSuccess","label","onReady","updatePaymentSource","aggregatorName","resetPaymentSource","addCharge","chargeAmount","tipAmount","undefined","tip","beneficiaryName","addCardCharge","createCardCharge","maskedCardNum","addTip","chargeId","tryPayLink","window","history","push","merged","open","NavMenu","isOpen","toggle","setState","Navbar","light","Container","NavbarBrand","tag","Link","to","src","alt","style","height","NavbarToggler","onClick","Collapse","navbar","NavItem","NavLink","target","rel","React","PureComponent","ReferenceLink","props","children","route","connect","Date","getFullYear","Layout","componentDidMount","manifest","obj","JSON","stringify","tsepManifest","Helmet","bindActionCreators","role","TableOfContents","elements","map","key","classes","size","join","anchor","snakeCase","text","Anchor","SideBySideLayout","LeftSide","RightSide","Snippet","Code","Prism","highlightAll","language","code","Loader","Spinner","color","TabName","AddPaymentSourceButton","Button","disabled","data-sh","ownProps","UpdatePaymentSourceButton","AddChargeButton","dataSh","AddTipButton","username","password","Alert","SDK","hidden","paymentSourceLabel","PayLinkButton","withRouter","pay_link_callback","pay_link_id","pay_link_type","payment_source_id","charge_id","tip_id","custom_key","PayLinkTryIt","AddCardChargeButton","isReady","componentDidUpdate","prevProps","onSubmit","UseCases","setPaidTrue","paid","activeTab","PAY_BY_ACH","cardAuth","tsepHandler","eventType","event","responseCode","result","prev","width","Nav","tabs","classnames","active","PAY_BY_CARD","TabContent","TabPane","tabId","value","checked","htmlFor","readOnly","method","data-validate-name","data-auto-formatting","data-validate-cc","data-detect-card-type","data-validate-expiry-date","data-validate-cvv2","data-validate-zipcode","Configuration","position","hideProgressBar","path","component","PayLinkCallback","PayLink","exact","Home","isLocalhost","Boolean","hostname","match","registerValidSW","swUrl","navigator","serviceWorker","register","then","registration","onupdatefound","installingWorker","installing","onstatechange","controller","catch","error","baseUrl","getElementsByTagName","getAttribute","createBrowserHistory","basename","store","initialState","middleware","thunk","routerMiddleware","rootReducer","combineReducers","router","connectRouter","enhancers","windowIfDefined","__REDUX_DEVTOOLS_EXTENSION__","createStore","compose","applyMiddleware","configureStore","ReactDOM","render","App","getElementById","URL","process","toString","origin","addEventListener","fetch","response","contentType","headers","get","status","indexOf","ready","unregister","reload","checkValidServiceWorker","registerServiceWorker"],"mappings":"sMAeMA,G,iBAGF,aAAe,yBAFPC,aAEM,EACVC,KAAKD,QAAU,IAAIE,gBAAc,Y,2FAGrC,4BAAAC,EAAA,sEACuBF,KAAKD,QAAQI,QAA0CC,KAD9E,cACUC,EADV,yBAEWA,EAAKC,eAFhB,gD,2HAKA,WAAuBC,GAAvB,iBAAAL,EAAA,6DACUM,EAAY,CAAED,MADxB,SAGuBP,KAAKD,QAAQI,QAE7BM,IAAuBD,GAL9B,cAGUH,EAHV,yBAMWA,EAAKK,UANhB,gD,8HASA,WAAyBH,EAAYI,GAArC,iBAAAT,EAAA,6DACUM,EAAY,CAAED,KAAII,cAD5B,SAEuBX,KAAKD,QAAQI,QAAwCS,IAA4BJ,GAFxG,cAEUH,EAFV,yBAGWA,GAHX,gD,wIAMA,WAAiCQ,GAAjC,iBAAAX,EAAA,6DACUM,EAAY,CAAEK,cADxB,SAEuBb,KAAKD,QAAQI,QAC5BW,IACAN,GAJR,cAEUH,EAFV,yBAMWA,EAAKU,4BANhB,gD,wHASA,WAAmBF,EAAoBG,GAAvC,iBAAAd,EAAA,6DACUM,EAAY,CAAEK,aAAYG,mBADpC,SAEuBhB,KAAKD,QAAQI,QAAkCc,IAAsBT,GAF5F,cAEUH,EAFV,yBAGWA,EAAKa,cAHhB,gD,8HAMA,WACIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GAPJ,iBAAAvB,EAAA,sEAUcM,EAAY,CAAEW,SAAQC,QAAOC,iBAAgBC,OAAMC,WAAUC,iBAAgBC,WAV3F,SAW2BzB,KAAKD,QAAQI,QAAQuB,IAA0BlB,GAX1E,cAWcH,EAXd,yBAYeA,GAZf,gCAcQsB,QAAQC,IAAR,MAdR,yD,4IAkBA,4BAAA1B,EAAA,+EAE2BF,KAAKD,QAAQI,QAAQ0B,KAFhD,cAEcxB,EAFd,yBAGeA,GAHf,gCAKQsB,Q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A6C,kBAAmBpC,UAAW,CAIvE,GADkB,IAAIqC,IADVC,GACmB3L,OAAOrE,SAASiQ,YACjCC,SAAW7L,OAAOrE,SAASkQ,OAIrC,OAGJ7L,OAAO8L,iBAAiB,QAAQ,WAC5B,IAAM1C,EAAK,UAAMuC,GAAN,sBAEP5C,GAwChB,SAAiCK,GAE7B2C,MAAM3C,GACDI,MAAK,SAACwC,GAEH,IAAMC,EAAcD,EAASE,QAAQC,IAAI,gBACjB,MAApBH,EAASI,QAAmBH,IAAsD,IAAvCA,EAAYI,QAAQ,cAE/DhD,UAAUC,cAAcgD,MAAM9C,MAAK,SAACC,GAChCA,EAAa8C,aAAa/C,MAAK,WAC3BxJ,OAAOrE,SAAS6Q,eAKxBrD,GAAgBC,MAGvBW,OAAM,WACHvP,QAAQC,IAAI,oEAzDRgS,CAAwBrD,GAGxBD,GAAgBC,OCXhCsD,K","file":"static/js/main.95e0ae28.chunk.js","sourcesContent":["import { GraphQLClient } from 'graphql-request';\nimport { Charge, PaymentSource } from 'stronghold-pay-js';\nimport { PayLinkConfiguration } from '../store/payLink';\nimport {\n configurationQuery,\n getCustomerTokenQuery,\n resetPaymentSourceMutation,\n createSandboxPaymentSourceMutation,\n createChargeMutation,\n createPayLinkMutation,\n createCardChargeMutation,\n generateTsepManifest,\n} from './queries';\nimport { AggregatorName, Configuration, GetCustomerTokenResponse } from './types';\n\nclass Client {\n private _client: GraphQLClient;\n\n constructor() {\n this._client = new GraphQLClient('/graphql');\n }\n\n async getConfiguration(): Promise {\n const data = await this._client.request<{ configuration: Configuration }>(configurationQuery);\n return data.configuration;\n }\n\n async getCustomerToken(id?: string): Promise {\n const variables = { id };\n\n const data = await this._client.request<{\n customer: GetCustomerTokenResponse;\n }>(getCustomerTokenQuery, variables);\n return data.customer;\n }\n\n async resetPaymentSource(id: string, aggregator: AggregatorName) {\n const variables = { id, aggregator };\n const data = await this._client.request<{ resetPaymentSource: string }>(resetPaymentSourceMutation, variables);\n return data;\n }\n\n async createSandboxPaymentSource(customerId: string) {\n const variables = { customerId };\n const data = await this._client.request<{ createSandboxPaymentSource: PaymentSource }>(\n createSandboxPaymentSourceMutation,\n variables,\n );\n return data.createSandboxPaymentSource;\n }\n\n async createCharge(customerId: string, paymentSourceId: string) {\n const variables = { customerId, paymentSourceId };\n const data = await this._client.request<{ createCharge: Charge }>(createChargeMutation, variables);\n return data.createCharge;\n }\n\n async createCardCharge(\n amount: number,\n token: string,\n expirationDate: string,\n cvv2: string,\n cardType: string,\n cardHolderName: string,\n zipCode: string,\n ) {\n try {\n const variables = { amount, token, expirationDate, cvv2, cardType, cardHolderName, zipCode };\n const data = await this._client.request(createCardChargeMutation, variables);\n return data;\n } catch (e) {\n console.log(e);\n }\n }\n\n async generateTsepManifest() {\n try {\n const data = await this._client.request(generateTsepManifest);\n return data;\n } catch (e) {\n console.log(e);\n }\n }\n\n async createPayLink(configuration: PayLinkConfiguration) {\n const variables = configuration;\n const data = await this._client.request<{ createPayLink: { id: string; url: string } }>(\n createPayLinkMutation,\n variables,\n );\n return data.createPayLink;\n }\n}\n\nexport * from './types';\nexport default new Client();\n","import { gql } from 'graphql-request';\n\nexport const configurationQuery = gql`\n {\n configuration {\n apiHost\n tsepScriptPath\n showCardProcessing\n showTsepLogging\n aggregators {\n name\n publishableKey\n }\n }\n }\n`;\n\nexport const getCustomerTokenQuery = gql`\n query($id: String) {\n customer(id: $id) {\n id\n token\n }\n }\n`;\n\nexport const resetPaymentSourceMutation = gql`\n mutation($id: String!, $aggregator: Aggregator!) {\n resetPaymentSource(id: $id, aggregator: $aggregator)\n }\n`;\n\nexport const createSandboxPaymentSourceMutation = gql`\n mutation($customerId: String!) {\n createSandboxPaymentSource(customerId: $customerId) {\n id\n label\n }\n }\n`;\n\nexport const createChargeMutation = gql`\n mutation($customerId: String!, $paymentSourceId: String!) {\n createCharge(customerId: $customerId, paymentSourceId: $paymentSourceId) {\n id\n amount\n }\n }\n`;\n\nexport const createCardChargeMutation = gql`\n mutation(\n $amount: Int!\n $token: String!\n $expirationDate: String!\n $cvv2: String!\n $cardType: String!\n $cardHolderName: String!\n $zipCode: String!\n ) {\n createCardCharge(\n amount: $amount\n token: $token\n expirationDate: $expirationDate\n cvv2: $cvv2\n cardType: $cardType\n cardHolderName: $cardHolderName\n zipCode: $zipCode\n )\n }\n`;\n\nexport const generateTsepManifest = gql`\n mutation {\n generateTsepManifest\n }\n`;\n\nexport const createPayLinkMutation = gql`\n mutation(\n $type: PayLinkType!\n $tipBeneficiaryName: String\n $tipDetailsDisplayMessage: String\n $withCallbacks: Boolean\n $treez: Boolean\n ) {\n createPayLink(\n type: $type\n withCallbacks: $withCallbacks\n treez: $treez\n tipBeneficiaryName: $tipBeneficiaryName\n tipDetailsDisplayMessage: $tipDetailsDisplayMessage\n ) {\n id\n url\n }\n }\n`;\n","// -----------------\n// STATE - This defines the type of data maintained in the Redux store.\n\nimport { Reducer } from 'redux';\nimport { AppThunkAction } from './index';\nimport client, { AggregatorConfiguration, AggregatorName, Configuration } from '../client';\nimport url from 'url';\nimport * as querystring from 'querystring';\n\nexport interface ConfigurationState {\n config: Configuration;\n aggregator: AggregatorConfiguration | null;\n}\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// Use @typeName and isActionType for type detection that works even after serialization/deserialization.\n\nexport interface SetConfigurationAction {\n type: 'SET_CONFIGURATION';\n payload: Configuration;\n}\nexport const setConfiguration = (config: Configuration): SetConfigurationAction => ({\n type: 'SET_CONFIGURATION',\n payload: config,\n});\n\nexport interface SetAggregatorConfigAction {\n type: 'SET_AGGREGATOR_CONFIGURATION';\n payload: AggregatorName;\n}\nexport const setAggregatorConfiguration = (aggregatorName: AggregatorName): SetAggregatorConfigAction => ({\n type: 'SET_AGGREGATOR_CONFIGURATION',\n payload: aggregatorName,\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 KnownAction = SetConfigurationAction | SetAggregatorConfigAction;\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 const actionCreators = {\n fetchConfiguration: (): AppThunkAction => async (dispatch, getState) => {\n const configuration = await client.getConfiguration();\n dispatch(setConfiguration(configuration));\n\n const search = querystring.parse(url.parse(document.location.href).query || '');\n const aggregator = search.aggregator as AggregatorName;\n dispatch(setAggregatorConfiguration(aggregator));\n },\n};\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: ConfigurationState = {\n config: { apiHost: '', tsepScriptPath: '', showCardProcessing: '', showTsepLogging: '', aggregators: [] },\n aggregator: null,\n};\n\nexport const reducer: Reducer = (\n state: ConfigurationState = unloadedState,\n action: KnownAction,\n): ConfigurationState => {\n switch (action.type) {\n case 'SET_CONFIGURATION':\n return {\n ...state,\n config: action.payload,\n aggregator: action.payload.aggregators[0] || null,\n };\n case 'SET_AGGREGATOR_CONFIGURATION':\n const configFound = state.config.aggregators.find((el) => el.name === action.payload) || state.aggregator;\n return { ...state, aggregator: configFound };\n default:\n return state;\n }\n};\n","// -----------------\n// STATE - This defines the type of data maintained in the Redux store.\n\nimport { Reducer } from 'redux';\n\nexport interface CustomerState {\n id: string | null;\n token: string | null;\n}\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// Use @typeName and isActionType for type detection that works even after serialization/deserialization.\n\nexport interface SetCustomerIdAction {\n type: 'SET_CUSTOMER_ID';\n payload: string;\n}\nexport interface SetCustomerTokenAction {\n type: 'SET_CUSTOMER_TOKEN';\n payload: string;\n}\nexport const setCustomerTokenAction = (token: string): SetCustomerTokenAction => ({\n type: 'SET_CUSTOMER_TOKEN',\n payload: token,\n});\n\nexport type KnownAction = SetCustomerIdAction | 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 const actionCreators = {};\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: CustomerState = {\n id: null,\n token: null,\n};\n\nexport const reducer: Reducer = (\n state: CustomerState = unloadedState,\n action: KnownAction,\n): CustomerState => {\n switch (action.type) {\n case 'SET_CUSTOMER_ID':\n return {\n ...state,\n id: action.payload,\n };\n case 'SET_CUSTOMER_TOKEN':\n return {\n ...state,\n token: action.payload,\n };\n default:\n return state;\n }\n};\n","// -----------------\n// STATE - This defines the type of data maintained in the Redux store.\n\nimport { Reducer } from 'redux';\n\ntype RequestName =\n | 'add_payment_source'\n | 'update_payment_source'\n | 'add_charge'\n | 'add_tip'\n | 'create_pay_link'\n | 'add_card_source';\n\nexport interface RequestState {\n requesting: RequestName | null;\n}\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// Use @typeName and isActionType for type detection that works even after serialization/deserialization.\n\nexport interface SetRequestingAction {\n type: 'SET_REQUESTING';\n payload: RequestName | null;\n}\nexport const setRequestingAction = (requestName?: RequestName): SetRequestingAction => ({\n type: 'SET_REQUESTING',\n payload: requestName || null,\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 KnownAction = SetRequestingAction;\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 const actionCreators = {};\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: RequestState = {\n requesting: null,\n};\n\nexport const reducer: Reducer = (\n state: RequestState = unloadedState,\n action: KnownAction,\n): RequestState => {\n switch (action.type) {\n case 'SET_REQUESTING':\n return {\n ...state,\n requesting: action.payload,\n };\n default:\n return state;\n }\n};\n","import React from 'react';\nimport { toast } from 'react-toastify';\n\nexport function notify(element: React.ReactNode) {\n toast(() =>
{element}
);\n}\n","// -----------------\n// STATE - This defines the type of data maintained in the Redux store.\n\nimport React from 'react';\nimport { notify } from '../notification';\nimport { Reducer } from 'redux';\nimport { PaymentSource } from 'stronghold-pay-js';\nimport client from '../client';\nimport { setCustomerTokenAction } from './customer';\nimport { ApplicationAction, AppThunkAction } from './index';\nimport { setRequestingAction } from './request';\n\nexport interface PaymentSourceState {\n paymentSource: PaymentSource | null;\n}\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// Use @typeName and isActionType for type detection that works even after serialization/deserialization.\n\nexport interface SetPaymentSourceAction {\n type: 'SET_PAYMENT_SOURCE';\n payload: PaymentSource;\n}\nexport const setPaymentSourceAction = (paymentSource: PaymentSource): SetPaymentSourceAction => ({\n type: 'SET_PAYMENT_SOURCE',\n payload: paymentSource,\n});\n\nexport type KnownAction = SetPaymentSourceAction;\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 const actionCreators = {\n addPaymentSource: (): AppThunkAction => async (dispatch, getState) => {\n const apiHost = getState().configuration.config.apiHost;\n const publishableKey = getState().configuration.aggregator?.publishableKey || '';\n\n dispatch(setRequestingAction('add_payment_source'));\n try {\n const customer = await client.getCustomerToken();\n dispatch({ type: 'SET_CUSTOMER_ID', payload: customer.id });\n dispatch(setCustomerTokenAction(customer.token));\n\n const strongholdPay = Stronghold.Pay({\n host: apiHost,\n environment: Stronghold.ENVIRONMENT.sandbox,\n publishableKey: publishableKey,\n });\n strongholdPay.addPaymentSource(customer.token, {\n onSuccess: (paymentSource) => {\n notify(\n \n Payment source {paymentSource.label} added.\n ,\n );\n dispatch({ type: 'SET_PAYMENT_SOURCE', payload: paymentSource });\n },\n onReady: () => dispatch(setRequestingAction()),\n });\n } finally {\n dispatch(setRequestingAction());\n }\n },\n\n updatePaymentSource: (): AppThunkAction => async (dispatch, getState) => {\n const apiHost = getState().configuration.config.apiHost;\n const publishableKey = getState().configuration.aggregator?.publishableKey || '';\n const paymentSource = getState().paymentSource.paymentSource || null;\n const paymentSourceId = paymentSource?.id || '';\n const customerId = getState().customer.id || '';\n const aggregatorName = getState().configuration.aggregator?.name || 'plaid';\n\n dispatch(setRequestingAction('update_payment_source'));\n try {\n await client.resetPaymentSource(paymentSourceId, aggregatorName);\n const customer = await client.getCustomerToken(customerId);\n dispatch({ type: 'SET_CUSTOMER_ID', payload: customer.id });\n dispatch(setCustomerTokenAction(customer.token));\n\n dispatch(setRequestingAction());\n const strongholdPay = Stronghold.Pay({\n host: apiHost,\n environment: Stronghold.ENVIRONMENT.sandbox,\n publishableKey: publishableKey,\n });\n strongholdPay.updatePaymentSource(customer.token, {\n paymentSourceId,\n onSuccess: () => {\n notify(\n \n Credentials of the payment source {paymentSource?.label} updated.\n ,\n );\n },\n onReady: () => dispatch(setRequestingAction()),\n });\n } finally {\n dispatch(setRequestingAction());\n }\n },\n};\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: PaymentSourceState = {\n paymentSource: null,\n};\n\nexport const reducer: Reducer = (\n state: PaymentSourceState = unloadedState,\n action: KnownAction,\n): PaymentSourceState => {\n switch (action.type) {\n case 'SET_PAYMENT_SOURCE':\n return {\n ...state,\n paymentSource: action.payload,\n };\n default:\n return state;\n }\n};\n","// -----------------\n// STATE - This defines the type of data maintained in the Redux store.\n\nimport React from 'react';\nimport { notify } from '../notification';\nimport { Reducer } from 'redux';\nimport client from '../client';\nimport { setCustomerTokenAction } from './customer';\nimport { ApplicationAction, AppThunkAction } from './index';\nimport { setRequestingAction } from './request';\nimport { Charge } from 'stronghold-pay-js';\nimport { setPaymentSourceAction } from './paymentSource';\n\nexport interface TransactionState {\n charge: Charge | null;\n}\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// Use @typeName and isActionType for type detection that works even after serialization/deserialization.\n\nexport interface SetChargeAction {\n type: 'SET_CHARGE';\n payload: Charge;\n}\nexport const setChargeAction = (payload: Charge): SetChargeAction => ({ type: 'SET_CHARGE', payload });\n\nexport type KnownAction = SetChargeAction;\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 const actionCreators = {\n addCharge: ({\n chargeAmount = 8950,\n tipAmount,\n paymentSourceId,\n }: {\n chargeAmount?: number;\n tipAmount?: number;\n paymentSourceId?: string;\n } = {}): AppThunkAction => async (dispatch, getState) => {\n const apiHost = getState().configuration.config.apiHost;\n const publishableKey = getState().configuration.aggregator?.publishableKey || '';\n const customerId = getState().customer.id || undefined;\n\n dispatch(setRequestingAction('add_charge'));\n try {\n const customer = await client.getCustomerToken(customerId);\n dispatch({ type: 'SET_CUSTOMER_ID', payload: customer.id });\n dispatch(setCustomerTokenAction(customer.token));\n if (!paymentSourceId) {\n const paymentSource = await client.createSandboxPaymentSource(customer.id);\n dispatch(setPaymentSourceAction(paymentSource));\n paymentSourceId = paymentSource.id;\n }\n\n const strongholdPay = Stronghold.Pay({\n host: apiHost,\n environment: Stronghold.ENVIRONMENT.sandbox,\n publishableKey: publishableKey,\n });\n strongholdPay.charge(customer.token, {\n charge: {\n amount: chargeAmount,\n paymentSourceId: paymentSourceId,\n },\n tip: tipAmount\n ? {\n amount: tipAmount,\n beneficiaryName: 'John',\n }\n : undefined,\n onSuccess: (charge) => {\n notify(\n \n Charge with id ${charge.id} created.\n ,\n );\n dispatch(setChargeAction(charge));\n },\n onReady: () => dispatch(setRequestingAction()),\n });\n } catch {\n dispatch(setRequestingAction());\n }\n },\n\n addCardCharge: (data: {\n amount: number;\n token: string;\n expirationDate: string;\n cvv2: string;\n cardType: string;\n maskedCardNum: string;\n cardHolderName: string;\n zipCode: string;\n }): AppThunkAction => async (dispatch, getState) => {\n dispatch(setRequestingAction('add_charge'));\n try {\n await client.createCardCharge(\n data.amount,\n data.token,\n data.expirationDate,\n data.cvv2,\n data.cardType,\n data.cardHolderName,\n data.zipCode,\n );\n notify(\n \n Successfully charged card ending in {data.maskedCardNum} for{' '}\n ${data.amount / 100}.\n ,\n );\n } catch (e) {\n dispatch(setRequestingAction());\n console.log(e);\n } finally {\n dispatch(setRequestingAction());\n }\n },\n\n generateTsepManifest: (): AppThunkAction => async (dispatch, getState) => {\n try {\n const data = await client.generateTsepManifest();\n return data;\n } catch (e) {\n console.log(e);\n }\n },\n\n addTip: ({ tipAmount = 300 }: { tipAmount?: number } = {}): AppThunkAction => async (\n dispatch,\n getState,\n ) => {\n const apiHost = getState().configuration.config.apiHost;\n const publishableKey = getState().configuration.aggregator?.publishableKey || '';\n const customerId = getState().customer.id || undefined;\n\n dispatch(setRequestingAction('add_tip'));\n try {\n const customer = await client.getCustomerToken(customerId);\n dispatch({ type: 'SET_CUSTOMER_ID', payload: customer.id });\n dispatch(setCustomerTokenAction(customer.token));\n const paymentSource = await client.createSandboxPaymentSource(customer.id);\n dispatch(setPaymentSourceAction(paymentSource));\n const charge = await client.createCharge(customer.id, paymentSource.id);\n dispatch(setChargeAction(charge));\n\n const strongholdPay = Stronghold.Pay({\n host: apiHost,\n environment: Stronghold.ENVIRONMENT.sandbox,\n publishableKey: publishableKey,\n });\n strongholdPay.tip(customer.token, {\n tip: {\n amount: tipAmount,\n paymentSourceId: paymentSource.id,\n chargeId: charge.id,\n beneficiaryName: 'John',\n },\n onSuccess: (tip) => {\n notify(\n \n

\n Tip with id ${tip.id} created.\n

\n
\n For the original charge ${charge.id}{' '}\n
\n
,\n );\n },\n onReady: () => dispatch(setRequestingAction()),\n });\n } catch {\n dispatch(setRequestingAction());\n }\n },\n};\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: TransactionState = {\n charge: null,\n};\n\nexport const reducer: Reducer = (\n state: TransactionState = unloadedState,\n action: KnownAction,\n): TransactionState => {\n switch (action.type) {\n case 'SET_CHARGE':\n return {\n ...state,\n charge: action.payload,\n };\n default:\n return state;\n }\n};\n","// -----------------\n// STATE - This defines the type of data maintained in the Redux store.\n\nimport { Reducer } from 'redux';\nimport { ApplicationAction, AppThunkAction } from './index';\nimport { setRequestingAction } from './request';\nimport client from '../client';\nimport { history } from '../index';\nimport url from 'url';\nimport * as querystring from 'querystring';\n\ntype PayLinkType = 'checkout' | 'bank_link' | 'tipping';\n\nexport interface PayLinkConfiguration {\n type: PayLinkType;\n withCallbacks: boolean | null;\n treez: boolean | null;\n tipBeneficiaryName: string | null;\n tipDetailsDisplayMessage: string | null;\n}\n\nexport interface PayLinkState {\n configuration: PayLinkConfiguration;\n}\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// Use @typeName and isActionType for type detection that works even after serialization/deserialization.\n\nexport interface SetPayLinkConfigurationAction {\n type: 'SET_PAY_LINK_CONFIGURATION';\n payload: PayLinkConfiguration;\n}\nexport const setPayLinkConfiguration = (payload: querystring.ParsedUrlQuery = {}): SetPayLinkConfigurationAction => {\n return {\n type: 'SET_PAY_LINK_CONFIGURATION',\n payload: {\n tipBeneficiaryName:\n typeof payload.tipBeneficiaryName === 'string' ? payload.tipBeneficiaryName || null : null,\n tipDetailsDisplayMessage:\n typeof payload.tipDetailsDisplayMessage === 'string' ? payload.tipDetailsDisplayMessage || null : null,\n treez: payload.treez === 'true',\n type: (payload.type as PayLinkType) || 'checkout',\n withCallbacks: payload.withCallbacks === 'false' ? false : true,\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 KnownAction = SetPayLinkConfigurationAction;\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 const actionCreators = {\n tryPayLink: (): AppThunkAction => async (dispatch, getState) => {\n const search = querystring.parse(url.parse(document.location.href).query || '');\n dispatch(setPayLinkConfiguration(search));\n\n try {\n const payLink = await client.createPayLink(getState().payLink.configuration);\n window.location.href = payLink.url;\n } catch (e) {\n history.push('/paylink');\n throw e;\n }\n },\n\n createPayLink: (configuration: Partial = {}): AppThunkAction => async (\n dispatch,\n getState,\n ) => {\n const merged = {\n ...getState().payLink.configuration,\n ...configuration,\n };\n dispatch(setRequestingAction('create_pay_link'));\n try {\n const payLink = await client.createPayLink(merged);\n window.open(payLink.url, '_blank');\n } finally {\n dispatch(setRequestingAction());\n }\n },\n};\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 configuration: {\n type: 'checkout',\n tipBeneficiaryName: null,\n withCallbacks: null,\n treez: null,\n tipDetailsDisplayMessage: null,\n },\n};\n\nexport const reducer: Reducer = (\n state: PayLinkState = unloadedState,\n action: KnownAction,\n): PayLinkState => {\n switch (action.type) {\n case 'SET_PAY_LINK_CONFIGURATION':\n console.log(action.payload);\n return {\n ...state,\n configuration: action.payload,\n };\n default:\n return state;\n }\n};\n","// -----------------\n// STATE - This defines the type of data maintained in the Redux store.\n\nimport { Reducer } from 'redux';\nimport { ApplicationAction, AppThunkAction } from './index';\nimport { setRequestingAction } from './request';\n\nexport interface CardSourceConfiguration {\n cardHolderName: string | null;\n tsepToken: string | null;\n expirationDate: string | null;\n cvv2: string | null;\n cardType: string | null;\n maskedCardNumber: string | null;\n zipCode: string | null;\n}\n\nexport interface CardSourceState {\n configuration: CardSourceConfiguration;\n}\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// Use @typeName and isActionType for type detection that works even after serialization/deserialization.\n\nexport interface SetCardSourceConfigurationAction {\n type: 'SET_CARD_SOURCE_CONFIGURATION';\n payload: CardSourceConfiguration;\n}\nexport const setCardSourceConfiguration = (data: CardSourceConfiguration): SetCardSourceConfigurationAction => {\n return {\n type: 'SET_CARD_SOURCE_CONFIGURATION',\n payload: data,\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 KnownAction = SetCardSourceConfigurationAction;\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 const actionCreators = {\n setCardSourceConfiguration: (data: CardSourceConfiguration): AppThunkAction => async (\n dispatch,\n getState,\n ) => {\n dispatch(setRequestingAction('add_card_source'));\n dispatch(setCardSourceConfiguration(data));\n },\n};\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: CardSourceState = {\n configuration: {\n cardHolderName: '',\n tsepToken: '',\n expirationDate: '',\n cvv2: '',\n cardType: '',\n maskedCardNumber: '',\n zipCode: '',\n },\n};\n\nexport const reducer: Reducer = (\n state: CardSourceState = unloadedState,\n action: KnownAction,\n): CardSourceState => {\n switch (action.type) {\n case 'SET_CARD_SOURCE_CONFIGURATION':\n const expirationDate = action.payload.expirationDate!.replace('/', '');\n const cvv2 = action.payload.cvv2!.trim();\n return {\n ...state,\n configuration: { ...action.payload, expirationDate, cvv2 },\n };\n default:\n return state;\n }\n};\n","import * as configuration from './configuration';\nimport * as customer from './customer';\nimport * as request from './request';\nimport * as paymentSource from './paymentSource';\nimport * as transaction from './transaction';\nimport * as payLink from './payLink';\nimport * as cardSource from './cardSource';\n\n// The top-level state object\nexport interface ApplicationState {\n configuration: configuration.ConfigurationState;\n customer: customer.CustomerState;\n request: request.RequestState;\n paymentSource: paymentSource.PaymentSourceState;\n transaction: transaction.TransactionState;\n payLink: payLink.PayLinkState;\n cardSource: cardSource.CardSourceState;\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 configuration: configuration.reducer,\n customer: customer.reducer,\n request: request.reducer,\n paymentSource: paymentSource.reducer,\n transaction: transaction.reducer,\n payLink: payLink.reducer,\n cardSource: cardSource.reducer,\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\nexport const actionCreators = {\n configuration: configuration.actionCreators,\n customer: customer.actionCreators,\n request: request.actionCreators,\n paymentSource: paymentSource.actionCreators,\n transaction: transaction.actionCreators,\n payLink: payLink.actionCreators,\n cardSource: cardSource.actionCreators,\n};\n\nexport type ApplicationAction =\n | configuration.KnownAction\n | customer.KnownAction\n | request.KnownAction\n | paymentSource.KnownAction\n | transaction.KnownAction\n | payLink.KnownAction\n | cardSource.KnownAction;\n","import 'react';\nimport React from 'react';\nimport { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap';\nimport { Link } from 'react-router-dom';\n\nexport default class NavMenu extends React.PureComponent<{}, { isOpen: boolean }> {\n state = {\n isOpen: false,\n };\n\n render() {\n return (\n
\n \n \n \n \n \n \n \n
    \n
      \n \n \n SDK\n \n \n \n \n PayLink\n \n \n \n \n Use Case\n \n \n \n \n API Docs\n \n \n
    \n
    \n
    \n
    \n
    \n );\n }\n\n private toggle = () => {\n this.setState({\n isOpen: !this.state.isOpen,\n });\n };\n}\n","import React from 'react';\n\nexport default function ReferenceLink(\n props: React.PropsWithChildren<{\n className?: string;\n to: 'api_docs' | 'marketing' | 'dashboard';\n route?: string;\n }>,\n) {\n let href = 'https://docs.strongholdpay.com';\n let children: React.ReactNode | string = 'API Docs';\n\n switch (props.to) {\n case 'dashboard':\n href = 'https://dashboard.strongholdpay.com';\n children = 'Dashboard';\n break;\n case 'marketing':\n href = 'https://stronghold.co';\n children = 'Stronghold';\n break;\n }\n\n children = props.children || children;\n if (props.route) {\n href = `${href}/${props.route}`;\n }\n\n return (\n \n {children}\n \n );\n}\n","import { connect } from 'react-redux';\nimport ReferenceLink from './ReferenceLink';\nimport React from 'react';\n\nconst Footer = () => (\n
    \n
    \n
    \n
    \n \n
    \n
    \n \n \n
    \n
    \n
    © Stronghold 2017 - {new Date().getFullYear()}. All rights reserved.
    \n
    \n
    \n);\n\nexport default connect()(Footer);\n","import NavMenu from './NavMenu';\nimport React from 'react';\nimport Footer from './Footer';\nimport { Helmet } from 'react-helmet';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { actionCreators, ApplicationState } from '../store';\nimport { bindActionCreators, Dispatch } from 'redux';\n\ninterface StateProps {\n tsepScriptPath: string;\n}\n\ninterface DispatchProps {\n generateTsepManifest: typeof actionCreators.transaction.generateTsepManifest;\n}\n\ntype Props = StateProps & DispatchProps;\n\ninterface State {\n tsepManifest: string;\n}\n\nclass Layout extends React.PureComponent {\n constructor(props: Props) {\n super(props);\n this.state = {\n tsepManifest: '',\n };\n }\n\n componentDidMount = async () => {\n try {\n const manifest = await this.props.generateTsepManifest();\n const obj = JSON.parse(JSON.stringify(manifest));\n this.setState({ tsepManifest: obj.generateTsepManifest });\n } catch (e) {\n console.log(e);\n }\n };\n\n render() {\n const { tsepScriptPath } = this.props;\n return (\n
    \n \n \n \n \n \n
    {this.props.children}
    \n
    \n
    \n );\n }\n}\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n tsepScriptPath: state.configuration.config.tsepScriptPath,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n ...actionCreators.transaction,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(Layout);\n","import { connect } from 'react-redux';\nimport { Link } from 'react-router-dom';\nimport React from 'react';\n\nconst Home = () => (\n
    \n
    \n
    \n
    \n Tutorials\n for Stronghold Pay\n
    \n
    \n Quickly get a project started using our tutorials. Human friendly and straightforward.\n
    \n
    \n Here you can find demonstrations to help users quickly get into Stronghold Pay features. The JS\n library, Pay Links and demos are implemented to give you an idea on how to integrate our solution\n with your product.\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Web SDK demos

    \n

    Integrating our Javascript library

    \n

    \n Providing functionality that allows you to add payment processing to your web\n Application.\n

    \n
    \n
    \n \n Learn more\n \n
    \n
    \n
    \n
    \n
    \n
    \n

    Pay Links

    \n

    Delegate user interactions to us

    \n

    Ideal when you don't want to spend time on the payment process.

    \n
    \n
    \n \n Learn more\n \n
    \n
    \n
    \n
    \n
    \n
    \n

    Use Cases

    \n

    A cart summary demonstration

    \n

    A simple checkout flow showing how to integrate our JS library.

    \n
    \n
    \n \n Learn more\n \n
    \n
    \n
    \n
    \n
    \n
    \n);\n\nexport default connect()(Home);\n","import { snakeCase } from 'snake-case';\nimport { HashLink } from 'react-router-hash-link';\nimport React from 'react';\n\nexport interface TableOfContentsElement {\n text: string;\n anchor?: string;\n size?: '1' | '2' | '3';\n}\n\nexport interface TableOfContentsProps {\n elements: Array;\n}\n\nexport const TableOfContents = (props: TableOfContentsProps) => (\n
      \n {props.elements.map((el, key) => {\n const classes = ['nav-link', 'text-dark'];\n\n if (el.size === '2') {\n classes.push('py-1');\n } else if (el.size === '3') {\n classes.push('py-1');\n } else {\n classes.push('h5 mb-0');\n }\n\n return (\n
    • \n \n {el.text}\n \n
    • \n );\n })}\n
    \n);\n\nexport interface AnchorProps extends TableOfContentsElement {}\n\nexport const Anchor = (props: AnchorProps) => {\n const className = ['mt-5 mb-4'].join(' ');\n const id = props.anchor || snakeCase(props.text);\n\n if (props.size === '2') {\n return (\n

    \n {props.text}\n

    \n );\n } else if (props.size === '3') {\n return (\n

    \n {props.text}\n

    \n );\n } else {\n return (\n

    \n {props.text}\n

    \n );\n }\n};\n","import React from 'react';\n\nexport default function SideBySideLayout(props: React.PropsWithChildren<{}>) {\n return (\n
    \n
    \n {props.children}\n
    \n
    \n );\n}\n","import React from 'react';\n\nexport default function LeftSide(props: React.PropsWithChildren<{}>) {\n return (\n
    \n
    {props.children}
    \n
    \n );\n}\n","import React from 'react';\n\nexport default function RightSide(props: React.PropsWithChildren<{}>) {\n return
    {props.children}
    ;\n}\n","import React from 'react';\n\nexport class Snippet extends React.PureComponent<{ children: React.ReactNode }> {\n render() {\n return
    {this.props.children}
    ;\n }\n}\n\nexport class Code extends React.PureComponent<{\n language?: 'language-js' | 'language-http' | 'language-json';\n code: string;\n}> {\n componentDidMount() {\n (window as any).Prism.highlightAll();\n }\n\n render() {\n return {this.props.code};\n }\n}\n","import React from 'react';\nimport { Spinner } from 'reactstrap';\n\nexport default function Loader(props: { size?: string; color?: string; className?: string }) {\n return ;\n}\n","import { connect, MapStateToPropsParam } from 'react-redux';\nimport React from 'react';\nimport { Link } from 'react-router-dom';\nimport AddPaymentSourceButton from '../components/sdk/AddPaymentSourceButton';\nimport AddChargeButton from '../components/sdk/AddChargeButton';\nimport { actionCreators, ApplicationState } from '../store';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport AggregatorCredentialsAlert from '../components/AggregatorCredentialsAlert';\nimport { CardSourceConfiguration, setCardSourceConfiguration } from '../store/cardSource';\nimport { Nav, NavItem, NavLink, TabContent, TabPane } from 'reactstrap';\nimport classnames from 'classnames';\nimport AddCardChargeButton from '../components/sdk/AddCardChargeButton';\n\ninterface StateProps {\n paymentSourceId: string | null;\n paymentSourceLabel: string | null;\n chargeId: string | null;\n showCardProcessing: string | null;\n showTsepLogging: string | null;\n cardHolderName: string | null;\n tsepToken: string | null;\n maskedCardNumber: string | null;\n expirationDate: string | null;\n cvv2: string | null;\n cardType: string | null;\n zipCode: string | null;\n}\n\ninterface DispatchProps {\n setCardSourceConfiguration: typeof setCardSourceConfiguration;\n addCardCharge: typeof actionCreators.transaction.addCardCharge;\n}\n\ntype Props = StateProps & DispatchProps;\n\ninterface State {\n paid: boolean;\n activeTab: number;\n cardAuth: boolean;\n}\n\nenum TabName {\n 'PAY_BY_ACH' = 1,\n 'PAY_BY_CARD' = 2,\n}\n\nclass UseCases extends React.PureComponent {\n constructor(props: Props) {\n super(props);\n this.state = {\n paid: false,\n activeTab: TabName.PAY_BY_ACH,\n cardAuth: false,\n };\n }\n\n componentDidMount() {\n (window as any).tsepHandler = (eventType: any, event: any) => {\n if (this.props.showTsepLogging === 'Y') {\n console.log('Event Type: ' + eventType);\n console.log('Event:');\n console.log(event);\n }\n if (eventType === 'TokenEvent' && event.responseCode === 'A0000') {\n const result = {\n cardHolderName: event.cardHolderName,\n tsepToken: event.tsepToken,\n expirationDate: event.expirationDate,\n cvv2: event.cvv2,\n cardType: event.cardType,\n maskedCardNumber: event.maskedCardNumber,\n zipCode: event.zipCode,\n } as CardSourceConfiguration;\n this.props.setCardSourceConfiguration(result);\n }\n };\n }\n\n componentDidUpdate(prev: Props) {\n if (this.props.chargeId && this.props.chargeId !== prev.chargeId) {\n this.setState({ paid: true });\n }\n }\n\n setPaidTrue = () => {\n this.setState({ paid: true });\n };\n\n render() {\n const props = this.props;\n return (\n
    \n
    \n
    \n
    \n
    Cart Summary
    \n
    This is an example of a checkout page.
    \n
    \n Here the customer reviews their order and the steps required to complete the payment.\n
    \n

    \n It showcases the different Stronghold Pay dropin features.\n

    \n \n Learn more\n \n
    \n
    \n
    \n
    \n
    \n
    \n
    Items
    \n
    \n
    \n \n
    \n
    Monstera Split Leaf
    \n
    \"22\" stem to fit planters and vases.
    \n
    \n x 2\n $34.50\n
    \n
    \n
    \n
    \n \n
    \n
    Palm Leaf
    \n
    \n \"36\" stem perfect for creating unique bouquets.\n
    \n
    \n x 1\n $10.75\n
    \n
    \n
    \n
    \n
    \n
    \n
    Payment Method
    \n
    \n {this.props.showCardProcessing === 'Y' ? (\n \n ) : (\n <>\n )}\n {this.props.showCardProcessing === 'Y' ? (\n \n \n
    \n
    \n {props.paymentSourceLabel ? (\n \n
  • \n
    \n \n \n {props.paymentSourceLabel}\n \n
    \n
  • \n \n ) : (\n
    \n In order to complete a payment, you must securely\n link a bank account.\n
    \n )}\n \n
    \n \n Link a Bank Account\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n {props.tsepToken && this.state.cardAuth ? (\n \n
  • \n
    \n \n \n {`Card ending in ${props.maskedCardNumber}`}\n \n
    \n
  • \n \n ) : (\n
    \n In order to complete a payment by card, you must\n input valid card details.\n
    \n )}\n

    Card Information

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n \n \n ) : (\n
    \n {props.paymentSourceLabel ? (\n
      \n
    • \n
      \n \n \n {props.paymentSourceLabel}\n \n
      \n
    • \n
    \n ) : (\n
    \n In order to complete a payment, you must securely link a bank\n account.\n
    \n )}\n \n
    \n \n Link a Bank Account\n \n
    \n
    \n )}\n
    \n \n \n
    \n
    \n
    \n \n
    845 Market Street
    \n
    San Francisco, California 94105
    \n
    United States
    \n
    \n
    \n\n
    \n
    \n \n
    Subtotal
    \n
    $45.25
    \n
    \n \n
    Tax
    \n
    $4.52
    \n
    \n \n
    Convenience Fee
    \n
    $3.00
    \n
    \n
    \n
    Total
    \n
    $52.77
    \n
    \n
    \n {this.props.showCardProcessing === 'Y' &&\n this.state.activeTab === TabName.PAY_BY_CARD ? (\n this.setPaidTrue()}\n >\n {this.state.paid ? 'PAID' : 'Pay $52.77'}\n \n ) : (\n \n {this.state.paid ? 'PAID' : 'Pay $52.77'}\n \n )}\n {this.props.showCardProcessing === 'Y' &&\n this.state.activeTab === TabName.PAY_BY_CARD ? (\n
    \n By clicking Pay above, you authorize be strong. to\n electronically charge your card for $52.77.\n
    \n ) : (\n
    \n By clicking Pay above, you authorize be strong. to\n electronically debit your{' '}\n \n {props.paymentSourceLabel || 'Bank Account'}\n {' '}\n for $52.77.\n
    \n )}\n
    \n
    \n
    \n \n \n \n \n );\n }\n}\nconst mapStateToProps: MapStateToPropsParam = (state) => ({\n paymentSourceId: state.paymentSource.paymentSource?.id || null,\n paymentSourceLabel: state.paymentSource.paymentSource?.label || null,\n chargeId: state.transaction.charge?.id || null,\n showCardProcessing: state.configuration.config.showCardProcessing,\n showTsepLogging: state.configuration.config.showTsepLogging,\n cardHolderName: state.cardSource.configuration.cardHolderName,\n tsepToken: state.cardSource.configuration.tsepToken,\n maskedCardNumber: state.cardSource.configuration.maskedCardNumber,\n expirationDate: state.cardSource.configuration.expirationDate,\n cvv2: state.cardSource.configuration.cvv2,\n cardType: state.cardSource.configuration.cardType,\n zipCode: state.cardSource.configuration.zipCode,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) =>\n bindActionCreators(\n {\n ...actionCreators.transaction,\n setCardSourceConfiguration,\n },\n dispatch,\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(UseCases);\n","import React from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { Button } from 'reactstrap';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { ApplicationState, actionCreators } from '../../store';\nimport Loader from '../Loader';\n\ninterface StateProps {\n requesting: boolean;\n disabled: boolean;\n}\n\ninterface OwnProps {\n id?: string;\n className?: string;\n children?: React.ReactNode;\n disabled?: boolean;\n}\n\ninterface DispatchProps {\n addPaymentSource: typeof actionCreators.paymentSource.addPaymentSource;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\nclass AddPaymentSourceButton extends React.PureComponent {\n onClick = async () => {\n this.props.addPaymentSource();\n };\n render() {\n return (\n \n {this.props.children || 'Add Payment Source'}\n {this.props.requesting ? : null}\n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (\n state: ApplicationState,\n ownProps: OwnProps,\n) => {\n const apiHost = state.configuration.config.apiHost;\n const publishableKey = state.configuration.aggregator?.publishableKey || null;\n const requesting = state.request.requesting === 'add_payment_source';\n\n return {\n disabled: !apiHost || !publishableKey || requesting || ownProps.disabled === true,\n requesting,\n };\n};\n\nconst mapDispatchToProps = (dispatch: Dispatch) => bindActionCreators(actionCreators.paymentSource, dispatch);\n\nexport default connect(mapStateToProps, mapDispatchToProps)(AddPaymentSourceButton);\n","import React from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { Button } from 'reactstrap';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { ApplicationState, actionCreators } from '../../store';\nimport Loader from '../Loader';\n\ninterface StateProps {\n requesting: boolean;\n disabled: boolean;\n}\n\ninterface OwnProps {\n id?: string;\n className?: string;\n children?: React.ReactNode;\n}\n\ninterface DispatchProps {\n updatePaymentSource: typeof actionCreators.paymentSource.updatePaymentSource;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\nclass UpdatePaymentSourceButton extends React.PureComponent {\n onClick = async () => {\n this.props.updatePaymentSource();\n };\n render() {\n return (\n \n {this.props.children || 'Update Payment Source'}\n {this.props.requesting ? : null}\n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state: ApplicationState) => {\n const apiHost = state.configuration.config.apiHost;\n const publishableKey = state.configuration.aggregator?.publishableKey || null;\n const paymentSource = state.paymentSource.paymentSource || null;\n const requesting = state.request.requesting === 'update_payment_source';\n\n return {\n disabled: !apiHost || !publishableKey || !paymentSource || requesting,\n requesting,\n };\n};\n\nconst mapDispatchToProps = (dispatch: Dispatch) => bindActionCreators(actionCreators.paymentSource, dispatch);\n\nexport default connect(mapStateToProps, mapDispatchToProps)(UpdatePaymentSourceButton);\n","import React from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { Button } from 'reactstrap';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { ApplicationState, actionCreators } from '../../store';\nimport Loader from '../Loader';\n\ninterface StateProps {\n requesting: boolean;\n disabled: boolean;\n}\n\ninterface OwnProps {\n id?: string;\n className?: string;\n children?: React.ReactNode;\n paymentSourceId?: string;\n chargeAmount?: number;\n tipAmount?: number;\n disabled?: boolean;\n dataSh?: string;\n}\n\ninterface DispatchProps {\n addCharge: typeof actionCreators.transaction.addCharge;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\nclass AddChargeButton extends React.PureComponent {\n onClick = async () => {\n this.props.addCharge({\n chargeAmount: this.props.chargeAmount,\n tipAmount: this.props.tipAmount,\n paymentSourceId: this.props.paymentSourceId,\n });\n };\n render() {\n return (\n \n {this.props.children || 'Create a Charge'}\n {this.props.requesting ? : null}\n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (\n state: ApplicationState,\n ownProps: OwnProps,\n) => {\n const apiHost = state.configuration.config.apiHost;\n const publishableKey = state.configuration.aggregator?.publishableKey || null;\n const requesting = state.request.requesting === 'add_charge';\n\n return {\n disabled: !apiHost || !publishableKey || requesting || ownProps.disabled === true,\n requesting,\n };\n};\n\nconst mapDispatchToProps = (dispatch: Dispatch) => bindActionCreators(actionCreators.transaction, dispatch);\n\nexport default connect(mapStateToProps, mapDispatchToProps)(AddChargeButton);\n","import React from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { Button } from 'reactstrap';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { ApplicationState, actionCreators } from '../../store';\nimport Loader from '../Loader';\n\ninterface StateProps {\n requesting: boolean;\n disabled: boolean;\n}\n\ninterface OwnProps {\n id?: string;\n className?: string;\n children?: React.ReactNode;\n tipAmount?: number;\n}\n\ninterface DispatchProps {\n addTip: typeof actionCreators.transaction.addTip;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\nclass AddTipButton extends React.PureComponent {\n onClick = async () => {\n this.props.addTip();\n };\n render() {\n return (\n \n {this.props.children || 'Create a Charge'}\n {this.props.requesting ? : null}\n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state: ApplicationState) => {\n const apiHost = state.configuration.config.apiHost;\n const publishableKey = state.configuration.aggregator?.publishableKey || null;\n const requesting = state.request.requesting === 'add_tip';\n\n return {\n disabled: !apiHost || !publishableKey || requesting,\n requesting,\n };\n};\n\nconst mapDispatchToProps = (dispatch: Dispatch) => bindActionCreators(actionCreators.transaction, dispatch);\n\nexport default connect(mapStateToProps, mapDispatchToProps)(AddTipButton);\n","import { connect, MapStateToPropsParam } from 'react-redux';\nimport React from 'react';\nimport { AggregatorName } from '../client';\nimport { ApplicationState } from '../store';\nimport { Alert } from 'reactstrap';\n\ninterface StateProps {\n aggregator: AggregatorName;\n}\n\ntype Props = StateProps;\n\nconst AggregatorCredentialsAlert = (props: Props) => {\n let username = 'user_good';\n let password = 'pass_good';\n\n if (props.aggregator === 'yodlee') {\n username = 'YodTest.site16441.2';\n password = 'site16441.2';\n }\n\n return (\n \n

    \n You can test a successful payment_source link in the{' '}\n Sandbox environment by logging into any banking institution\n with these test credentials:\n

    \n
    \n Username: {username}\n
    \n
    \n Password:  {password}\n
    \n
    \n );\n};\n\nconst mapStateToProps: MapStateToPropsParam = (state: ApplicationState) => ({\n aggregator: state.configuration.aggregator?.name || 'plaid',\n});\n\nexport default connect(mapStateToProps)(AggregatorCredentialsAlert);\n","import { connect, MapStateToPropsParam } from 'react-redux';\nimport { Anchor, TableOfContents, TableOfContentsElement } from '../components/TableOfContents';\nimport SideBySideLayout from '../components/SideBySideLayout';\nimport LeftSide from '../components/LeftSide';\nimport RightSide from '../components/RightSide';\nimport ReferenceLink from '../components/ReferenceLink';\nimport { Code, Snippet } from '../components/CodeSnippet';\nimport React from 'react';\nimport AddPaymentSourceButton from '../components/sdk/AddPaymentSourceButton';\nimport UpdatePaymentSourceButton from '../components/sdk/UpdatePaymentSourceButton';\nimport AddChargeButton from '../components/sdk/AddChargeButton';\nimport AddTipButton from '../components/sdk/AddTipButton';\nimport { ApplicationState } from '../store';\nimport AggregatorCredentialsAlert from '../components/AggregatorCredentialsAlert';\n\nconst elements: TableOfContentsElement[] = [\n {\n text: 'Introduction',\n },\n {\n text: 'How it works?',\n },\n {\n text: 'Customer Token Generation',\n size: '2',\n },\n {\n text: 'Methods',\n },\n {\n text: 'Add Payment Source',\n size: '2',\n },\n {\n text: 'Update Payment Source',\n size: '2',\n },\n {\n text: 'Charge',\n size: '2',\n },\n {\n text: 'Tip',\n size: '2',\n },\n];\n\ninterface StateProps {\n paymentSourceLabel: string | null;\n}\n\ninterface OwnProps {}\n\ninterface DispatchProps {}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\nclass SDK extends React.PureComponent {\n render() {\n let anchor = 0;\n return (\n \n \n \n \n \n
    \n

    \n SDK Examples\n

    \n

    Integration of our Javascript SDK

    \n

    \n Providing functionality that allows you to add payment processing to your web Application.\n

    \n\n \n

    \n Every method call will result by opening a popup for a specifically targeted customer. Which\n allows us to be aware of the customer information when interacting with our service.\n

    \n\n \n

    \n Our JS Library allows you instantiate a client using a publishable key.\n You'll be able to find your publishable key formatted as pk_sandbox_... on the{' '}\n Developers page of the .\n

    \n \n \n \n

    \n Methods can then be called using a customer token. This token identifies\n the customer using our SDKs.\n

    \n

    \n You can find more information about setting up and using the JS SDK in our{' '}\n .\n

    \n\n \n

    \n A customer token is required in order to make requests to our JS library. This token has a\n 30 minute life span and is customer specific.\n

    \n

    \n Please follow the{' '}\n to\n discover how a customer token generated.\n

    \n\n \n

    \n You can try all the methods available below. The data used behind the scenes for the\n examples is randomly generated and kept private.\n

    \n\n \n

    \n The addPaymentSource method will take the customer through the addition of a\n new payment source.\n

    \n

    A payment source is needed later on in order to perform any kind of payment.

    \n \n \n \n \n Try it\n\n \n

    \n The updatePaymentSource method lets the customer update their credentials for\n an existing payment source.\n

    \n

    \n Payment sources need to be synchronized regularly as up-to-date data is required for\n creating a successful payment. It is possible that a customer needs to re-enter their\n credentials in order to reactivate the synchronization.\n

    \n \n \n \n\n \n
    \n
    \n
    \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state: ApplicationState) => {\n return {\n paymentSourceLabel: state.paymentSource.paymentSource?.label || null,\n };\n};\n\nexport default connect(mapStateToProps)(SDK);\n","import React from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { Button, Spinner } from 'reactstrap';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { ApplicationState, actionCreators } from '../store';\nimport { PayLinkConfiguration } from '../store/payLink';\n\ninterface StateProps {\n requesting: boolean;\n disabled: boolean;\n}\n\ninterface OwnProps {\n id?: string;\n className?: string;\n children?: React.ReactNode;\n configuration?: Partial;\n}\n\ninterface DispatchProps {\n createPayLink: typeof actionCreators.payLink.createPayLink;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\nclass PayLinkButton extends React.PureComponent {\n onClick = async () => {\n this.props.createPayLink(this.props.configuration);\n };\n\n render() {\n return (\n \n {this.props.children || 'Try Pay Link'}\n {this.props.requesting ? : null}\n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (state: ApplicationState) => ({\n disabled: !!state.request.requesting,\n requesting: state.request.requesting === 'create_pay_link',\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch) => bindActionCreators(actionCreators.payLink, dispatch);\n\nexport default connect(mapStateToProps, mapDispatchToProps)(PayLinkButton);\n","import { connect } from 'react-redux';\nimport React from 'react';\nimport SideBySideLayout from '../components/SideBySideLayout';\nimport LeftSide from '../components/LeftSide';\nimport { Anchor, TableOfContents, TableOfContentsElement } from '../components/TableOfContents';\nimport RightSide from '../components/RightSide';\nimport { Code, Snippet } from '../components/CodeSnippet';\nimport ReferenceLink from '../components/ReferenceLink';\nimport PayLinkButton from '../components/PayLinkButton';\nimport AggregatorCredentialsAlert from '../components/AggregatorCredentialsAlert';\n\nconst elements: TableOfContentsElement[] = [\n {\n text: 'Introduction',\n },\n {\n text: 'How it works?',\n },\n {\n text: 'Pay Links',\n },\n {\n text: 'Checkout',\n size: '2',\n },\n {\n text: 'Bank Link',\n size: '2',\n },\n {\n text: 'Tipping',\n size: '2',\n },\n];\n\nconst PayLink = () => {\n let anchor = 0;\n return (\n \n \n \n \n \n

    \n Pay\n Link\n

    \n

    Delegate user interactions to us

    \n

    Ideal when you don't want to spend time on the payment process.

    \n\n \n

    \n A Pay Link is a link that will take the customer to a proper page in order to execute a specific\n action. Those actions can be the addition of a new payment method or a payment for example.\n

    \n

    \n When using a Pay Link, UI integration is not required. Your customers can initiate payments without\n needing to make changes to your original application.\n

    \n

    \n You can find in the {' '}\n explanations how to call the Pay Link endpoints.\n

    \n\n \n

    \n We've built a specific web application to handle Pay Links. This application retrieves information\n about the Pay Link and guides the customer through the payment steps.\n

    \n

    \n A Pay Link is always generated for a specific customer. The response will provide a URL to redirect\n the customer to. When implementing within your applicaiton, you will only need to pull the\n information resulting from that redirection.\n

    \n \n\n \n

    \n All the different Pay Links can be created using the same endpoint. Each type requires different\n information for their creation.\n

    \n\n \n

    \n The checkout link will take the customer through a checkout flow. Details about the\n cart can be provided in order to personalize this page.\n

    \n \n \n \n \n \n \n\n \n Try it\n \n\n \n

    \n The bank_link link allows a customer to add a new payment source. This can be used when\n creating a charge or a tip.\n

    \n \n \n \n \n \n \n \n\n \n Try it\n \n\n \n

    \n The tipping link allows a customer to add a tip on top of a charge\n previously authorized.\n

    \n\n \n \n \n \n \n \n \n\n \n Try it\n \n
    \n
    \n );\n};\n\nexport default connect()(PayLink);\n","import { Link, RouteComponentProps, withRouter } from 'react-router-dom';\nimport React from 'react';\nimport url from 'url';\nimport querystring from 'querystring';\n\nconst PayLinkCallback = (props: RouteComponentProps) => {\n const search = querystring.parse(url.parse(document.location.href).query || '') as {\n pay_link_callback: 'success' | 'exit';\n pay_link_id: string;\n pay_link_type: string;\n payment_source_id?: string;\n charge_id?: string;\n tip_id?: string;\n custom_key?: string;\n };\n\n return (\n
    \n
    \n
    \n
    \n
    \n PayLink {search.pay_link_callback === 'success' ? 'Succeeded' : 'Exited'}\n
    \n

    \n The {search.pay_link_callback} callback url of the PayLink with the code{' '}\n {search.pay_link_id} has been called.\n

    \n

    Here is some complementary information about it.

    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {search.payment_source_id ? (\n \n \n \n \n ) : null}\n {search.charge_id ? (\n \n \n \n \n ) : null}\n {search.tip_id ? (\n \n \n \n \n ) : null}\n {search.custom_key ? (\n \n \n \n \n ) : null}\n \n
    Id\n {search.pay_link_id}\n
    Type\n {search.pay_link_type}\n
    Output\n {search.pay_link_callback}\n
    Payment Source\n {search.payment_source_id}\n
    Charge\n {search.charge_id}\n
    Tip\n {search.tip_id}\n
    \n
    Custom Key
    \n \n You can add you own query parameters. They will be prefixed with{' '}\n custom_ in the callback query parameters.\n \n
    \n My Custom Value\n
    \n
    \n \n Return to the PayLink Page\n \n
    \n
    \n
    \n
    \n
    \n );\n};\n\nexport default withRouter(PayLinkCallback);\n","import { connect, MapStateToPropsParam } from 'react-redux';\nimport React from 'react';\nimport { ApplicationState, actionCreators } from '../store';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport Loader from '../components/Loader';\n\ninterface StateProps {}\n\ninterface DispatchProps {\n tryPayLink: typeof actionCreators.payLink.tryPayLink;\n}\n\ntype Props = StateProps & DispatchProps;\n\nclass PayLinkTryIt extends React.PureComponent {\n componentDidMount() {\n this.props.tryPayLink();\n }\n\n render() {\n return (\n
    \n \n
    \n );\n }\n}\nconst mapStateToProps: MapStateToPropsParam = (state) => ({});\n\nconst mapDispatchToProps = (dispatch: Dispatch) => bindActionCreators(actionCreators.payLink, dispatch);\n\nexport default connect(mapStateToProps, mapDispatchToProps)(PayLinkTryIt);\n","import React from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { Button } from 'reactstrap';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { ApplicationState, actionCreators } from '../../store';\nimport Loader from '../Loader';\n\ninterface StateProps {\n requesting: boolean;\n disabled: boolean;\n}\n\ninterface OwnProps {\n id?: string;\n className?: string;\n children?: React.ReactNode;\n disabled?: boolean;\n dataSh?: string;\n amount: number;\n cardHolderName: string;\n token: string;\n expirationDate: string;\n cvv2: string;\n cardType: string;\n maskedCardNum: string;\n zipCode: string;\n onSubmit: () => void;\n}\n\ninterface State {\n isReady: boolean;\n}\n\ninterface DispatchProps {\n addCardCharge: typeof actionCreators.transaction.addCardCharge;\n}\n\ntype Props = StateProps & OwnProps & DispatchProps;\n\nclass AddCardChargeButton extends React.PureComponent {\n constructor(props: Props) {\n super(props);\n this.state = {\n isReady: false,\n };\n }\n\n onClick = async () => {\n this.setState({ isReady: true });\n };\n\n componentDidUpdate = async (prevProps: Readonly) => {\n if (this.state.isReady && prevProps.token !== this.props.token && this.props.token !== '') {\n try {\n await this.props.addCardCharge({\n amount: this.props.amount,\n token: this.props.token,\n expirationDate: this.props.expirationDate,\n cvv2: this.props.cvv2,\n cardType: this.props.cardType,\n maskedCardNum: this.props.maskedCardNum,\n cardHolderName: this.props.cardHolderName,\n zipCode: this.props.zipCode,\n });\n this.props.onSubmit();\n } catch {\n // handles in toast\n }\n this.setState({ isReady: false });\n }\n };\n\n render() {\n return (\n \n {this.props.children || 'Create a Charge'}\n {this.props.requesting || this.state.isReady ? : null}\n \n );\n }\n}\n\nconst mapStateToProps: MapStateToPropsParam = (\n state: ApplicationState,\n ownProps: OwnProps,\n) => {\n const requesting = state.request.requesting === 'add_charge';\n\n return {\n disabled: requesting || ownProps.disabled === true,\n requesting,\n };\n};\n\nconst mapDispatchToProps = (dispatch: Dispatch) => bindActionCreators(actionCreators.transaction, dispatch);\n\nexport default connect(mapStateToProps, mapDispatchToProps)(AddCardChargeButton);\n","import React from 'react';\nimport { connect, MapStateToPropsParam } from 'react-redux';\nimport { bindActionCreators, Dispatch } from 'redux';\nimport { ApplicationState } from '../store';\nimport { actionCreators } from '../store';\nimport { Helmet } from 'react-helmet';\n\ninterface StateProps {\n apiHost: string | null;\n}\n\ninterface DispatchProps {\n fetchConfiguration: typeof actionCreators.configuration.fetchConfiguration;\n}\n\ntype Props = StateProps & DispatchProps;\n\nclass Configuration extends React.PureComponent {\n async componentDidMount() {\n this.props.fetchConfiguration();\n }\n\n render() {\n if (this.props.apiHost) {\n return (\n \n