broxpay 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +29 -0
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -58,6 +58,35 @@ function App() {
58
58
  }
59
59
  ```
60
60
 
61
+ ### Option 3: Backend Token (Recommended for Production)
62
+
63
+ For secure server-side initialized transactions, generate a checkout token from your backend and pass it to the component:
64
+
65
+ ```jsx
66
+ import { BroxPayButton } from 'broxpay';
67
+
68
+ function SecureCheckout({ checkoutToken }) {
69
+ // checkoutToken is generated from your backend via BroxPay API
70
+ return (
71
+ <BroxPayButton
72
+ token={checkoutToken}
73
+ onSuccess={(data) => {
74
+ // Verify payment on your server
75
+ fetch('/api/verify-payment', {
76
+ method: 'POST',
77
+ body: JSON.stringify(data)
78
+ });
79
+ }}
80
+ onError={(error) => console.log('Payment failed', error)}
81
+ >
82
+ Complete Payment
83
+ </BroxPayButton>
84
+ );
85
+ }
86
+ ```
87
+
88
+ This approach keeps your secret key on the server and allows you to attach metadata to the transaction.
89
+
61
90
  ## Props
62
91
 
63
92
  ### BroxPayButton
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "broxpay",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Simple React component for BroxPay inline checkout",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,10 +16,10 @@
16
16
  "author": "BroxPay",
17
17
  "license": "MIT",
18
18
  "peerDependencies": {
19
- "react": "^18.0.0"
19
+ "react": "^18.0.0 || ^19.0.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@types/react": "^18.0.0",
22
+ "@types/react": "^18.0.0 || ^19.0.0",
23
23
  "typescript": "^5.0.0"
24
24
  }
25
- }
25
+ }