Payment results
Payment results are returned by the events emitter.

How to capture payment results after payment with the JavaScript SDK

IntaSend SDK event returns results with details like api_ref, charges incurred, etc.
1
new window.IntaSend({
2
publicAPIKey: "<REPLACE-WITH-YOUR-PUBLISHABLE-KEY>",
3
live: false //set to true when going live
4
})
5
.on("COMPLETE", (results) => console.log(results))
6
.on("FAILED", (failed_results) => console.log(failed_results))
Copied!
Below is a sample result returned for your reference.
1
{
2
"tracking_id": "NLSK100",
3
"state": "PENDING",
4
"provider": "CARD-PAYMENT",
5
"charges": "0.00",
6
"net_amount": 10.36,
7
"currency": "KES",
8
"value": "10.36",
9
"account": "[email protected]",
10
"api_ref": "ISL_faa26ef9-eb08-4353-b125-ec6a8f022815",
11
"host": "https://sandbox.intasend.com",
12
"failed_reason": null,
13
"created_at": "2021-04-11T08:37:15.781977+03:00",
14
"updated_at": "2021-04-11T08:37:15.782011+03:00"
15
"meta": {
16
"id": "5aec8e0b-8d96-429b-98b7-5361198160bd",
17
"customer": {
18
"id": 61,
19
"phone_number": "",
20
"email": "[email protected]",
21
"first_name": "FELIX",
22
"last_name": "CHERUIYOT",
23
"country": "KE",
24
"address": "Westlands",
25
"city": "Nairobi",
26
"state": "Nairobi",
27
"zipcode": "2020",
28
"provider": "CARD-PAYMENT",
29
"created_at": "2020-08-06T16:24:06.247397+03:00",
30
"updated_at": "2021-04-11T08:37:15.755013+03:00"
31
}
32
"customer_comment": "",
33
"created_at": "2021-04-11T08:37:15.810438+03:00",
34
"updated_at": "2021-04-11T08:37:15.810475+03:00"
35
},
36
"identitier": "intasend-status-update-cdrtl"
37
}
Copied!
You may want to add extra validation on your backend before releasing the product/service. Please consider subscribing to webhooks for live events.
Last modified 1mo ago
Copy link