thepeer-vue

0.0.11 • Public • Published

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

Package Sidebar

Install

npm i thepeer-vue

Weekly Downloads

2

Version

0.0.11

License

MIT

Unpacked Size

8.73 kB

Total Files

11

Last publish

Collaborators

  • idorenyinudoh