Beispiel #1
0
 public async Task <IHttpActionResult> SendPaymentTransactions(SendBillPaymentTransaction model)
 {
     if (ModelState.IsValid)
     {
         var send = billProvider.SendBillPaymentTransaction(model.Amount, model.PinData, model.SecureData, model.MSISDN, model.TransactionRef, model.CardBin);
         ApiResult <SendBillPaymentTransaction> res = new ApiResult <SendBillPaymentTransaction>();
         return(Created("QuickTellerBillProvider/SendBillPaymentTransaction", send));
     }
     return(BadRequest(ModelState));
 }
        public SendBillPaymentTransaction SendBillPaymentTransaction(decimal amount, string pindata, string securedata, long msisdn, string transactionref, long cardbin)
        {
            SendBillPaymentTransaction sendBillPaymentTransaction = new SendBillPaymentTransaction()
            {
                Amount         = (amount * 100),
                PinData        = pindata,
                SecureData     = securedata,
                MSISDN         = msisdn,
                TransactionRef = transactionref,
                CardBin        = cardbin
            };
            var serializedResponse  = JsonConvert.SerializeObject(sendBillPaymentTransaction);
            var transactionResponse = this.SendRequest(serializedResponse,
                                                       $"{ConfigurationManager.AppSettings["QuicktellerUrl"]}/transactions", "POST");
            var responseobject = JsonConvert.DeserializeObject <SendBillPaymentTransaction>(transactionResponse);

            return(responseobject);
        }