broxpay
v1.2.0
Published
Simple React component for BroxPay inline checkout
Maintainers
Readme
BroxPay React
Simple React component for BroxPay payments.
Install
npm install broxpay- Install:
npm install broxpay - Use: Import
BroxPayButtonand pass yourpublicKey.
Usage
Option 1: Simple (Public Key)
import { BroxPayButton } from 'broxpay';
function App() {
const config = {
publicKey: 'pk_test_123',
amount: 50,
email: '[email protected]'
};
return (
<BroxPayButton
config={config}
onSuccess={(data) => console.log('Paid!', data)}
>
Pay Now
</BroxPayButton>
);
}Option 2: Custom Button
import { useBroxPay } from 'broxpay';
function App() {
const { checkout } = useBroxPay();
const handlePay = () => {
checkout({
publicKey: 'pk_live_...', // Your Public Key
amount: 50,
email: '[email protected]',
onSuccess: (data) => console.log('Paid!', data),
onError: (error) => console.log('Failed', error)
});
};
return <button onClick={handlePay}>Pay Now</button>;
}Props
BroxPayButton
| Prop | Type | Required | Description |
|------|------|----------|-------------|
| config | object | Yes | Configuration object (publicKey, amount, etc.) |
| onSuccess | function | No | Called on success |
| onError | function | No | Called on error |
| onClose | function | No | Called on close |
| children | ReactNode | Yes | Button content |
| className | string | No | CSS class |
| disabled | boolean | No | Disable button |
Support
Email: [email protected]
