Vue package for Thepeer.
This package only supports Vue 3.
npm install thepeer-vue
yarn add thepeer-vue
Only use in
<script setup>
orsetup()
.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
.
MIT © Idorenyin Udoh