Function PaymentReceipt

  • Component for rendering a OneBlink Form Payment Receipt. This component will payment receipt but it is up to the developer to implement what happens when the user clicks 'Done'.

    It is also recommended to import the css from this library as well.

    import { PaymentReceipt } from '@oneblink/apps-react'
    import '@oneblink/apps-react/dist/styles.css'

    Example

    import React from 'react'
    import ReactDOM from 'react-dom'
    import { PaymentReceipt } from '@oneblink/apps-react'
    import '@oneblink/apps-react/dist/styles.css'

    function ReceiptContainer() {
    const handleDone = React.useCallback(async () => {
    console.log('All done!')
    }, [])
    const handleCancel = React.useCallback(async () => {
    console.log('Cancelled!')
    }, [])

    return <PaymentReceipt onDone={handleDone} onCancel={handleCancel} />
    }

    function App() {
    return (
    <IsOfflineContextProvider>
    <ReceiptContainer />
    </IsOfflineContextProvider>
    )
    }

    const root = document.getElementById('root')
    if (root) {
    ReactDOM.render(<App />, root)
    }

    Parameters

    • props: {
          onCancel: ((submissionResult) => Promise<void>);
          onDone: ((submissionResult) => Promise<void>);
      }
      • onCancel: ((submissionResult) => Promise<void>)
          • (submissionResult): Promise<void>
          • The function to call when the user clicks 'Cancel'. See FormSubmissionResult for the structure of the argument.

            Parameters

            • submissionResult: FormSubmissionResult

            Returns Promise<void>

      • onDone: ((submissionResult) => Promise<void>)
          • (submissionResult): Promise<void>
          • The function to call when the user clicks 'Done'. See FormSubmissionResult for the structure of the argument.

            Parameters

            • submissionResult: FormSubmissionResult

            Returns Promise<void>

    Returns null | ReactElement<any, string | JSXElementConstructor<any>>