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 🙏

© 2025 – Pkg Stats / Ryan Hefner

droplinked-payment-hub

v0.2.19

Published

A unified payment component that handles different payment providers

Downloads

1,473

Readme

Droplinked Payment Intent

A React component for implementing Droplinked payment gateway.

Installation

Install the package using npm:

npm install @droplinked/payment-intent

Payment Types

The payment type is determined by the Droplinked backend. You can fetch available payment methods for a cart using the following API endpoint:

GET /v2/carts/{cartId}/payment-methods

Currently supported payment types:

  • stripe: Credit card payments via Stripe
  • USDT-BINANCE: USDT payments on Binance network

Usage

  1. Import the component:
import { DroplinkedPaymentIntent } from '@droplinked/payment-intent';
  1. Use the component in your code:
<DroplinkedPaymentIntent
  orderId="123456"             // Order ID for the payment
  type="stripe"                // Payment provider (from Droplinked API)
  intentType="payment"         // Transaction type (payment or setup)
  onSuccess={() => {          // Callback for successful payment
    console.log('Payment successful');
  }}
  onCancel={() => {           // Callback for cancelled payment
    console.log('Payment cancelled');
  }}
  onError={(error) => {       // Callback for payment errors
    console.error('Error:', error);
  }}
/>

Props

| Name | Type | Required | Description | |------|------|----------|-------------| | orderId | string | Yes | Order ID for the payment | | type | string | Yes | Payment provider type (from Droplinked API) | | intentType | string | No | Transaction type ('payment' or 'setup'). Default: 'payment' | | onSuccess | function | Yes | Called after successful payment | | onCancel | function | Yes | Called when payment is cancelled | | onError | function | Yes | Called when an error occurs | | return_url | string | No | URL to redirect after payment | | isTestnet | boolean | No | Use testnet environment. Default: false |

Examples

Stripe Payment

import { DroplinkedPaymentIntent } from '@droplinked/payment-intent';

function StripePaymentPage() {
  const [paymentMethods, setPaymentMethods] = useState([]);
  const cartId = '123456';

  useEffect(() => {
    // Fetch available payment methods from Droplinked API
    fetch(`https://api.droplinked.com/v2/carts/${cartId}/payment-methods`)
      .then(response => response.json())
      .then(data => setPaymentMethods(data));
  }, [cartId]);

  return (
    <div style={{ maxWidth: '600px', margin: '0 auto', padding: '20px' }}>
      <h1>Credit Card Payment</h1>
      
      <DroplinkedPaymentIntent
        orderId={cartId}
        type="stripe"
        intentType="payment"
        isTestnet={process.env.NODE_ENV === 'development'}
        return_url="https://your-website.com/payment/success"
        onSuccess={() => {
          console.log('Payment successful');
          window.location.href = '/success';
        }}
        onCancel={() => {
          console.log('Payment cancelled');
          window.location.href = '/cancel';
        }}
        onError={(error) => {
          console.error('Payment error:', error);
          alert('Payment failed. Please try again.');
        }}
        commonStyle={{
          theme: 'light',
          fontFamily: 'system-ui, sans-serif',
          colorPrimary: '#4F46E5',
        }}
      />
    </div>
  );
}

USDT-BINANCE Payment

import { DroplinkedPaymentIntent } from '@droplinked/payment-intent';

function CryptoPaymentPage() {
  const cartId = '123456';

  return (
    <div style={{ maxWidth: '600px', margin: '0 auto', padding: '20px' }}>
      <h1>USDT Payment</h1>
      
      <DroplinkedPaymentIntent
        orderId={cartId}
        type="USDT-BINANCE"
        intentType="payment"
        onSuccess={() => {
          console.log('USDT payment successful');
          window.location.href = '/success';
        }}
        onCancel={() => {
          console.log('USDT payment cancelled');
          window.location.href = '/cancel';
        }}
        onError={(error) => {
          console.error('USDT payment error:', error);
          alert('Payment failed. Please try again.');
        }}
        commonStyle={{
          theme: 'dark',
          fontFamily: 'system-ui, sans-serif',
          colorPrimary: '#F0B90B', // Binance yellow
        }}
      />
    </div>
  );
}

Styling

You can customize the component's appearance using commonStyle:

<DroplinkedPaymentIntent
  // ... other props
  commonStyle={{
    // Colors
    colorPrimary: '#4F46E5',
    colorContainer: '#FFFFFF',
    colorBorderInput: '#E5E7EB',
    
    // Font
    fontFamily: 'system-ui, sans-serif',
    fontSizeLabel: '14px',
    fontSizeInput: '16px',
    
    // Button styles
    submitButton: {
      backgroundColor: '#4F46E5',
      textColor: '#FFFFFF',
      fontSize: '14px',
      fontWeight: 500,
    },
    cancelButton: {
      backgroundColor: '#F3F4F6',
      textColor: '#4B5563',
      fontSize: '14px',
      fontWeight: 500,
    }
  }}
/>