Skip to content

VueStripePaymentMethodMessagingElement

Displays promotional Buy Now, Pay Later (BNPL) messaging — Affirm, Klarna, Afterpay/Clearpay — based on the order amount and currency. Wraps elements.create('paymentMethodMessaging').

Must be used within <VueStripeElements>. This is a display-only element.

Usage

vue
<template>
  <VueStripeProvider :publishable-key="publishableKey">
    <VueStripeElements>
      <VueStripePaymentMethodMessagingElement
        :options="{
          amount: 1099,
          currency: 'usd',
          paymentMethodTypes: ['klarna', 'afterpay_clearpay', 'affirm'],
          countryCode: 'US'
        }"
        @ready="onReady"
      />
    </VueStripeElements>
  </VueStripeProvider>
</template>

<script setup>
import {
  VueStripeProvider,
  VueStripeElements,
  VueStripePaymentMethodMessagingElement
} from '@vue-stripe/vue-stripe'

const publishableKey = 'pk_test_...'
const onReady = () => console.log('messaging ready')
</script>

Props

PropTypeRequiredDescription
optionsobjectNoElement options: amount, currency, paymentMethodTypes, countryCode. See the Stripe docs.

Events

EventPayloadDescription
@readyStripeElementEmitted when the element is mounted and ready.

Exposed

Via template ref: element, loading, error, and focus() / blur() / clear().

Released under the MIT License.