Catalog npm
Back to packageRELEASE DETAILS

1.0.0

npm

1d3-sdk

1D3 Javascript package

Published14 Dec 2023
Direct dependencies4
Transitive dependenciesNot calculated

README

Current package documentation

1D3 Javascript package

What is it?

It is package that will help you with generating payment URL according to 1D3 documentation.

How to use?

Get checkout page URL

  1. Install the package (with your package manager):
npm install 1d3-sdk
yarn add 1d3-sdk
  1. Require somewhere in your code, set parameters and get the URL:
const { Payment } = require('1d3-sdk');

// create Payment object with your account ID and secret salt
const e = new Payment('112', 'my_secret');

// set payment details 
e.paymentAmount = 1000;
e.paymentId = 'FFCD12-30';
e.paymentCurrency = 'USD';

// set another parameters, like success or fail callback URL, customer details, etc.

// get payment URL
const url = e.getUrl();

Now your can render payment url somewhere on your checkout page.

Receive callback from 1D3

Example with Express:

const { Callback } = require('1d3-sdk');

app.post('/payment/callback', function(req, res) {
  const callback = new Callback('secret', req.body);
  if (callback.isPaymentSuccess()) {
    const paymentId = callback.getPaymentId();
    // here is your code for success payment
  }
});

Note that Callback constructor throws Error if signature isn't valid.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 4

Native requirements
4 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^4.19.1development
eslint-config-airbnb-base
Environment
{
  "local_name": "eslint-config-airbnb-base",
  "alias": false,
  "peer_metadata": null
}
^13.0.0development
eslint-plugin-import
Environment
{
  "local_name": "eslint-plugin-import",
  "alias": false,
  "peer_metadata": null
}
^2.13.0development
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
^23.2.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-w41Atcpky34EcWso7iFIYPCURcjWOEn9+0q8sXk2Q9nL6yQxBt4E+uXMKgdPis7MezV69VsCCzo9sN4Ovpp7Bg==",
  "shasum": "15f03592efb986359f08f63ff302e2b81abfc1f1",
  "tarball": "https://registry.npmjs.org/1d3-sdk/-/1d3-sdk-1.0.0.tgz",
  "fileCount": 8,
  "unpackedSize": 9042,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIFrfBnjBN4mf8II05a7bwy1FmDMrNPPZoo1VvKzfHT9hAiAowaSiToaNksBDz/Gfs6/IvTE7cuQPFvD+U4C8ly0vbQ=="
    }
  ]
}

Repository

PENDING
dev1d3/checkoutpage-sdk-js

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:27 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:341289ebdf33dedbd2f65cfeff6676befd192b84589a0a620a96263f7593467c

Other collected versions

1.0.114 DecView all collected versions →