Esempio n. 1
0
        public async Task <AcquiringBankResult> SendToAcquiringBank(PaymentRequest request)
        {
            var piggyRequest = BuildPiggyRequest(request);
            var piggyStatus  = await ApiFunctions.ProcessPaymentRequestAsync(piggyRequest);

            return(BuildPaymentProcessed(piggyStatus));
        }
        public async Task <PaymentProcessed> ProcessAsync(IAcquirerCommand processPayment)
        {
            var piggyPayment = processPayment as ProcessPiggyPayment;

            if (piggyPayment == null)
            {
                throw new Exception("Invalid payment type");
            }
            var piggyRequest = BuildPiggyRequest(piggyPayment);
            var piggyStatus  = await ApiFunctions.ProcessPaymentRequestAsync(piggyRequest);

            return(BuildPaymentProcessed(piggyPayment, piggyStatus));
        }