Safaricom Daraja API Tutorial

Test Cases

Test Cases


You are only required to fill the test cases for the APIs you worked with, but all provided test cases will be included in the final file.

Key:

  • Success: Your Results match Expected results
  • Fail: Your Results do not match Expected results

The newly created Excel file might have Wrap Text disabled, thus overflowing text or very long sentences will be hidden. For readability, select all the data in each sheet (Ctrl + A), then click on Wrap Text on the Home Tab in Excel as shown below.

Also, the file will not contain the rest of the worksheets not provided below. You can copy-paste them if you want to into the resulting file.

Subject Test Case Objective Expected Results Actual Results
Authentication Authenticate using Oauth To test successful authentication of third party using consumerkey:consumersecret and hashing it to create the Oauth token Authentication is successful
Authentication Authenticate using Oauth To test unsuccessful authentication of third party using consumerkey:consumersecret and hashing it to create the Oauth token Authentication is unsuccessful
Authentication Security credential is correctly encrypted to test successful authentication of the third party Authentication is successful
Authentication Security credential is incorrectly encrypted to test unsuccessful authentication of the third party Authentication is unsuccessful
Certificate management Test transaction over https portal To test successful request sent over https on the portal Portal displays https and transaction is successful
Functionality tests Send request with transaction type B2C with command ID "PromotionPayment" to the Broker - B2C account has a valid initiator username, password and receiver party account is valid Partner is able to successful move funds from the organization to the customer MSISDN 1) Request is sent to API gateway successfully. A valid response is returned to the Partner.
2) Transfer of funds is successful from any organization to MSISDN
3) Valid result is returned with appropriate error
Functionality tests Send request with transaction type B2C with command ID "PromotionPayment" to API Gateway- B2C account has insufficient balance Transfer of funds for B2C account with insufficient balance is unsuccessful. Request is processed by the gateway and appropriate error message is retuned in the result 1) Request is sent to API Gateway successfully. A valid response is returned to the Partner.
2) Transfer of funds from B2C business account to Customer's MPESA account is unsuccessful
3) Valid result is returned with appropriate error
Functionality tests Send request with transaction type B2C with command ID "PromotionPayment" to API Gateway - B2C account has wrong initiator username Transfer of funds for B2C account with invalid initiator username is unsuccessful. Request is processed by the API gateway and appropriate error message is retuned in the result 1) Request is sent to API Gateway successfully. A valid response is returned to the Partner.
2) Transfer of funds from B2C business account to Customer's MPESA account is unsuccessful
3) Valid result is returned with appropriate error
Functionality tests Send request with transaction type BusinessBuyGoods with command ID "PromotionPayment" to Broker - with an invalid recipient merchant account or store Transfer of funds from B2C account with invalid initiator password is unsuccessful. Request is processed by the API gateway and appropriate error message is retuned in the result 1) Request is sent to API gateway successfully. A valid response is returned to the Partner.
2) Transfer of funds from B2C business account to Customer's MPESA account is unsuccessful
3) Valid result is returned with appropriate error
Functionality tests Send the request with an valid command id To test whether the request will go through with a valid command id You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send the request with an invalid command id To test whether the request will go through with an invalid command id The request shall not go through with an appropriate error thrown: Invalid CommandID
Functionality tests Send the request with a valid amount between 1-70000 To test whether the request will be allowed on Mpesa with a valid amount You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send the request with a negative amount or a large amount e.g 50000000000000000000000000 To test whether the request will be allowed on Mpesa with a negative amount or large amount The request shall not go through with an appropriate error thrown: Invalid Amount
Functionality tests Send the Party B with an MSISDN of 12 numbers To test whether an MSISDN of 12 numbers will be accepted You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send the Party B with an organization shortcode of 12 numbers To test whether an MSISDN of 12 or more numbers will be accepted The request shall not go through with an in appropriate error thrown:Invalid Party B
Functionality tests Send remarks with less then 200 characters To test whether less then 200 characters will be accepted in remarks You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send remarks with more then 200 characters To test whether more then 200 characters will be accepted in remarks The request shall not go through with an in appropriate error thrown:Invalid Remarks
Functionality tests Send result url with an IP and Port To test whether the request will be accepted with a valid IP and Port You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send result url without an IP and Port To test whether the request will be accepted without an IP and Port The request shall not go through and an appropriate error thrown: Invalid ResultURL
Functionality tests Send queuetimeout URL with an IP and Port To test whether the request will be accepted with an IP and Port You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send queuetimeout URL without an IP and Port To test whether the request will be accepted without an IP and port The request shall not go through with an in appropriate error thrown:Invalid QueuetimeoutURL
Subject Test Case Objective Expected Results Actual Results
Authentication Authenticate using Oauth To test successful authentication of third party using consumerkey:consumersecret and hashing it to create the Oauth token Authentication is successful
Authentication Authenticate using Oauth To test unsuccessful authentication of third party using consumerkey:consumersecret and hashing it to create the Oauth token Authentication is unsuccessful
Authentication Security credential is correctly encrypted to test successful authentication of the third party Authentication is successful
Authentication Security credential is incorrectly encrypted to test unsuccessful authentication of the third party Authentication is unsuccessful
Certificate management Test transaction over https portal To test successful request sent over https on the portal Portal displays https and transaction is successful
Transaction type management Use C2B to send request with transaction type RegisterURL with command ID "RegisterURL " for both confirmation and validation URLs Partner is able to make a successful register confirmation and Validation URL 1) Request is sent to API Gateway successfully. Partner receive a success response from API Gateway
2) Successful registration of the ConfirmationURL for the specified short code
Transaction type management Use C2B to send request with transaction type RegisterURL with command ID "RegisterURL" for only Confirmation notifications Partner is able to make a successful register confirmation URL 1) Request is sent to API Gateway successfully. Partner receive a success response from API Gateway
2) Successful registrationof the confirmationURL
Transaction type management Use C2B to send request with transaction type RegisterURL with command ID "RegisterURL" for only Validation requests from API Gateway Partner is able to make a successful register Validation URL 1) Request is sent to API Gateway successfully. Partner receive a success response from API Gateway
2) Successful registration of the Validation URL
Functionality tests API Gateway sends "C2BPaymentConfirmationRequest" to third party Third party successfully receives the confirmation request sends an acknowledgement to API Gateway 1) Request is sent to Third party successfully.
2) Third party successfully acknowleges the confirmation request to API Gateway
Functionality tests API gateway sends "C2BPaymentConfirmationRequest" to third party 1)Third party does a successful registerURL with responsetype Complete
2) Third party successfully receives the confirmation request
3) Third party fails to send acknowlegement to API Gateway
1) Request is sent to Third party successfully.
2) API Gateway sends a success to MPESA
Functionality tests API Gateway sends "C2BPaymentValidationRequest" to third party 1) Third party successfully receives the confirmation request sends an acknowledgement to API Gateway
2) third party respond with a success message/code to API Gateway
1) Third party successfully receives the validation request from API Gateway
2) Third party respond with a success
3) The subscriber receives SMS from MPESA showing a success or failure (customer may have or not have enough money in their mpesa account)
4) third party Receives confirmation request from API Gateway in a case confirmation URL was registered
5) Third party sends a successful confirmation acknowledgement to API Gateway.
Functionality tests API Gateway sends "C2BPaymentValidationRequest" to third party 1) Third party successfully receives the confirmation request sends an acknowledgement to API Gateway
2) third party respond with a failures message/code to API Gateway
1) Third party successfully receives the validation request from API Gateway
2) API Gateway receives the failure message and respond to MPESA to cancel the transaction
3) The subscriber receives a failure SMS from MPESA
Functionality tests API Gateway sends "C2BPaymentValidationRequest" to third party 1)Third party does a successful registerURL with responsetype Complete
2) Third party successfully receives the Validation request
3) Third party fails to send acknowlegement to API Gateway
1) Request is sent to Third party successfully.
2) API Gateway sends a success to MPESA
Functionality tests API Gateway sends "C2BPaymentValidationRequest" to third party 1)Third party does a successful registerURL with responsetype Cancelled
2) Third party successfully receives the Validation request
3) Third party fails to send acknowlegement to API Gateway
1) Request is sent to Third party successfully.
2) API Gateway sends a cancel request to MPESA.
Test C2B Simulate Transaction Accessing C2B Simulate Transaction To verify that the user can access APIs The user is able to view the testing page for C2B Simulate Transaction
Test C2B Simulate Transaction Calling an API of C2B Simulate Transaction without any input To verify that the user must provide valid inputs OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": ""Error Occurred - Error Message - "
}
Test C2B Simulate Transaction Calling an API of C2B Simulate Transaction: Authorized access without payload To verify that the user must provide valid inputs OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": ""Error Occurred - Error Message - "
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify commandID is mandatory To verify that the user must provide a valid commandID OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid Command ID- "
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify Amount is mandatory To verify that the user must provide a valid Amount OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid Amount - "
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify MSISDN is mandatory To verify that the user must provide a valid msisdn OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid MSISDN"
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify BillRefNo is mandatory To verify that the user must provide a valid BillRefNo OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid BillRefNo - "
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify ShortCode is mandatory To verify that the user must provide a valid ShortCode OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid Shortcode"
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify Normal Flow with all Valid inputs for Command ID = CustomerPayBillOnline To verify that the user must provide a valid commandID OUTPUT: appropriate acknowledgement of success message with "ConversationID", "OriginatorConversationID" and "ResponseDescription"."
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify Normal Flow with all Valid inputs for Command ID = randomValue To verify that the user must provide a valid commandID OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid CommandID - "
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify Normal Flow with all Valid inputs for amount = 0 To verify that the user must provide a valid Amount OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid Amount - "
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify Normal Flow with all Valid inputs for amount above 70000 To verify that the user must provide a valid Amount OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid Amount - "
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify Normal Flow with all Valid inputs for a negative amount To verify that the user must provide a valid Amount OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid Amount- "
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify MSISDN is not numeric To verify that the user must provide a valid MSISDN OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid MSISDN - "
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify MSISDN exceeding maximum allowed length (> 12 characters) To verify that the user must provide a valid MSISDN OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid MSISDN- "
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify MSISDN less than minimum allowed length (less then 12 char) To verify that the user must provide a valid MSISDN OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid MSISDN - "
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify BillRefNumber is not numeric To verify that the user must provide a valid BillRefNumber OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid BillRefNumber - "
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify BillRefNumber exceeding maximum allowed length To verify that the user must provide a valid BillRefNumber OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid BillRefNumber"
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify BillRefNumber less than minimum allowed length To verify that the user must provide a valid BillRefNumber OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid BillRefNumber - "
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify Shortcode is not numeric To verify that the user must provide a valid shortCode OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Invalid - Shortcode -"
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify ShortCode exceeding maximum allowed length > 6 characters To verify that the user must provide a valid shortCode OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid Shortcode -"
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify shortcode is less than minimum allowed length (<5 characters) To verify that the user must provide a valid shortCode OUTPUT: appropriate error message in the format
{
"requestId": "",
"errorCode": "",
"errorMessage": "Error Occurred - Invalid Shortcode - "
}
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify Normal Flow with all Valid inputs for Amount is not greater then 70000 and not negative To verify that the user must provide a valid amount between 1-70,000 OUTPUT: appropriate acknowledgement of success message with "ConversationID", "OriginatorConversationID" and "ResponseDescription"."
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify Normal Flow with all Valid inputs for MSISDN (12 digits) To verify that the user must provide a valid MSISDN OUTPUT: appropriate acknowledgement of success message with "ConversationID", "OriginatorConversationID" and "ResponseDescription".
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify Normal Flow with all Valid inputs for MSISDN To verify that the user must provide a valid MSISDN OUTPUT: appropriate acknowledgement of success message with "ConversationID", "OriginatorConversationID" and "ResponseDescription".
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify Normal Flow with all Valid inputs for BillRefNo To verify that the user must provide a valid BillRefNo OUTPUT: appropriate acknowledgement of success message with "ConversationID", "OriginatorConversationID" and "ResponseDescription".
Test C2B Simulate Transaction Calling an API of C2B Payment Request to verify Normal Flow with all Valid inputs for Shortcode To verify that the user must provide a valid Shortcode OUTPUT: appropriate acknowledgement of success message with "ConversationID", "OriginatorConversationID" and "ResponseDescription".
Subject Test Case Objective Expected Results Actual Results
Authentication Authenticate using Oauth To test successful authentication of third party using consumerkey:consumersecret and hashing it to create the Oauth token Authentication is successful
Authentication Authenticate using Oauth To test unsuccessful authentication of third party using consumerkey:consumersecret and hashing it to create the Oauth token Authentication is unsuccessful
Authentication Security credential is correctly encrypted to test successful authentication of the third party Authentication is successful
Authentication Security credential is incorrectly encrypted to test unsuccessful authentication of the third party Authentication is unsuccessful
Certificate management Test transaction over https portal To test successful request sent over https on the portal Portal displays https and transaction is successful
Functionality tests Send request with transaction type B2B with command ID "BusinessPayBill" to the API Gateway - B2B account has a valid initiator username, password and receiver party account is valid Partner is able to successful move funds from the organization to another organization 1) Request is sent to API gateway successfully. A valid response is returned to the Partner.
2) Transfer of funds is successful from any organization to organization
3) Valid result is returned with appropriate error
Functionality tests Send request with transaction type B2B with command ID "BusinessPayBill" to API Gateway- B2B account has insufficient balance Transfer of funds for B2B account with insufficient balance is unsuccessful. Request is processed by the gateway and appropriate error message is retuned in the result 1) Request is sent to API Gateway successfully. A valid response is returned to the Partner.
2) Transfer of funds from B2B business account to Customer's MPESA account is unsuccessful
3) Valid result is returned with appropriate error
Functionality tests Send request with transaction type B2B with command ID "BusinessPayBill" to API Gateway - B2B account has wrong initiator username Transfer of funds for B2B account with invalid initiator username is unsuccessful. Request is processed by the API gateway and appropriate error message is retuned in the result 1) Request is sent to API Gateway successfully. A valid response is returned to the Partner.
2) Transfer of funds from B2B business account to Customer's MPESA account is unsuccessful
3) Valid result is returned with appropriate error
Functionality tests Send request with transaction type B2B with command ID "BusinessPayBill" to API Gateway - B2B account has wrong initiator password Transfer of funds for B2B account with invalid initiator password is unsuccessful. Request is processed by the API gateway and appropriate error message is retuned in the result 1) Request is sent to API Gateway successfully. A valid response is returned to the Partner.
2) Transfer of funds from B2B business account to Customer's MPESA account is unsuccessful
3) Valid result is returned with appropriate error
Functionality tests Send request with transaction type B2B with command ID "BusinessPayBill" to API Gateway - with an invalid recipient merchant account or store Transfer of funds from B2B account with invalid initiator password is unsuccessful. Request is processed by the API gateway and appropriate error message is retuned in the result 1) Request is sent to API gateway successfully. A valid response is returned to the Partner.
2) Transfer of funds from B2B business account to Customer's MPESA account is unsuccessful
3) Valid result is returned with appropriate error
Functionality tests Send the request with an valid command id e.g BusinessPayBill/BusinessBuyGoods To test whether the request will go through with a valid command id You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send the request with an invalid command id To test whether the request will go through with an invalid command id The request shall not go through with an appropriate error thrown: Invalid CommandID
Functionality tests Send the request with a valid amount between 1-70000 To test whether the request will be allowed on Mpesa with a valid amount You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send the request with a negetive amount or a large amount e.g 50000000000000000000000000 To test whether the request will be allowed on Mpesa with a negative amount The request shall not go through with an appropriate error thrown: Invalid Amount
Functionality tests Send remarks with less then 200 characters To test whether less then 200 characters will be accepted in remarks You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send remarks with more then 200 characters To test whether more then 200 characters will be accepted in remarks The request shall not go through with an in appropriate error thrown: Invalid Remarks
Functionality tests Send result url with an ip and port To test whether the request will be accepted with a valid ip and port You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send result url without an ip and port To test whether the request will be accepted without an ip and port The request shall not go through with an in appropriate error thrown: Invalid ResultURL
Functionality tests Send queuetimeout URL with an ip and port To test whether the request will be accepted with an ip and port The request shall not go through with an in appropriate error thrown: Invalid ResultURL
Functionality tests Send queuetimeout URL without an ip and port To test whether the request will be accepted without an ip and port The request shall not go through with an in appropriate error thrown:Invalid ResultURL
Subject Test Case Objective Expected Results Actual Results
Authentication Authenticate using Oauth To test successful authentication of third party using consumerkey:consumersecret and hashing it to create the Oauth token Authentication is successful
Authentication Authenticate using Oauth To test unsuccessful authentication of third party using consumerkey:consumersecret and hashing it to create the Oauth token Authentication is unsuccessful
Authentication Security credential is correctly encrypted to test successful authentication of the third party Authentication is successful
Authentication Security credential is incorrectly encrypted to test unsuccessful authentication of the third party Authentication is unsuccessful
Certificate management Test transaction over https portal To test successful request sent over https on the portal Portal displays https and transaction is successful
Functionality tests Send request with transaction type Account Balance with command ID "AccountBalance" to the gateway - Paybill account has a valid initiator username ,password and party A account is valid Partner is able to successful move funds from the organization to the customer MSISDN 1) Request is sent to API gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned with appropriate error
Functionality tests Send request with transaction type Account Balance with command ID "AccountBalance" to API Gateway - Paybill account has wrong initiator username Checking of balance for paybill account with invalid initiator username is unsuccessful. Request is processed by the API gateway and appropriate error message is retuned in the result 1) Request is sent to API Gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned with appropriate error
Functionality tests Send request with transaction type Account Balance with command ID "AccountBalance" to gateway - Paybill account has wrong initiator password Checking of balance for paybill account with invalid initiator password is unsuccessful. Request is processed by the API gateway and appropriate error message is retuned in the result 1) Request is sent to API Gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned with appropriate error
Functionality tests Send request with transaction type Account Balance with command ID "AccountBalance" to gateway - with an invalid party A merchant account or store Transfer of funds from paybill account with invalid initiator password is unsuccessful. Request is processed by the API gateway and appropriate error message is retuned in the result 1) Request is sent to API gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned with appropriate error
Functionality tests Send the request with an valid command id i.e AccountBalance To test whether the request will go through with a valid command id through the API gateway You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send the request with an invalid command id To test whether the request will go through with an invalid command id will go through to API gateway The request shall not go through with an appropriate error thrown: Invalid CommandID
Functionality tests Send the request with an invalid identifier e.g. 6 To test whether the request will be allowed on Mpesa with an invalid identifier The request shall not go through with an appropriate error thrown: Invalid identifier
Functionality tests Send remarks with less then 200 characters To test whether less then 200 characters will be accepted in remarks You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send remarks with more then 200 characters To test whether more then 200 characters will be accepted in remarks The request shall not go through with an in appropriate error thrown: Invalid Remarks
Functionality tests Send result url with an ip and port To test whether the request will be accepted with a valid ip and port You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send result url without an ip and port To test whether the request will be accepted without an ip and port The request shall not go through with an in appropriate error thrown:Invalid ResultURL
Functionality tests Send queuetimeout URL with an ip and port To test whether the request will be accepted with an ip and port You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send queuetimeout URL without an ip and port To test whether the request will be accepted without an ip and port The request shall not go through with an in appropriate error thrown:Invalid QueuetimeoutURL
Subject Test Case Objective Expected Results Actual Results
Authentication Authenticate using Oauth To test successful authentication of third party using consumerkey:consumersecret and hashing it to create the Oauth token Authentication is successful
Authentication Authenticate using Oauth To test unsuccessful authentication of third party using consumerkey:consumersecret and hashing it to create the Oauth token Authentication is unsuccessful
Authentication Security credential is correctly encrypted to test successful authentication of the third party Authentication is successful
Authentication Security credential is incorrectly encrypted to test unsuccessful authentication of the third party Authentication is unsuccessful
Certificate management Test transaction over https portal To test successful request sent over https on the portal Portal displays https and transaction is successful
Functionality tests Send request with transaction type Transaction Reversal with command ID "TransactionReversal" to the gateway - Paybill account has a valid initiator username,password, amount and ReceiverParty account is valid Partner is able to successfully reverse funds 1) Request is sent to API gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned and transaction is reversed
Functionality tests Send request with transaction type Transaction Reversal with command ID "TransactionReversal" to API Gateway - Paybill account has wrong initiator username Reversal for paybill account with invalid initiator username is unsuccessful. Request is processed by the API gateway and appropriate error message is retuned in the result 1) Request is sent to API Gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned with appropriate error
Functionality tests Send request with transaction type Transaction Reversal with command ID "TransactionReversal" to gateway - Paybill account has wrong initiator password Reversal for paybill account with invalid initiator password is unsuccessful. Request is processed by the API gateway and appropriate error message is retuned in the result 1) Request is sent to API Gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned with appropriate error
Functionality tests Send request with transaction type Transaction Reversal with command ID "TransactionReversal" to gateway - with an invalid ReceiverParty merchant account or store Reversal from paybill account with invalid Receiver party is unsuccessful. Request is processed by the API gateway and appropriate error message is retuned in the result 1) Request is sent to API gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned with appropriate error
Functionality tests Send the request with an valid command id i.e TransactionReversal To test whether the request will go through with a valid command id through the API gateway You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send the request with an invalid command id To test whether the request will go through with an invalid command id will go through to API gateway The request shall not go through with an appropriate error thrown: Invalid CommandID
Functionality tests Send the request with an invalid identifier e.g. 6. The valid identifier is 1 To test whether the request will be allowed on Mpesa with an invalid identifier The request shall not go through with an appropriate error thrown: Invalid identifier
Functionality tests Send remarks with less then 200 characters To test whether less then 200 characters will be accepted in remarks You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send remarks with more then 200 characters To test whether more then 200 characters will be accepted in remarks The request shall not go through with an in appropriate error thrown: Invalid Remarks
Functionality tests Send result url with an ip and port To test whether the request will be accepted with a valid ip and port You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send result url without an ip and port To test whether the request will be accepted without an ip and port The request shall not go through with an in appropriate error thrown:Invalid ResultURL
Functionality tests Send queuetimeout URL with an ip and port To test whether the request will be accepted with an ip and port You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send queuetimeout URL without an ip and port To test whether the request will be accepted without an ip and port The request shall not go through with an in appropriate error thrown:Invalid QueuetimeoutURL
Functionality tests Send the Occasion with less than 200 characters To test whether Occasion will be accepted with less than 200 characters The request shall not go through with an in appropriate success message: The service has been accepted successfully
Functionality tests Send Occasion with more then 200 characters To test whether occasion will go through with more then 200 characters The request shall not go through with an in appropriate error thrown:Invalid Occasion
Functionality tests Send the amount with a different amount that was sent during c2b with a valid transaction ID To test whether the transaction will be reversed with an amount not matching the intial C2B request 1) Request is sent to API Gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned with appropriate error
Functionality tests Send an invalid transaction ID that does not exist To test whether the transaction will be reversed with a transaction ID not matching the intial C2B request 1) Request is sent to API Gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned with appropriate error
Functionality tests Send the TransactionID with a valid Transaction ID and valid shortcode To test whether a valid transaction can be queried The request shall not go through with an in appropriate success message: The service has been accepted successfully
Subject Test Case Objective Expected Results Actual Results
Authentication Authenticate using Oauth To test successful authentication of third party using consumerkey:consumersecret and hashing it to create the Oauth token Authentication is successful
Authentication Authenticate using Oauth To test unsuccessful authentication of third party using consumerkey:consumersecret and hashing it to create the Oauth token Authentication is unsuccessful
Authentication Security credential is correctly encrypted to test successful authentication of the third party Authentication is successful
Authentication Security credential is incorrectly encrypted to test unsuccessful authentication of the third party Authentication is unsuccessful
Certificate management Test transaction over https portal To test successful request sent over https on the portal Portal displays https and transaction is successful
Functionality tests Send request with transaction type Transaction Status Query with command ID "TransactionStatusQuery" to the gateway - Paybill account has a valid initiator username ,password, Transaction ID, Identifier Type and party A account is valid Partner is able to successfully query the transaction from the organization that received it 1) Request is sent to API gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned with success message and transaction details
Functionality tests Send request with transaction type Transaction Status Query with command ID "TransactionStatusQuery" to API Gateway - Paybill account has wrong initiator username Checking the status of a transaction for paybill account with invalid initiator username is unsuccessful. Request is processed by the API gateway and appropriate error message is retuned in the result 1) Request is sent to API Gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned with appropriate error
Functionality tests Send request with transaction type Transaction Status Query with command ID "TransactionStatusQuery" to gateway - Paybill account has wrong initiator password Checking the status of a transaction for paybill account with invalid initiator password is unsuccessful. Request is processed by the API gateway and appropriate error message is retuned in the result 1) Request is sent to API Gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned with appropriate error
Functionality tests Send request with transaction type Transaction Status Query with command ID "TransactionStatusQuery" to gateway - with an invalid party A merchant account or store Checking funds from paybill account with invalid initiator password is unsuccessful. Request is processed by the API gateway and appropriate error message is retuned in the result 1) Request is sent to API gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned with appropriate error
Functionality tests Send the request with a valid command id i.e TransactionStatusQuery To test whether the request will go through with a valid command id through the API gateway You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send the request with an invalid command id To test whether the request will go through with an invalid command id will go through to API gateway The request shall not go through with an appropriate error thrown: Invalid CommandID
Functionality tests Send the request with an invalid identifier e.g. 6. To test whether the request will be allowed on Mpesa with an invalid identifier The request shall not go through with an appropriate error thrown: Invalid identifier
Functionality tests Send the Party A with a MSISDN of 10 digits To test whether a MSISDN of 10 digits will be accepted You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send the Party A with a MSISDN of more then 10 digits To test whether a MSISDN of more or less then 10 digits will be accepted The request shall not go through with an in appropriate error thrown:Invalid Party A
Functionality tests Send remarks with less then 200 characters To test whether less then 200 characters will be accepted in remarks You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send remarks with more then 200 characters To test whether more then 200 characters will be accepted in remarks The request shall not go through with an in appropriate error thrown: Invalid Remarks
Functionality tests Send result url with an ip and port To test whether the request will be accepted with a valid ip and port You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send result url without an ip and port To test whether the request will be accepted without an ip and port The request shall not go through with an in appropriate error thrown:Invalid ResultURL
Functionality tests Send queuetimeout URL with an ip and port To test whether the request will be accepted with an ip and port You should get an appropriate success message: The service has been accepted successfully
Functionality tests Send queuetimeout URL without an ip and port To test whether the request will be accepted without an ip and port The request shall not go through with an in appropriate error thrown:Invalid QueuetimeoutURL
Functionality tests Send the Occasion with less than 200 characters To test whether Occasion will be accepted with less than 200 characters The request shall not go through with an in appropriate success message: The service has been accepted successfully
Functionality tests Send Occasion with more then 200 characters To test whether occasion will go through with more then 200 characters The request shall not go through with an in appropriate error thrown:Invalid Occasion
Functionality tests Send an invalid transaction ID that does not exist To test whether the transaction will be reversed with a transaction ID not matching the intial C2B request 1) Request is sent to API Gateway successfully. A valid response is returned to the Partner.
2) Valid result is returned with appropriate error