Skip to content

Latest commit

 

History

History
73 lines (59 loc) · 1.5 KB

README.md

File metadata and controls

73 lines (59 loc) · 1.5 KB

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