What is this?
Seamlessly integrate your app into the Pahang Go ecosystem with our Embedded Apps—the fastest and easiest way to connect with thousands of engaged users. With just a single script tag, you can instantly onboard your app, offering your products and services directly within the Pahang Go platform. No complex integrations, no lengthy approvals—just a smooth, hassle-free experience that gets you up and running in no time. Expand your reach, enhance user engagement, and grow your business effortlessly with Pahang Go Embedded Apps!
Getting Started is Easy!
Onboarding your app into Pahang Go is as simple as Sign Up, Embed, and Go!
Sign Up – Create your account and register your app on our platform.
Add the JavaScript Snippet – Copy and paste a single line of code into your app to seamlessly integrate it with Pahang Go.
Upload Your HTML – Deploy your app’s interface, and you're live!
That’s it! No complicated setup, no long waiting times—just a streamlined process that gets your app in front of Pahang Go users in minutes. Start now and connect with a growing audience effortlessly! 🚀
The JS Snippet:
<script>window.PGO={getUser:async()=>window.flutter_inappwebview.callHandler("get-user"),pay:async(e,a,n,r)=>window.flutter_inappwebview.callHandler("pay",{reference_1:a,reference_2:n,amount:e,extras:r})};</script>
The API:
Below is the API documentation to get your app running in minutes:
1. PGO.getUser
async PGO.getUser will return current logged in user information in js object. This can be used to auto populate forms.
Request:
await PGO.getUser()
Response:
{
"name": "Zulfa Juniadi",
"email": "[email protected]",
"phone": "0192727155"
}
2. PGO.pay
async PGO.pay will initiate payment on the app and return status successful / failed.
Request:
await PGO.pay(amount, reference_1, reference_2, extras);
- amount: Payment amount in Ringgit Malaysia, required.
- reference_1: Your internal primary reference number, generated on your side, required.
- reference_2: Your internal secondary reference number, generated on your side, optional.
- extras: JSON object for extra information, optional.
Response:
{
"reference_number": "PGOXXX", // Our internal reference number, only sent if all validation rules are passed.
"amount": "10.00", // Amount in Ringgit Malaysia
"reference_1": "abcd1234", // your internal primary reference number, generated on your side, required
"reference_2": "abcd1235", // your internal secondary reference number, generated on your side, optional
"is_successful": true // whether payment is successful / failed.
"extras": [] // optional, if sent
}
Server to Server Notification
Additionally we provide a server-to-server payment notification to your endpoint that sends JSON upon successful payment. Data that is sent:
{
"user_name": "Zulfa Juniadi", // user's name
"user_email": "[email protected]", // user's email
"user_phone": "0192727155", // user's phone number
"reference_number": "PGOXXXXXX", // our generated payment reference number
"description": "Payment for Insurance", // our generated payment description
"service_reference_1": "abcd1234", // your 1st reference number
"service_reference_2": "abcd1235", // your 2nd reference number
"amount": "10.00", // amount in RM
"extras": [], // optional, if sent
"created_at": "2025-01-21 15:49:23" // timestamp of payment record
"signature": "XXXXX" // signature to be verified on your end
}
The signature field is a base64 encoded AES-256-CBC encryption that encrypts the user_name, user_email, user_phone, reference_number, service_reference_1, amount, created_at fields separated by pipe character "|" with an API Secret string that we will provide to you.
On the server side, this is how we encrypt and decrypt the signature field:
protected function encrypt($string, $secret_key)
{
$encrypt_method = "AES-256-CBC";
$key = hash('sha256', $secret_key);
$iv = substr(hash('sha256', $secret_key), 0, 16);
return base64_encode(openssl_encrypt($string, $encrypt_method, $key, 0, $iv));
}
protected function decrypt($string, $secret_key)
{
$encrypt_method = "AES-256-CBC";
$key = hash('sha256', $secret_key);
$iv = substr(hash('sha256', $secret_key), 0, 16);
return openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);
}