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

crypttp-acq

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crypttp-acq

Module to call APIs of crypttp

  • 0.0.13
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
14
increased by1300%
Maintainers
1
Weekly downloads
 
Created
Source

Crypttp JS

Installation

1. Download dependency in project directory

npm i -s crypttp-acq

2.

Signup at dashboard https://crypttp.com/dashboard

And copy merchant id

Add to project

Add crypttp module to your project

const Crypttp = require('crypttp-acq')
const crypttp = new Crypttp()

With ES6

import Crypttp from 'crypttp-acq';
const crypttp = new Crypttp()

in Browser

<script src="https://crypttp.com/sdk/js/index-acq.min.js"></script>

Use

/**
 * @param {string} merchant_id      id which you can find at console.crypttp.com
 * @param {string} to               address of wallet where transfer should be sent to
 * @param {string} country_currency only fiat currency
 * @param {string} currency         object with details of transaction
 * @param {string} amount           amount to charge in local currency numeration
 * @param {string} payload          any extra data that you want to send with cryptocurrency transaction
 * @param {string} memo             a special tag for specific blockchains
 * @param {string} onsuccess        url where to redirect user after checkout complete (can be deeplink)
 * @param {string} onerror          url where to redirect user if checkout failed (can be deeplink)
 */

const data = {
    merchant_id: 'example_id',
    to: 'btcaddress1234',
    currency: 'BTC',
    country_currency: 'USD',
    amount: '100', // note that amount will be passed in USD
    onsuccess: 'https://example.com/order_paid', // you also can parse deeplink here
    onerror: 'https://example.com/order_failed' // you also can parse deeplink here
}

crypttp.pay(data)

What will go next

  1. Crypttp will convert automatically convert 100 USD to cryptos

  2. All transaction detailes will be shared with wallets

  3. When transaction will be successfully made wallet will route back user to the onsuccess or onerror link

Server side

If you will use api on the server side it will return string (URL).

Redirect user to that URL or set it as href attribute to redirect user on click.

FAQs

Package last updated on 13 Mar 2020

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