Introduction
The document is for 3rd party vendor that wants to vend transport tickets on our platform.
Vendors will be given MerchantKey and MerchantCode to access the trips web booking widget.
The document is for 3rd party vendor that wants to vend transport tickets on our platform.
Vendors will be given MerchantKey and MerchantCode to access the trips web booking widget.
The Api requires bearer token for authentication which is SHA512 endcoded MerchantKey:MerchantCode (https://passwordsgenerator.net/sha512-hash-generator/)
Request Headers:
Authorization: bearer + SHA512(MerchantKey:MerchantCode)
MerchantKey: {merchantkey}
MerchantCode: {merchantcode}
Content-Type: application/json
Request Headers Sample:
Authorization: Bearer abc123
Content-Type: application/json
MerchantCode: merchant code provided
Method A: Using URL Parameters Structure
http://tripswebwidgetv3test.avitechng.com/{MerchantCode}/{MerchantHash}
Example: https://tripswebwidgetv3.test.vggdev.com/ACCESS/457b25...5afd
How to Use:
Replace {MerchantCode} and {MerchantHash} with your actual credentials.
Open the link in a browser or embed it in an iframe
Method B: Using Local Storage
Required Keys:
localStorage.setItem("dxz", "[MerchantCode]");
localStorage.setItem("xdg", "[MerchantHash]");
Optional (Recommended for personalization):
localStorage.setItem("CustomerName", "[Name]");
localStorage.setItem("CustomerId", "[ID]");
How to Use:
Set localStorage values before loading the widget.
Redirect or embed the widget using its base URL: https://tripswebwidgetv3.test.vggdev.com/
React Native (WebView):
■ Android (Kotlin):
webView.settings.javaScriptEnabled = true webView.evaluateJavascript("""
localStorage.setItem("dxz", "ACCESS");
localStorage.setItem("xdg", "457b25...5afd"); """, null)
■ iOS (Swift):
webView.evaluateJavaScript(""" localStorage.setItem("dxz", "{MerchantCode}");
localStorage.setItem("xdg", "{MerchantHash}"); """)
To Get The Token
Get Token API: https://api.staging.trips.ng/api/account/gettoken
TOKEN REQUEST AND RESPONSE SAMPLE
The Api used to login to get hash token for using the trips web boking widget, see sample request model and response.
Sample Request
Authorization: Bearer abc123
Content-Type: application/json
MerchantCode: merchant code provided
{
"CustomerName": "John Doe", //Required
"CustomerIdentifier": "" //could be customer Id or as given from the bank
}
Sample response
{
"Token":
"9d08ec3b5b8008f117671011069cf79f220e81a3b164627588887c2f5e10d3a04fd24693cd772149e0
4f06 20e03f3217567e74b26410a804c812a031219b1cb4",
"MerchantName": "{merchant name}",
"MerchantCode": {merchant code},
"MerchantId": 1,
"Hash": null,
"ExtraData": {
"CustomerName": "John Doe",
"CustomerIdentifier": ""
}
}
Last updated