New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

zarinpal-typescript

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zarinpal-typescript

Simple Zarinpal package written in TypeScript.

  • 3.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

Simple Zarinpal package written in TypeScript.

Installation

# Using npm
npm i zarinpal-typescript

# Using yarn
yarn add zarinpal-typescript

Configuration

import { Zarinpal } from "zarinpal-typescript";

const zp = new Zarinpal("merchant-code", {
  /**
   * Sandbox is for development only
   * And should be turned off in production.
   */
  sandbox: true,
});

Creating invoice

// Create invoice
const createdPayment = await zp.requestPayment({
  amount: 1000, // Toman
  callbackUrl: "https://example.com/my-call-back-url?custom-param=value",
  description: "Invoice description", // This is required!
});

// Redirect user to the createdPayment.url

Verifying the payment (callback)

const amount = 1000;
const authority = "previously-created-authority";

const verifiedPayment = await zp.verifyPayment({ amount, authority });

FAQs

Package last updated on 10 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc