npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tabby-web-sdk

v0.0.3

Published

Web merchant custom implementation for Tabby, the app that lets you split your payments in 4.

Downloads

198

Readme

tabby-web-sdk

A set of utilities and tools that makes it easier to intergrate custom split payment in your web applications using Tabby and its API. Tabby lets you split your purchases into 4 monthly payments so you can worry less and aim for more. And you'll never pay interest or fees.

Table of Contents

Installation

Install the package via npm:

npm install tabby-web-sdk

See below for usage

Usage

Before creating a session, you must first initialize the sdk and provide it your public API key and merchant code which is provided in the custom integration section in the merchant dashboad page of tabby.

Get the puublic API key and merchant code: https://merchant.tabby.ai/

import { Tabby } from "tabby-web-sdk"

const tabbyClient = new Tabby();

tabbyClient.initialize("INSERT API KEY HERE", "INSERT MERCHANT CODE HERE");

** If this is your first time integrating Tabby in your web app, they will provide you a public test key that will be needed to integrate on a development page. After this, you will have to E-mail Tabby this web page where they will have to do a QA to make sure everything in your web app follows their documentation from the flow of the payment to the promo message UI.# tabby-web-sdk

You can now create a session after initiating the Tabby client and the library already provides types if you're already using Typescript to make it easier to create a payload.

Example:


const succesPayload:PaymentRequest = {
    payment: {
        amount: "500.00",
        currency: "AED",
        buyer: {
            email: "[email protected]",
            name: "Tabby Card",
            phone: "+971500000001"
        },
        buyer_history: {
            registered_since: new Date().toISOString(),
            loyalty_level: 0
        },
        shipping_address: {
            address: "Block 13, Silicon Oasis",
            city: "Dubai",
            zip: "00000"
        },
        order: {
            reference_id: "b317f738-5d3d-4f41-8ff1-5b6677432b85",
            items: [

            ]
        },
        order_history: []
    },
    lang: "en",  // Selection between english or arabic (defaulted as english)
    merchant_urls: {
        success: "https://example.com/success",
        cancel: "https://example.com/cancel",
        failure: "https://example.com/failure"
    }, // handle redirect
}

const data = await tabbyClient.createSession(succesPayload);

// on success will return the session link and you need to redirect your page to this link or on fail will return the necessary message to display in your API.

// success object
{
    status: "created",
    link: "URL TO SESSION",
    paymentId: "c8af5861-4c04-416e-9d86-e5f6fd718d3a" // just incase you need to do any logic to payment id IE: sending it to the backend to capture the amount
}

// rejection object
{
    status: "rejected",
    reject_reason: "reason of rejection",
    reject_message: "the rejection message" // you need to display this on the UI
}

** If the session returns a rejection, you must remove the Tabby payment feature in your UI whilst displaying the message.