Midtrans Payment
Estimated reading: 1 minutes
Sign up For Midtrans
- If you don't have Midtrans Account you can register from here Sign up
Obtain Midtrans API Keys
Follow the steps below to obtain your Midtrans API keys:
Visit the Midtrans.
Click on the Login option.
Enter your email address and password.
Click on Log me in.
Upon successful login, you will be directed to your Dashboard.
Completing Account Information
Navigate to Settings > General Settings.
Complete the required information.
- Note:
- Merchant Name cannot contain any symbols.
- Merchant URL should be less than 25 characters.
- Note:
Retrieving API Access Keys
Log in to your MAP account.
On the Dashboard, go to Settings > Access Keys.
Here you will find your:
- Client Key: Used for frontend API requests.
- Server Key: Used for backend API requests. Keep it confidential.
Switching Environment
You can switch between environments from the top left Environment drop-down on the dashboard.
- Sandbox Environment: Use for development and testing. Transactions are not real.
- Production Environment: Use when ready to accept real payments. Transaction fees may apply.
Note:
- API keys differ between Production & Sandbox environments.
- Transaction data and configurations are separated between environments.
Add Generated Keys into config.dart
Now you've successfully generated keys please update values into "config.dart".
- Navigate to lib → config.dart.
- Add value for constants shown below.
/// Midtrans
const midtrans_client_key = '';
tip
Congratulations! Your Midtrans Payment configuration is done.