This is a Django project consisting of sample apps used to handle various transactions such as Split Payment, Subaccount, Preauth, Transfer, Tokenized Charge, 3DSecure and Redirect Url, Webhooks.
You can get your Rave Test/Sandbox Public and Secret Keys Here.
- Split Payment
- Subaccount
- Preauth
- Transfer
- Tokenized Charge
- 3DSecure and Redirect Url
- Webhooks(Logging to database)
- Python
- Django
- Virtual Environment
- Create a virtual environment for your Django project. You can use either
virtualenvorvirtualenvwrapperto set this up. - To use
virtualenvwrapperon windows runpip install virtualenvwrapper-win - Use
mkvirtualenv yourenvto create your virtual environment. - The virtual environment will be activated automatically and you’ll see “(yourenv)” next to the command prompt to designate that.
- If you start a new command prompt, you’ll need to activate the environment again using
workon yourenv. - To create a virtual environment from your bash terminal check this link.
- cd into the directory in which you would like to run the project.
- git clone https://github.com/MaestroJolly/python_sample_apps.git
- cd into python_sample_apps
- pip install -r requirements.txt
- pip install git+https://github.com/Flutterwave/rave-python.git
- Find
.env-examplefile in the cloned directory, edit it and replace theRAVE_PUBLIC_KEYandRAVE_SECRET_KEYwith the one from your Rave Sandbox Dashboard. - Save it as
.env, then source usingsource .env from bash terminalorset .env from Windows Command Prompt/PowerShell Terminal. - To start the project locally, run
py manage.py runserverto start the server. - Visit http://127.0.0.1:8000 to load the apps on your browser.
- Visit ngrok to signup for an
ngrokaccount. - Download
ngrokfor your current OS here, install it and make it available globally. - To make it available globally on Windows, Extract the download
ngrok.zipfile to your preferred path. - Hit the
Windows + Rbuttons simultaneously, Enter this into the inputsysdm.cpland press enter. - Select the Advanced Option, Open the environment variable option, Select the
PATHvariable name, Click Edit, Click New, Then copy the path of the extractedngrokfile and paste it there. - Click ok to save it.
- Go to your
ngrokdashboard to get yourauth token. - Open a new terminal window, cd into the cloned sample apps directory then enter this command
ngrok authtoken <YOUR_AUTH_TOKEN>change the<YOUR_AUTH_TOKEN>to theauth tokenfrom your dashboard. - Next enter this command to start your auth server
ngrok http <PROJECT_SERVER_PORT_NUMBER>sayngrok http 8000. - Now you should see generated
urlssimilar to thishttp://a5e2530f.ngrok.ioandhttps://a5e2530f.ngrok.io, copy any of them and go to the webhooks setting on your rave dashboard. - Paste the
urlyou copied to the webhook input field and add yourwebhookpath to it which should look similar to thishttp://a5e2530f.ngrok.io/webhook, then hit save button. - Your webhook url is now listening for events/requests,
Ravesends webhook requests forcard,account,ghana mobile money,uganda mobile moneysuccessful transactions andtransfers, check here to understand more. - Whenever the webhook is triggered the requests is logged to the database, you can find all the logged webhook requests at this url.
- You can access admin dashboard by going to this url http://127.0.0.1:8000/admin/ to manage the contents, Login using these details
username: admin,password: admin.