This is a consolidated sample for all products offered on Grab's Developer Portal.
Please note that the code in this sample does not necessarily reflect Grab's programming practices - its main purpose is to help engineers working on Grab API integration have a better idea of how to do so. For example, instead of directly calling HTTP endpoints correctly in view components, you should look for ways to perform dependency injection for easier testing.
Homebrew
: Run/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
in terminal.yarn
:brew install yarn
.
- Go to root of the project, run this command to generate a self-signed certificate for HTTPS:
openssl req -nodes -new -x509 -keyout server/server.key -out server/server.cert
- Edit
/etc/hosts
withsudo vi /etc/hosts
and append127.0.0.1 grabplatform.stg-myteksi.com
and127.0.0.1 grabplatform.grab.com
. Save the file with:x
. This must be done because GrabID does not acceptlocalhost
. - In the root folder, run
yarn
to install dependencies, andyarn start:stg
to start the project.https://grabplatform.grab.com:3000/
will open in your browser of choice. - Configure the redirect URLs for your OAuth client in
https://developer-beta.stg-myteksi.com
(under your project > OAuth clients > Platform configurations) to add both:
https://grabplatform.grab.com
https://grabplatform.grab.com/**
- Navigate to specific products by clicking the categories, and then clicking the underlying products.
- Authorize with GrabID first, then follow instructions on screen to access the related endpoint.
- When you are in the app, you can configure the necessary details. These configs will be saved in the backend and prefilled the next time you start the app:
- Country Code.
- Partner ID.
- Partner HMAC secret.
- Client ID.
- Client secret.
- Merchant ID.
- Currency.
- Open
package.json
and changehost
tograbplatform.grab.com
andproxy
tohttps://grabplatform.grab.com:8000
. Please change back tostg-myteksi.com
for staging tests. - Update configurations to use production credentials.
- Configure the redirect URLs for your OAuth client in
https://developer.stg-myteksi.com
to be the same as above. - Run
yarn start:prd
instead ofyarn start:stg
. - After you are done, revert the above changes to clean up.