Skip to content

Simple package to interact with IDPay's v1.1 API

Notifications You must be signed in to change notification settings

sorooshme/idpay-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

npm install idpay-ts

Intro

This package is written in TypeScript, you can use it in both TypeScript and JavaScript.

Usage

import { IDPay } from "idpay-ts";

const idpay = new IDPay("your-idpay-merchant-code-goes-here", {
  sandbox: true,
  timeout: 5000,
});

(async () => {
  const createdPayment = await idpay.createPayment({
    amount: 1000,
    callback: "https://my-website",
    orderId: "my-order-id",
    description: "This is a description for my payment.",
    payer: {
      emailAddress: "[email protected]",
      name: "PayerNameGoesHere",
      phoneNumber: "09123456789",
    },
  });

  // Gives out link and id of the created transaction. send customer to 'link'

  const verifiedPayment = await idpay.verifyPayment({
    id: createdPayment.body.id,
    orderId: "my-order-id",
  });
})();

License - MIT

About

Simple package to interact with IDPay's v1.1 API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published