-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
31 lines (26 loc) · 837 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import './App.css';
import IntaSend from "intasend-inlinejs-sdk";
function App() {
// Replace with your public key
const PUBLIC_KEY = "ISPubKey_test_91ffc81a-8ac4-419e-8008-7091caa8d73f";
let instance = new IntaSend({
publicAPIKey: PUBLIC_KEY,
live: false // Set to true when going live
});
const handleClick = () => {
instance
.run({ amount: 10, currency: "KES", api_ref: "ORDER-NUMBER-OR-USER-ID" })
.on("COMPLETE", (response)=>{console.log("COMPLETE:", response)})
.on("FAILED", (response)=>{console.log("FAILED:", response)})
}
return (
<div className="App">
<header className="App-header">
<button onClick={handleClick} className="btn intasend-btn">
Pay now KES 10
</button>
</header>
</div>
);
}
export default App;