Esempio n. 1
0
        /// <summary>
        /// Vérifie le status d'une transaction et
        /// renvoie true si la transaction a été acceptée par l'API de paiement
        /// </summary>
        /// <param name="paymentId"></param>
        /// <returns></returns>
        public async Task <bool> CheckPayment(string paymentId)
        {
            if (string.IsNullOrEmpty(paymentId))
            {
                throw new NullReferenceException();
            }

            try
            {
                var result = await client.GetAsync(routingService.GetPaymentStatusCheckUrl(paymentId));

                if (result.IsSuccessStatusCode)
                {
                    return(await result.Content.ReadAsAsync <bool>());
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex.InnerException);
            }

            return(false);
        }