Skip to content

Commit

Permalink
Code change
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldwight committed Dec 24, 2020
1 parent beb4ae1 commit b8e962b
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Newtonsoft.Json;
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;

namespace MpesaSdk.Web.APIControllers
Expand Down Expand Up @@ -41,6 +42,12 @@ public async Task<IActionResult> LipaNaMpesaCallback(string requestId, [FromBody
ResultDesc = "Transaction Rejected"
});
}

// To retrieve results from callback metadata

var result = lipaNaMpesaCallback.Body.StkCallback.LipaNaMPesaCallbackMetadata.ResultParameter.ToDictionary(x => x.Key, x => x.Value);

var test = result["MpesaReceiptNumber"];

var filename = $"{requestId}.json";

Expand Down

0 comments on commit b8e962b

Please sign in to comment.