<PushWidget> component that renders the card-entry form, and a <PushUX> component that presents the Push-hosted authentication UI in a modal. Together they cover the browser side of a card payment — collect a card, then complete the step-up authentication requested when authorize-payment returns 202 Accepted (see Presenting the authentication UI).
Install
react and react-dom (>=16.8 <20) are peer dependencies. The package loads the Push core from cdn.pushcash.com at runtime, so if your site uses a Content Security Policy, include https://cdn.pushcash.com in both script-src and frame-src.
<PushWidget>
Renders the Push card-entry form for a user. Collect a card, then call tokenize() through a ref from your submit handler to get a one-time token for authorize-payment. Enable your submit button from onValid.
Props (PushWidgetProps)
Ref (PushWidgetRef)
Attach a ref to call:
Example
<PushUX>
Presents the payment UX for a single intent in a modal — a centered dialog on desktop, a full-page sheet on mobile. Render it once you hold an intent id (typically after your submit handler’s POST /authorize returns 202 Accepted); it opens on mount and renders no markup of its own. Unmount it to end the flow.
Props (PushUXProps)
onExit does not indicate whether the payment succeeded — call get-an-intent (or wait for the intent webhook) and inspect status.
Example
<PushUX> only when you have an intent id. A typical checkout collects the card with <PushWidget> above, calls POST /authorize on submit, and on a 202 Accepted renders <PushUX> with the returned id.