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

click-uz-js

v2.0.2

Published

### Lightweight library to facilitate the integration of Click payment gateway in your backend application.

Downloads

757

Readme

Click.js

Lightweight library to facilitate the integration of Click payment gateway in your backend application.

Basic usage

Shopping api

import { ClickClient } from 'click-uz-js';

// choose the API Type (Merchant API and Shopping API)
const shoppingApi = ClickClient.create('shopping');

// this keys given by click provider
shoppingApi.setConnectionKeys({
    merchant_id: "merchant_id",
    service_id: "service_id",
    user_id: "user_id",
    secret_key: "secret_key"
});

const prepare = await shoppingApi.prepare({
    sign_time: "YYYY-MM-DD HH:mm:ss",
    sign_string: "982c36169csdf89fdsd......",
    error_note: "Success",
    error: 0,
    action: 0,
    merchant_trans_id: "1"
    service_id: 55455,
    click_trans_id: 123456789,
    click_paydoc_id: 1234567,
    amount: 500000
})

// shoppingApi.prepare method returned:
// {
//     click_trans_id: number
//     merchant_trans_id: string
//     merchant_prepare_id: number
//     error: number
//     error_note: string
// }

const complete = await shoppingApi.complete({
    service_id: 55455
    click_trans_id: 123456789,
    click_paydoc_id: 1234567,
    merchant_trans_id: "1",
    amount: 500000,
    action: 0
    error: 0
    error_note: "Success",
    sign_time: "YYYY-MM-DD HH:mm:ss",
    sign_string: "982c36169csdf89fdsd......",
    merchant_prepare_id: 232313231
})

// shoppingApi.complete method returned:
// {
//     click_trans_id: number
//     merchant_trans_id: string
//     merchant_confirm_id: number
//     error: number
//     error_note: string
// }

Merchant api

import { ClickClient } from 'click-uz-js';

// choose the API Type (Merchant API and Shopping API)
const merchantApi = ClickClient.create('merchant');

// this keys given by click provider
merchantApi.setConnectionKeys({
    merchant_id: "merchant_id",
    service_id: "service_id",
    user_id: "user_id",
    secret_key: "secret_key"
});

// interface merchant api
    setConnectionKeys(params: IConnectionKeysParams): void

    createInvoice(params: ICreateInvoiceParams): Promise<ICreateInvoiceResponse>

    checkInvoiceStatus(params: ICheckInvoiceStatusParams): Promise<ICheckInvoiceStatusResponse>
    checkPaymentStatusByMerchantTransId(params: ICheckPaymentStatusByMerchantTransId): Promise<ICheckPaymentStatusByMerchantTransIdResponse>
    checkPaymentStatus(params: ICheckPaymentStatusParams): Promise<ICheckPaymentStatusResponse>

    refundPartial(params: IRefoundPartialParams): Promise<IRefoundPartialResponse>
    cancellationPayment(params: ICancellationPaymentParams): Promise<ICancellationPaymentResponse>

    createTokenCard(params: ICreateTokenCardParams): Promise<ICreateTokenCardResponse>
    verificationTokenCard(params: IVerificationTokenCardParams): Promise<IVerificationTokenCardResponse>

    payWithToken(params: IPayWithTokenParams): Promise<IPayWithTokenResponse>
    deleteTokenCard(params: IDeleteTokenCardParams): Promise<IDeleteTokenCardResponse>


export interface IDeleteTokenCardResponse {
    error_code: number
    error_note: string
}

export interface IDeleteTokenCardParams{
    service_id: number
    card_token: number
}

export interface IPayWithTokenResponse {
    error_code: number
    error_note: string
    payment_id: number
    payment_status: number
}

export interface IPayWithTokenParams{
    card_token: string
    amount: number
    merchant_trans_id: string
}

export interface IVerificationTokenCardResponse {
    error_code: number
    error_note: string
    card_number: string
}

export interface IVerificationTokenCardParams{
    service_id: number
    card_token: string
    sms_code: number
}

export interface ICreateTokenCardResponse{
    error_code: number
    error_note: string
    card_token: string
    phone_number: string
    temporary: boolean
}

export interface ICreateTokenCardParams{
    service_id: number
    card_number: string
    expire_date: string
    temporary: boolean
}

export interface ICreateInvoiceParams{
    service_id: number
    amount: number
    phone_number: string
    merchant_trans_id: string //requestId
}

export interface ICreateInvoiceResponse{
    error_code: number
    error_note: string
    invoice_id: number
}

export interface ICheckInvoiceStatusParams {
    service_id: number
    invoice_id: number
}

export interface ICheckInvoiceStatusResponse{
    error_code: number
    error_note: string
    invoice_status: number
    invoice_status_note: number
}

export interface ICheckPaymentStatusParams{
    payment_id: number
    service_id: number
}

export interface ICheckPaymentStatusResponse{
    payment_id: number
    error_code: number
    error_note: string
    payment_status: number
}

export interface ICheckPaymentStatusByMerchantTransId {
    service_id: number
    merchant_trans_id: string
    YYYY_MM_DD: string
}

export interface ICheckPaymentStatusByMerchantTransIdResponse {
    payment_id: number
    error_code: number
    error_note: string
    payment_status: number
}

export interface ICancellationPaymentParams{
    service_id: number
    payment_id: number
}

export interface ICancellationPaymentResponse {
    payment_id: number
    error_code: number
    error_note: string
}

export interface IRefoundPartialParams {
    payment_id: number
    service_id: number
    amount: number
}

export interface IRefoundPartialResponse {
    error_code: number
    error_note: string
}