Esempio n. 1
0
        private async Task CompletePayment(long paymentId)
        {
            var payment = _subscriptionPaymentRepository.Get(paymentId);

            switch (payment.EditionPaymentType)
            {
            case EditionPaymentType.BuyNow:
                await _paymentAppService.BuyNowSucceed(paymentId);

                break;

            case EditionPaymentType.Upgrade:
                await _paymentAppService.UpgradeSucceed(paymentId);

                break;

            case EditionPaymentType.Extend:
                await _paymentAppService.ExtendSucceed(paymentId);

                break;

            case EditionPaymentType.NewRegistration:
                await _paymentAppService.NewRegistrationSucceed(paymentId);

                break;

            default:
                throw new ApplicationException($"Unhandled payment type: {payment.EditionPaymentType}. payment(id: {paymentId}) could not be completed.");
            }
        }
Esempio n. 2
0
        public async Task <IActionResult> BuyNowSucceed(long paymentId)
        {
            await _paymentAppService.BuyNowSucceed(paymentId);

            return(RedirectToAction("Index", "SubscriptionManagement", new { area = "App" }));
        }