How to solve Safaricom C2B error "Unable to identify proxy for host"

783 Views Asked by At

I am working with Safaricom Mpesa Daraja Api using the test credentials. Everything was working okay but suddennly I start getting the error.

{"fault":{"faultstring":"Unable to identify proxy for host: secure and url: \/mpesa\/stkpush\/v1\/processrequest","detail":{"errorcode":"messaging.adaptors.http.flow.ApplicationNotFound"}}}

Below is the curl post data:

array:11 [▼
  "BusinessShortCode" => 174379
  "Password" => "My Password Here"
  "Timestamp" => "20210429060420"
  "TransactionType" => "CustomerPayBillOnline"
  "Amount" => 1
  "PartyA" => "25470..My Number Here"
  "PartyB" => 174379
  "PhoneNumber" => "25470..My Number Here"
  "CallBackURL" => "https://f0d77d3643b3.ngrok.io/confirmation/deposit_1619678899"
  "AccountReference" => "Account"
  "TransactionDesc" => "Testing stk push on sandbox"
]

I have seen a few references of these error though no one has given a solution to it. How do I solve it.

2

There are 2 best solutions below

0
On BEST ANSWER

Turns out the only way to solve this is to contact Safaricom Api Support team and ask them to rectify the issue.

0
On

If you are using the test net or daraja sandbox, please use the supplied information from the portal over your production information. Using production paybill triggers the above error.

Below is a working credentials sample

private $ShortCode = '601484';
private $PassKey = 'YOUR PASS KEY';
private $TimeStamp;
private $InitiatorName = 'USERNAME';
private $SecurityCredential= 'YOUR PASSWORD';
private $Msisdn = 'YOUR NUMBER';
private $ShortCode2 = '600000';
private $BusinessShortCode = '174379';
private $PartyB = '174379';
private $password;
private $TransactionType = 'CustomerPayBillOnline';