Skip to content

Instantly share code, notes, and snippets.

@SimonHoiberg
Created June 19, 2020 15:01
Show Gist options
  • Save SimonHoiberg/02e508a0f3c3265204a9fd433b46931f to your computer and use it in GitHub Desktop.
Save SimonHoiberg/02e508a0f3c3265204a9fd433b46931f to your computer and use it in GitHub Desktop.
const UpdateForm = () => {
// Include these hooks:
const stripe = useStripe();
const elements = useElements();
const [nameInput, setNameInput] = useState('');
const handleUpdatePaymentMethod = async () => {
// Not implemented yet
};
return (
<div>
<input
placeholder='Name on card'
value={nameInput}
onChange={(e) => setNameInput(e.currentTarget.value)}
/>
<CardNumberElement />
<CardExpiryElement />
<CardCvcElement />
<button onClick={handleUpdatePaymentMethod}></button>
</div>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment