API Keys
To use Laravel PayHere, you should configure your PayHere API keys in your application's .env
file. You can retrieve these API keys from the PayHere portal.
dotenv
PAYHERE_MERCHANT_ID=your-payhere-merchant-id
PAYHERE_MERCHANT_SECRET=-your-payhere-merchant-secret
PAYHERE_APP_ID=your-payhere-app-id
PAYHERE_APP_SECRET=your-payhere-app-secret
PAYHERE_SANDBOX=true
You should set the PAYHERE_SANDBOX
environment variable to true when using PayHere's Sandbox environment. When deploying your application to production, you can either set it to false
or leave it out.
Retrieve API Keys from PayHere
Click on the "Integrations" in the sidebar.
Click on the "Add Domain\App" button.
Fill the form and click on "Save".
Copy the "Merchant ID" and "Merchant Secret" paste them into your
.env
file.Click on the "Settings" in the sidebar.
Click on the "Create API Key" button.
Fill the form and click on "Save API Key" button.
Click on the "View Credentials" link.
Copy the "App ID" and "App Secret" paste them into your
.env
file.