open-index/open-npm huggingface dataset:
npm package: @sedative-crow25/payment-widget
Description: Add the following scripts to your HTML page:
Latest version: 1.2.2

# Payment Widget Integration Guide

## Quick Start

Add the following scripts to your HTML page:

html
<!-- Required: React and ReactDOM -->
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<!-- Payment Widget -->
<script crossorigin src="https://unpkg.com/@sedative-crow25/payment-widget@1.1.0/dist/payment-widget.umd.js"></script>

Then add the widget to your page:

html
<web-payment-widget
merchant-id="YOUR_MERCHANT_ID"
success-url="https://your-website.com/payment/success"
failure-url="https://your-website.com/payment/failure"
amount="1000"
currency="USD"
api-url="https://your-payment-api.com/api">
</web-payment-widget>

## Event Handling

const widget = document.querySelector('web-payment-widget');
widget.addEventListener('payment-success', (e) => {
console.log('Payment successful:', e.detail);
});
widget.addEventListener('payment-failure', (e) => {
console.log('Payment failed:', e.detail);
});


## Configuration Options

| Attribute | Required | Description |
|-----------|----------|-------------|
| merchant-id | Yes | Your unique merchant identifier |
| api-url | Yes | Your payment API endpoint |
| payment-return-url | Yes | URL to redirect after successful payment |
| program-id | Yes | Program ID to activate |

For more details, please contact us at support@disbursecloud.com