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

aamarpay.v2

v1.1.1

Published

A simple library for ammar pay payment gateway

Downloads

12

Readme

aamarPay.v2

aamarpay.v2 is a library used for easy integration of aamarpay payment gateway with node applications

aamarpay.v2 হল একটি লাইব্রেরি যা নোড অ্যাপ্লিকেশনের সাথে aamarpay পেমেন্ট গেটওয়ে সহজে ইন্টিগ্রেশন করার জন্য ব্যাবহৃত হয়

image.png

www.aamarpay.com/

Features

  • Easy setup and easy-to-use API
  • Uses promises, so supports async await syntax

Installation

npm i aamarpay.v2

Usage

import { Payment } from "aamarpay.v2";

const Start = async () => {
  try {
    const Pay = new Payment(
      "aamarpaytest", // store id
      "dbb74894e82415a2f7ff0ec3a97e4183", // signature key
      false // false = sandbox , true = live
    );

    const res = await Pay.init({
      data: {
        amount: "100",
        currency: "BDT",
        cus_email: "[email protected]",
        cus_name: "nahid hasan",
        cus_phone: "01XXXXXXXX",
        desc: "This is a demo",
        tran_id: "202312171066nahid",
        cus_add1: "demo address",
      },
      cancel_url: "/",
      fail_url: "/",
      success_url: "/",
    });
    console.log(res); //return the payment URL
  } catch (error) {
    console.log(error);
  }
};
import { Payment } from "aamarpay.v2";

Payment is a class that makes an instance of a payment object that helps us to create a payment.

payment class Constructor has 3 Parameters

  1. store id = string
  2. signature key = string
  3. is Live = Booleans
new Payment("store_id", "signature_key", isLive);

Example

new Payment("aamarpaytest", "dbb74894e82415a2f7ff0ec3a97e4183", false);

this credential was provided by Aamarpay Sandbox docs check here

init method

[instance].init(payload);

replace instance to your payment object

Payload is an Object that has property 4 property

  1. data = object
  2. cancel_url = URL to redirect when the payment was canceled
  3. fail_url = URL to redirect when the payment was fail
  4. success_url = URL to redirect when the payment was successful and this endpoint also work as webhooks

Data Object Property :

{
  amount: string;
  currency: "BDT" | "USD" | "EUR"| "INR" | "PKR" | "CAD"| "AUD" | "CNY" | "RUB"| "SAR" | "QAR";
  desc: string;
  cus_name: string;
  cus_email: string;
  cus_phone: string;
  tran_id: string; //this should uniq in every transaction
  cus_city?: string; // optional
  cus_state?: string; // optional
  cus_country?: string; // optional
  cus_postcode?: string; // optional
  cus_add1?: string; // optional
  cus_add2?: string; // optional
  opt_a?: string; // optional
  opt_b?: string; // optional
  opt_c?: string; // optional
  opt_d?: string; // optional
}

typeScript type:

import { AamarpayRequestData } from "aamarpay.v2";

and the init() method returned a promise and the result was a URL for the payment page


Search method:

[instance].Search("transactions_id");

replace instance to your payment object

this method is used to retrieve the transaction information base on transaction id;

this return a promise and result is

{
  pg_txnid: string;
  mer_txnid: string;
  risk_title: string;
  risk_level: string | null;
  cus_name: string;
  cus_email: string;
  cus_phone: string;
  cus_add1: string;
  cus_add2: string;
  cus_city: string;
  cus_state: string;
  cus_postcode: string;
  cus_country: string;
  cus_fax: string;
  ship_name: string | null;
  ship_add1: string | null;
  ship_add2: string | null;
  ship_city: string | null;
  ship_state: string | null;
  ship_postcode: string | null;
  ship_country: string | null;
  desc: string | null;
  merchant_id: string;
  store_id: string;
  amount: string;
  amount_bdt: string;
  pay_status: string;
  status_code: string;
  status_title: string;
  cardnumber: string;
  approval_code: string;
  payment_processor: string;
  bank_trxid: string;
  payment_type: string;
  error_code: string;
  error_title: string;
  bin_country: string;
  bin_issuer: string;
  bin_cardtype: string;
  bin_cardcategory: string;
  date: string;
  date_processed: string;
  amount_currency: string;
  rec_amount: string;
  processing_ratio: string;
  processing_charge: string;
  ip: string;
  currency: string;
  currency_merchant: string;
  convertion_rate: string;
  opt_a: string;
  opt_b: string;
  opt_c: string;
  opt_d: string;
  verify_status: string;
  call_type: string;
  email_send: string;
  doc_recived: string;
  checkout_status: string;
}

typeScript type:

import { TransactionInfo } from "aamarpay.v2";

if you want to know more check out aamarpay official website

www.aamarpay.com/


terms

The software is given in its current state with no guarantees, whether explicitly stated or implied. This includes assurances of its suitability for a specific purpose, merchantability, or overall quality. The author or copyright holder cannot be held responsible for any claims, damages, or other liabilities arising from the use or transactions related to the software, whether through contract, tort, or any other legal grounds.