Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crypttp

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crypttp

Module to call APIs of crypttp powered by alemey

  • 0.4.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by25%
Maintainers
1
Weekly downloads
 
Created
Source

Crypttp JS

Installation

1. Download dependency in project directory

npm i -s crypttp

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')
const crypttp = new Crypttp()

With ES6

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

in Browser

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

Use

/**
 * @param {string} type             0 - for navigation, 1 - for invoice, 2 for transfer to specified address (not from db)
 * @param {string} merchant_id      id which you can find at console.crypttp.com
 * @param {object} to               object 'currency':'address' of wallets for each currency, where transfer should be sent. Used for type:2
 * @param {string} country_currency object with details of transaction
 * @param {string} currency         only fiat currency
 * @param {string} amount           amount to charge in native 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 = {
    type: '2',
    merchant_id: 'example_id',
    to: {
        BTC:'btcaddress1234'
    },
    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 22 Feb 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