Skip to main content
1

Install PayLink

Make sure PayLink is installed and configured locally. Follow the Installation guide if you haven’t already.
2

Create a PayLink account

Ensure you have a PayLink account created. Follow the Create an account guide if you haven’t already.
3

Configure your environment

To be able to trace tool invocation, we need the following:
PAYLINK_API_KEY="paylink api key"
PAYLINK_PROJECT="Paylink project"
PAYLINK_TRACING="enabled"
After creating a project on PayLink platform, copy the project name and update your .env. Create an API key and update the .env as well.PayLink will support different payment providers, but currently we only support M-Pesa, so set:
PAYMENT_PROVIDER=["mpesa"]
Create an account on M-Pesa Daraja and obtain the following:
MPESA_BUSINESS_SHORTCODE="your_shortcode"
MPESA_CONSUMER_SECRET="your_consumer_secret"
MPESA_CONSUMER_KEY="your_consumer_key"
MPESA_CALLBACK_URL="your_callback_url"
MPESA_PASSKEY="mpesa_passkey"
MPESA_BASE_URL="nhhnh"
Use sandbox credentials while testing to avoid live charges.

Next Steps

Now that we have our .env with all the variables set, let’s test that everything is working correctly before building a real agent.