0.0.19 • Published 4 months ago

@spot-flow/vue-spotflow-checkout v0.0.19

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

Spotflow Checkout Vue.Js

This Spotflow Vue.js library wraps around the inline library, which enables users to make payments seamlessly. It integrates smoothly into your Vue.js application, providing a streamlined checkout experience.

Available Features:

  • Collections: Card, Bank Transfers, USSD
  • Recurring payments: Tokenization and Subscriptions.

Table of Contents

  1. Requirements
  2. Installation
  3. Usage
  4. License
  5. Contributing Guidelines
  6. Contributors

Requirements

  1. Spoflow Encryption keys
  2. Spotflow API keys
  3. Node versions >= 16.x.x npm >=7.x.x

Demo

Alt text

Installation

To install the library, you can use either Yarn or npm. Choose the one that fits your project setup:

Using Yarn

yarn add @spot-flow/vue-spotflow-checkout

Using NPM

npm install @spot-flow/vue-spotflow-checkout

Usage

payment-component.vue

<template>
 <h1>Payment Component</h1>
 <div>
   <checkout 
     :amount="amount" 
     :currency="currency"
     :email="email" 
     :merchantKey="merchantKey" 
     :encryptionKey="encryptionKey" 
     :planId="planId"
     :localCurrency="localCurrency"
     :callBackUrl="callBackUrl"
     :metadata="{
       productName: 'Product Name'
     }"
   >
     Make Payment
   </checkout>
 </div>
</template>

<script lang="ts">
import checkout from "@spot-flow/vue-spotflow-checkout";
import { defineComponent, ref } from "vue";

export default defineComponent({
 components: {
   checkout,
 },
 data() {
   return {
     amount: 4000, // Not required for subscription payment
     currency: "NGN",
     email: "temi@mailinator.com", 
     merchantKey: "sk_test_fXXXXedhXXXXXXXXXXXXXXXX",
     encryptionKey: "SKKXXXXXXXXXXXXXXXXX", 
     planId: "9e0808304-344d-XXXXXXXXX-XXXXX834034", // Not required for a one time payment
     metadata: {
       productName: "Product Name",
     },
     callBackUrl: "https://website.com",
     localCurrency: "NGN" // Not required if currency is already set to the local currency of the region
   };
 },
});
</script> 

Parameters

Read more about our parameters and how they can be used here.

ParameterRequiredDescription
merchantKeyTrueYour API Secret
referenceFalseYour transaction reference. This MUST be unique for every transaction
amountFalseAmount to charge the customer. NB: this most likely comes from the plan details. This is not required for subscription payments.
currencyTrueCurrency to charge in.
localCurrencyFalseThis is only required when a payment is being made in USD
encryptionKeyTrueThis is the encryption key for the merchant. This is required for card payments.
planIdFalseThis is the plan ID being paid for however, this is not required for one time payments.
firstNameFalseThis is the Customer's First Name
lastNameFalseThis is the Customer's Last Name
phoneFalseThis is the Customer's Phone Number
emailTrueThis is the Customer's Email Address
metadataTrueThis contains other information about the product such as the product name and other additional properties. Product Name should not be passed if planId is being passed
callBackUrlFalseThis is the URL the browser redirects to on success of a payment

Contribution Guidelines

We welcome contributions from the community. Read more about our community contribution guidelines here.

License

By contributing to this library, you agree that your contributions will be licensed under its MIT license.

Copyright (c) Spotflow Inc.

Contributors

0.0.14

9 months ago

0.0.15

8 months ago

0.0.16

8 months ago

0.0.17

6 months ago

0.0.18

6 months ago

0.0.19

4 months ago

0.0.13

9 months ago

0.0.10

10 months ago

0.0.11

10 months ago

0.0.12

9 months ago

0.0.9

10 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago