Skip to content

Commit

Permalink
Use darajambili.com as test callback viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmogusu committed Jan 3, 2023
1 parent 67e9f8e commit 5515059
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -67,6 +67,6 @@ On your browser, you will receive a message `Accept the service request successf

## Note

You need a callback URL connected to the internet to receive the asynchronous result. In case you don't have one you can head over to http://darajambili.herokuapp.com and grab a callback URL to test the result.
You need a callback URL connected to the internet to receive the asynchronous result. In case you don't have one you can head over to https://darajambili.com and grab a callback URL to test the result.

The full documentation of all supported API's can be found at http://django-daraja.readthedocs.io
The full documentation of all supported API's can be found at https://django-daraja.readthedocs.io
4 changes: 2 additions & 2 deletions django_daraja/views.py
Expand Up @@ -9,8 +9,8 @@
from datetime import datetime

cl = MpesaClient()
stk_push_callback_url = 'https://darajambili.herokuapp.com/express-payment'
b2c_callback_url = 'https://darajambili.herokuapp.com/b2c/result'
stk_push_callback_url = 'https://api.darajambili.com/express-payment'
b2c_callback_url = 'https://api.darajambili.com/b2c/result'

def index(request):

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/apis/b2c_payment.rst
Expand Up @@ -62,4 +62,4 @@ This will assign the ``response`` variable with an ``MpesaResponse`` object cont
.. note::
- Test credentials to use for this scenario can be found at the developer portal (https://developer.safaricom.co.ke/test_credentials)
- Use `shortcode 1` as the shortcode, and the test MSISDN as the B2C phone number
- This example will work if your site is already hosted, since the callback URL needs to be accessible via internet. For local testing purposes, you can use an endpoint hosted outside your site to check the notification received on the callback URL. There is a test listener hosted at https://darajambili.herokuapp.com, which you can use to view logs of notifications received. You can head over there to pick a callback URL to use for B2C Payments.
- This example will work if your site is already hosted, since the callback URL needs to be accessible via internet. For local testing purposes, you can use an endpoint hosted outside your site to check the notification received on the callback URL. There is a test listener hosted at https://darajambili.com, which you can use to view logs of notifications received. You can head over there to pick a callback URL to use for B2C Payments.
2 changes: 1 addition & 1 deletion docs/pages/apis/stk_push.rst
Expand Up @@ -23,4 +23,4 @@ This will assign the ``response`` variable with an ``MpesaResponse`` object cont
.. note::
- Use a Safaricom number that you have access to for the ``phone_number`` parameter, so as to be able to receive the prompt on your phone.
- You will need to define a url with the name ``mpesa_stk_push_callback``, and this is where MPESA will send the results of the STK push once the customer enters the PIN or cancels the transaction, or in case the prompt times out.
- This example will work if your site is already hosted, since the callback URL needs to be accessible via internet. For local testing purposes, you can use an endpoint hosted outside your site to check the notification received on the callback URL. There is a test listener hosted at https://darajambili.herokuapp.com, which you can use to view logs of notifications received. You can head over there to pick a callback URL to use for STK push.
- This example will work if your site is already hosted, since the callback URL needs to be accessible via internet. For local testing purposes, you can use an endpoint hosted outside your site to check the notification received on the callback URL. There is a test listener hosted at https://darajambili.com, which you can use to view logs of notifications received. You can head over there to pick a callback URL to use for STK push.
2 changes: 1 addition & 1 deletion docs/pages/quick_start.rst
Expand Up @@ -189,7 +189,7 @@ In ``my_app/views.py`` Create a test index view
.. note::
- Use a Safaricom number that you have access to for the ``phone_number`` parameter, so as to be able to receive the prompt on your phone.
- You will need to define a url with the name ``mpesa_stk_push_callback``, and this is where MPESA will send the results of the STK push once the customer enters the PIN or cancels the transaction, or in case the prompt times out.
- This example will work if your site is already hosted, since the callback URL needs to be accessible via internet. For local testing purposes, you can use an endpoint hosted outside your site to check the notification received on the callback URL. There is a test listener hosted at https://darajambili.herokuapp.com, which you can use to view logs of notifications received. You can head over there to pick a callback URL to use for STK push.
- This example will work if your site is already hosted, since the callback URL needs to be accessible via internet. For local testing purposes, you can use an endpoint hosted outside your site to check the notification received on the callback URL. There is a test listener hosted at https://darajambili.com, which you can use to view logs of notifications received. You can head over there to pick a callback URL to use for STK push.

8. Run Migrations
-----------------
Expand Down
2 changes: 1 addition & 1 deletion tests/test_b2c_payment.py
Expand Up @@ -11,7 +11,7 @@
class MpesaB2CPaymentTestCase(TestCase):

cl = MpesaClient()
callback_url = 'https://darajambili.herokuapp.com/express-payment'
callback_url = 'https://api.darajambili.com/express-payment'
success_description = 'Accept the service request successfully.'

def test_business_payment_success(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_stk_push.py
Expand Up @@ -11,7 +11,7 @@
class MpesaStkPushTestCase(TestCase):

cl = MpesaClient()
callback_url = 'https://darajambili.herokuapp.com/express-payment'
callback_url = 'https://api.darajambili.com/express-payment'

def test_stk_push_success(self):
'''
Expand Down

0 comments on commit 5515059

Please sign in to comment.