Skip to content

useHandleNextAction

Invoke the next required action (e.g. 3DS authentication) on a PaymentIntent or SetupIntent without re-confirming it. Wraps stripe.handleNextAction().

Useful when you confirm an intent server-side and only need the client to complete required actions. Must be called within a <VueStripeProvider>.

Usage

vue
<script setup>
import { useHandleNextAction } from '@vue-stripe/vue-stripe'

const { handleNextAction, loading, error } = useHandleNextAction()

const finish = async (clientSecret) => {
  const { paymentIntent, error } = await handleNextAction({ clientSecret })
  if (paymentIntent?.status === 'succeeded') {
    // done
  }
}
</script>

Return Value

PropertyTypeDescription
handleNextAction(options: HandleNextActionOptions) => Promise<any>Runs the next action; resolves to Stripe's native result ({ paymentIntent } / { setupIntent } or { error }).
loadingReadonly<Ref<boolean>>true while the action is in progress.
errorReadonly<Ref<string | null>>The error message if the action failed.

Options

FieldTypeDescription
clientSecretstringClient secret of the PaymentIntent or SetupIntent requiring an action.

Released under the MIT License.