Skip to content

idorenyinudoh/thepeer-vue

Repository files navigation

thepeer-vue


vue x thepeer


Vue package for Thepeer.

Installation

This package only supports Vue 3.

npm

npm install thepeer-vue

yarn

yarn add thepeer-vue

Usage

Only use in <script setup> or setup().

Applies to Vue and Nuxt.

<script setup lang="ts">
import { useCheckout } from 'thepeer-vue'

const checkoutWithThepeer = () => {
  console.log('initializing sdk')

  useCheckout({
    currency: 'NGN',
    amount: 10000,
    meta: {
      discount: 'black friday'
    },
    onSuccess: (response: any) => {
      console.log('🚀 onSuccess', response)
    },
    onError: (response: any) => {
      console.log('🚀 onError', response)
    },
    onClose: (response: any) => {
      console.log('🚀 onClose', response)
    },
    publicKey: 'YOUR_PUBLIC_KEY',
    email: 'CUSTOMER_EMAIL'
  })
}
</script>

<template>
   <button @click="checkoutWithThepeer">Pay with Thepeer</button>
</template>

Implementation is similar for useSend and useDirectCharge.

Configuration Options

License

MIT © Idorenyin Udoh

About

Vue package for Thepeer.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published