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

@bullring/payment-widget

v1.0.19

Published

The POS for Crypto: Accept Crypto, Get Paid in Local Currency.

Readme

@bullring/payment-widget

Lightning payment widget for web applications.

Getting Started

  1. Download Bullring app from App Store or Play Store
  2. Create account and verify identity
  3. Add bank account
  4. Copy merchant ID from app settings
  5. Install widget:

Installation

npm install @bullring/payment-widget

Or using yarn:

yarn add @bullring/payment-widget

Or using pnpm:

pnpm add @bullring/payment-widget

Basic Usage

Vanilla JavaScript/HTML

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="https://unpkg.com/@bullring/payment-widget/dist/styles.css">
  <script type="module" src="https://unpkg.com/@bullring/payment-widget"></script>
</head>
<body>
  <bullring-payment-widget
    invoice-amount="100"
    merchant-id="your-merchant-id"
    merchant-name="Your Store"
  </bullring-payment-widget>

  <script>
    const widget = document.querySelector('bullring-payment-widget');
    
    widget.addEventListener('payment-success', (e) => {
      console.log('Payment successful:', e.detail);
    });

    widget.addEventListener('payment-error', (e) => {
      console.error('Payment failed:', e.detail);
    });

    widget.addEventListener('close', (e) => {
      console.log('Widget closed, transaction ID:', e.detail);
    });
  </script>
</body>
</html>

React

import "@bullring/payment-widget";

const PaymentComponent = () => {
  const handlePaymentSuccess = (data: any) => {
    console.log('Payment successful:', data);
  };

  const handlePaymentError = (error: Error) => {
    console.error('Payment failed:', error);
  };

  const handleClose = (txId: string) => {
    console.log('Widget closed:', txId);
  };

  return (
     <bullring-payment-widget
          invoice-amount={1000}
          merchant-id={"e6095fa1-4d03-4d6b-8fa8-e77009484a6e"}
          onpaymentSuccess={(txid) => console.log("Payment received:", txid)}
          onpaymentError={(txid) => console.log("Payment received:", txid)}
          onclose={() => {
            console.log("yey!");
            setCount(0);
          }}
        />
  );
};

Vue

<template>
  <bullring-payment-widget
    :invoice-amount="100"
    merchant-id="your-merchant-id"
    merchant-name="Your Store"
    @payment-success="handlePaymentSuccess"
    @payment-error="handlePaymentError"
    @close="handleClose"
  />
</template>

<script setup lang="ts">
import '@bullring/payment-widget';
import '@bullring/payment-widget/dist/styles.css';

const handlePaymentSuccess = (data: any) => {
  console.log('Payment successful:', data);
};

const handlePaymentError = (error: Error) => {
  console.error('Payment failed:', error);
};

const handleClose = (txId: string) => {
  console.log('Widget closed:', txId);
};
</script>

Angular

// app.module.ts
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule],
  schemas: [CUSTOM_ELEMENTS_SCHEMA], // Required for web components
  bootstrap: [AppComponent]
})
export class AppModule {}

// app.component.ts
import { Component, OnInit } from '@angular/core';
import '@bullring/payment-widget';
import '@bullring/payment-widget/dist/styles.css';

@Component({
  selector: 'app-root',
  template: `
    <bullring-payment-widget
      [invoice-amount]="100"
      [merchant-id]="merchantId"
      [merchant-name]="merchantName"
      (paymentSuccess)="onPaymentSuccess($event)"
      (paymentError)="onPaymentError($event)"
      (close)="onClose($event)">
    </bullring-payment-widget>
  `
})
export class AppComponent {
  merchantId = 'your-merchant-id';
  merchantName = 'Your Store';

  onPaymentSuccess(event: CustomEvent) {
    console.log('Payment successful:', event.detail);
  }

  onPaymentError(event: CustomEvent) {
    console.error('Payment failed:', event.detail);
  }

  onClose(event: CustomEvent) {
    console.log('Widget closed:', event.detail);
  }
}

Svelte

<script lang="ts">
  import '@bullring/payment-widget';
  import '@bullring/payment-widget/dist/styles.css';

  const handlePaymentSuccess = (event: CustomEvent) => {
    console.log('Payment successful:', event.detail);
  };

  const handlePaymentError = (event: CustomEvent) => {
    console.error('Payment failed:', event.detail);
  };

  const handleClose = (event: CustomEvent) => {
    console.log('Widget closed:', event.detail);
  };
</script>

<bullring-payment-widget
  invoice-amount={100}
  merchant-id="your-merchant-id"
  merchant-name="Your Store"
  on:payment-success={handlePaymentSuccess}
  on:payment-error={handlePaymentError}
  on:close={handleClose}
/>

API Reference

Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | invoice-amount | number | Yes | Payment amount in the merchant's preferred currency | | merchant-id | string | Yes | Your Bullring merchant ID | | merchant-name | string | No | Display name for your store |

Events

| Event | Detail Type | Description | |-------|------------|-------------| | payment-success | PaymentResponse | Fired when payment is successfully completed | | payment-error | Error | Fired when an error occurs during payment | | close | string | Fired when the widget is closed (includes transaction ID) |

PaymentResponse Type

interface PaymentResponse {
  lightningInvoice: string;
  id: string;
  paymentHash: string | null;
  paymentRequestAmount: number;
  paymentRequestCurrency: string;
  invoiceCurrency: string;
  invoiceAmount: number;
  status: 'unpaid' | 'paid' | 'expired';
  note: string;
  createdAt: string;
  updatedAt: string;
}

Styling

The widget comes with default styles, but you can customize its appearance using CSS variables:

:root {
  /* Add your custom styles here */
}

Browser Support

The widget works in all modern browsers that support Web Components:

  • Chrome/Edge (latest)
  • Firefox (latest)
  • Safari (latest)

Internationalization

Currently supports:

  • English
  • Portuguese

Language detected automatically from browser settings.

Contact

Website: https://bullring.finance

Email: [email protected]

License

MIT

Support

For support, please contact [email protected]