1.0.9 • Published 8 months ago

@shayanja/react-crypto-payment v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

React Crypto Payment Component

A beautiful, production-ready React component for accepting cryptocurrency payments.

Installation

npm install @shayanja/react-crypto-payment

Usage

import { CryptoPayment } from '@shayanja/react-crypto-payment'

function App() {
  return (
    <CryptoPayment
      amount={99.99}
      currency="USD"
      productName="Premium Membership"
      description="Access to exclusive content and benefits"
      onPaymentComplete={(txHash) => console.log('Payment successful:', txHash)}
      onPaymentError={(error) => console.error('Payment error:', error)}
      theme="light"
      apiUrl="https://your-backend-url.com"
    />
  )
}

Running the backend

You can run the backend using npm start in the same directory as your React app.

Props

PropTypeDefaultDescription
amountnumberrequiredThe payment amount
currency'USD' | 'EUR' | 'GBP''USD'The currency for the payment
onPaymentComplete(txHash: string) => voidundefinedCallback when payment is successful
onPaymentError(error: Error) => voidundefinedCallback when an error occurs
theme'light' | 'dark''light'The theme of the component
productNamestringundefinedThe product name to show
descriptionstringundefinedThe description of the produc
apiUrlstringundefinedThe API URL for the backend

Features

  • 🎨 Beautiful, production-ready UI
  • 📱 Responsive design
  • 🌗 Light/dark theme support
  • 💱 Multiple cryptocurrency support
  • 📷 QR code generation
  • 📋 Copy-to-clipboard functionality
  • 🔗 Blockchain explorer integration
  • 📦 TypeScript support

License

MIT

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago