@requestnetwork/payment-widget
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Request Network Payment Widget Web Component

A web component for accepting crypto payments using Request Network.

Introduction

The Payment Widget web component is a pre-built component that allows users to offer crypto payment options using Request Network without having to implement it themselves. It is built using Svelte but compiled to a Web Component, making it usuable in any web environment, regardless of the framework.

Installation

To install the component, use npm:

npm install @requestnetwork/payment-widget

Usage

Usage in React

import PaymentWidget from "@requestnetwork/payment-widget/react";

export default function PaymentPage() {
  return (
    <PaymentWidget
      sellerInfo={{
        logo: "https://example.com/logo.png",
        name: "Example Store",
      }}
      productInfo={{
        name: "Digital Art Collection",
        description: "A curated collection of digital artworks.",
        image: "https://example.com/product-image.jpg",
      }}
      amountInUSD={1.5}
      sellerAddress="0x1234567890123456789012345678901234567890"
      supportedCurrencies={["ETH_MAINNET", "USDC_MAINNET", "USDC_MATIC"]}
      persistRequest={true}
      onPaymentSuccess={(request) => {
        console.log(request);
      }}
      onError={(error) => {
        console.error(error);
      }}
    />
  );
}

Additional Information

For more information, see the Request Network documentation.

Readme

Keywords

none

Package Sidebar

Install

npm i @requestnetwork/payment-widget

Weekly Downloads

61

Version

0.2.0

License

MIT

Unpacked Size

76.2 MB

Total Files

49

Last publish

Collaborators

  • rodrigopavezi-request
  • mantisclone-requestnetwork
  • stef.req
  • aimensahnoun
  • benjlevesque
  • request-bot
  • adamdowson
  • yomarion