Browse Source

#32695 gauvaPay

staging^2
Dinesh 1 month ago
parent
commit
57bd6fbe64
  1. 28
      TPServices/GuavaPayRemit/Services/GuavaPayAPI.cs

28
TPServices/GuavaPayRemit/Services/GuavaPayAPI.cs

@ -136,6 +136,26 @@ namespace TPApiServices.GuavaPayRemit.Services
var txnResponseData = client.Execute<SendTransactionResponse>(request); var txnResponseData = client.Execute<SendTransactionResponse>(request);
var sendTxnResponse = txnResponseData.Data; var sendTxnResponse = txnResponseData.Data;
_log.Info($"GUAVAPAYAPI|SENDTRANSACTION|RESPONSE : {txnResponseData.Content}"); _log.Info($"GUAVAPAYAPI|SENDTRANSACTION|RESPONSE : {txnResponseData.Content}");
if (sendTxnResponse != null)
{
_log.Info($"GUAVAPAYAPI|SENDTRANSACTION|RESPONSE DATA : {JsonConvert.SerializeObject(sendTxnResponse)}");
if (string.IsNullOrEmpty(sendTxnResponse.RRN) || string.IsNullOrEmpty(sendTxnResponse.Rate) ||
string.IsNullOrEmpty(sendTxnResponse.Status) || string.IsNullOrEmpty(sendTxnResponse.Fee) ||
string.IsNullOrEmpty(sendTxnResponse.StatusDescription))
{
txnResponse.ResponseCode = "1";
txnResponse.Msg = "One or more critical response fields are null.";
_log.Warn($"GUAVAPAYAPI|SENDTRANSACTION|MISSING FIELDS: " +
$"RRN: {sendTxnResponse.RRN}, " +
$"Rate: {sendTxnResponse.Rate}, " +
$"Status: {sendTxnResponse.Status}, " +
$"Fee: {sendTxnResponse.Fee}, " +
$"StatusDescription: {sendTxnResponse.StatusDescription}");
}
else
{
txnResponse.ResponseCode = "0"; txnResponse.ResponseCode = "0";
txnResponse.Id = sendTxnResponse.RRN; txnResponse.Id = sendTxnResponse.RRN;
txnResponse.Extra = sendTxnResponse.Rate; txnResponse.Extra = sendTxnResponse.Rate;
@ -144,6 +164,14 @@ namespace TPApiServices.GuavaPayRemit.Services
txnResponse.Extra4 = sendTxnResponse.StatusDescription; txnResponse.Extra4 = sendTxnResponse.StatusDescription;
txnResponse.Data = sendTxnResponse; txnResponse.Data = sendTxnResponse;
} }
}
else
{
txnResponse.ResponseCode = "1";
txnResponse.Msg = "Response data is null";
_log.Warn($"GUAVAPAYAPI|SENDTRANSACTION|RESPONSE DATA IS NULL");
}
}
catch (Exception ex) catch (Exception ex)
{ {
txnResponse.ResponseCode = "999"; txnResponse.ResponseCode = "999";

Loading…
Cancel
Save