Example #1
0
 public ChargeController(IGetDiscoService discoService, IValidateMeterNumberService validateMeter, PayServices pay)
 {
     _discoService = discoService
                     ?? throw new ArgumentNullException(nameof(discoService));
     _validateMeter = validateMeter
                      ?? throw new ArgumentNullException(nameof(validateMeter));
     _pay = pay
            ?? throw new ArgumentNullException(nameof(pay));
 }
Example #2
0
        public void PayWithoutFIO_ExpectAreEqual()
        {
            //Arrange
            GoToPage(payPageUrl);
            payServices = new PayServices(webDriver);

            //Act
            var error = payServices.PayWihoutFio();

            //Assert
            Assert.AreEqual(Constants.InvalidLocationErrorMessage, error);
        }
Example #3
0
 public async Task <ServiceResponseModel <CCResponse> > ChargeUserCard(CCRequest req)
 {
     try
     {
         //var response = await _http.PostAsync<CCResponse>(baseUrl: StaticAppSettings.MeterAfBaseUrl, postdata: req, url: "/api/charge/charge/card");
         PayServices ps       = new PayServices(_configuration, _http, _responseService);
         var         response = ps.ChargeCard(req).Result;
         if (response.status)
         {
             return(_responseService.SuccessResponse <CCResponse>("Success! card Charged", response));
         }
         else
         {
             return(_responseService.ErroResponse <CCResponse>("Unabe to charge card"));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #4
0
        public async Task <ServiceResponseModel <PaystackResponse> > VerifyPay(string payRef)
        {
            var reqObj = new
            {
                PaymentReference = payRef
            };
            PayServices ps = new PayServices(_configuration, _http, _responseService);
            var         verifyTransactionRequest = ps.MakePaystackRequest($"{PaystackApiEndPoints.VerifyTransaction}/{reqObj.PaymentReference}",
                                                                          HttpMethod.Get, null);
            var verifyResponse =
                JsonConvert.DeserializeObject <PaystackResponse>(verifyTransactionRequest);

            if (verifyResponse.Status)
            {
                return(_responseService.SuccessResponse <PaystackResponse>("Payment Made!", verifyResponse));
            }
            else
            {
                return(_responseService.ErroResponse <PaystackResponse>("Unabe to charge card"));
            }
        }