3.1.4 • Published 1 year ago

seerbit-vue v3.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

SeerBit Checkout Wrapper for VueJS

Seerbit Vue SDK can be used to integrate the SeerBit payment gateway into your Vue application. This module was built and tested using VueJS 3.2.13

Requirements

Register for a merchant account on Seerbit Merchant Dashboard to get started. \ --> Login -> Settings menu -> API Keys menu -> Copy your public key

Install

npm install --save seerbit-vue
yarn add seerbit-vue

Properties

PropertyTypeRequiredDefaultDescription
currencystringOptionalNGNThe currency for the transaction e.g NGN
emailstringRequiredNoneThe email of the user to be charged
mobileNostringOptionalNoneThe mobile number of the user to be charged
descriptionstringOptionalNoneThe transaction description which is optional
fullNamestringOptionalNoneThe full name of the user to be charged
countrystringOptional"NG"Transaction country which can be optional
tranrefstringRequiredNoneSet a unique transaction reference for every transaction
amountstringRequiredNoneThe transaction amount in naira
callbackUrlstringOptionalNoneThis is the redirect url when transaction is successful
publicKeystringRequiredNoneYour Public key or see Requirements above to get yours
closeOnSuccessbooleanOptionalFalseClose checkout when trasaction is successful
closePromptbooleanOptionalFalseClose the checkout page if transaction is not initiated
setAmountByCustomerbooleanOptionalFalseSet to true if you want user to enter transaction amount
pocketRefstringOptionalNoneThis is your pocket reference for vendors with pocket
vendorIdstringOptionalNoneThis is the vendorId of your business using pocket
tokenizebooleanOptionalFalseTokenize card
planIdstringOptionalNoneSubcription Plan ID
onCallbackMethodOptionalNoneCallback method if transaction was successful
onCloseCheckoutMethodOptionalNoneCallback method if transaction was cancelled
buttonTextStringOptionalPay With SeerBitText to be displayed on launch button
autoCheckoutbooleanOptionalfalseLaunch checkout automatically if true, or display a pay button if false
customizationObjectOptionalNoneCustomization e.g below
customization: {
  theme: {
    border_color: "#000000",
    background_color: "#004C64",
    button_color: "#0084A0",
  },
  payment_method: ["card", "account", "transfer", "wallet", "ussd"],
  display_fee: true,
  logo: "logo_url | base64",
}

Usage

<script type="text/javascript">
import seerbit from "seerbit-vue";
export default {
  components: {
    seerbit,
  },
  data() {
    return {
      publicKey: "SBTESTPUBK_t4G16GCA1O51AV0Va3PPretaisXubSw1",
      fullName: "John Doe",
      email: "johndoe@mail.com",
      mobileNo: "",
      amount: "5.00",
      planId: "",
      description: "",
      productId: "",
      pocketRef: "",
      tokenize: "",
      currency: "NGN",
      customization: {
        theme: {
          border_color: "#000000",
          background_color: "#004C64",
          button_color: "#0084A0",
        },
        payment_method: ["card", "account", "transfer", "wallet", "ussd"],
        display_fee: true, // true
        display_type: "embed", //inline
        logo: "logo_url | base64",
      },
      callbackurl: "",
    };
  },
  computed: {
    tranref() {
      return Date.now().toString();
    },
  },
  methods: {
    onCallback: function (response) {
      console.log(response);
    },
    onCloseCheckout: function () {
      console.log("checkout closed");
    },
  },
};
</script>

<template>
  <div class="container">
    <seerbit
      :amount="amount"
      :email="email"
      :publicKey="publicKey"
      :tranref="tranref"
      :onCallback="onCallback"
      :onCloseCheckout="onCloseCheckout"
      :planId="planId"
      :customization="customization"
      :pocketRef="pocketRef"
      :callbackurl="callbackurl"
      :tokenize="tokenize"
      :description="description"
      :productId="productId"
      :currency="currency"
      :mobileNo="mobileNo"
      :buttonText="buttonText"
    />
  </div>
</template>

<style>
  .seerbitButton {
    align-self: center;
    background-color: #000000;
    color: #ffffff;
    font-weight: 400; 
    cursor: pointer;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    font-size: 16px;
  }
</style>

License

MIT © seerbit