npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@dintero/node-sdk

v1.1.1

Published

Node.js library for the Dintero API

Downloads

480

Readme

Dintero Node.js SDK

Build Status

The Dintero Node SDK provides convenient access to the Dintero API from applications written in server-side Javascript

Installation

Install the package with:

npm install @dintero/node-sdk
# or
yarn add @dintero/node-sdk

Usage

To use the Dintero Node.js SDK, you will need to configure it with your API credentials that can be created in the Dintero Backoffice. These credentials include the Client ID, Client Secret, and Audience, which are required for authenticating your requests to the Dintero API.

Example: Client Setup

You first need to create a client with the required credentials:

import { createClient } from "@dintero/node-sdk";

const client = createClient({
    clientId: "your_client_id",   // Replace with your actual client ID
    clientSecret: "your_client_secret",  // Replace with your actual client secret
    audience: "https://api.dintero.com/v1/accounts/your_account_id",
});

export default client;

Example: Session Profile

import { createClient } from "@dintero/node-sdk";

const client = createClient({
    clientId: "your_client_id",   // Replace with your actual client ID
    clientSecret: "your_client_secret",  // Replace with your actual client secret
    audience: "https://api.dintero.com/v1/accounts/your_account_id",
});

const sessionProfileResponse = await client.checkout.POST(
    "/sessions-profile",
    {
        body: {
            url: {
                return_url: "https://example.com",  // Replace with actual return URL
            },
            order: {
                amount: 1000,
                currency: "NOK",
                items: [
                    {
                        id: "item1",
                        line_id: "line1",
                        description: "Item 1",
                        amount: 1000,
                        quantity: 1,
                        vat_amount: 0,
                        vat: 0,
                        eligible_for_discount: false,
                    },
                ],
                partial_payment: false,
                merchant_reference: "ref123",  // Replace with actual merchant reference
            },
            profile_id: "default"
        },
    },
);

console.log("Session Profile Response:", sessionProfileResponse.data);

Example: Fetching Settlement

import { createClient } from "@dintero/node-sdk";

const client = createClient({
    clientId: "your_client_id",   // Replace with your actual client ID
    clientSecret: "your_client_secret",  // Replace with your actual client secret
    audience: "https://api.dintero.com/v1/accounts/your_account_id",
});

const settlementsResponse = await client.core.GET(
    "/accounts/{aid}/settlements",
    {
        params: {
            path: {
                aid: "T12345678",
            },
        },
    },
);

console.log("Settlements Response:", settlementsResponse.data);

Bugs

Bugs can be reported to https://github.com/Dintero/Dintero.Node.SDK/issues

Security

Contact us at [email protected]

Building from source

yarn install
yarn run build