diff --git a/modules/payment/src/Payment.Web/Pages/Payment/Checkout.cshtml.cs b/modules/payment/src/Payment.Web/Pages/Payment/Checkout.cshtml.cs index 732d2b2..9d8385e 100644 --- a/modules/payment/src/Payment.Web/Pages/Payment/Checkout.cshtml.cs +++ b/modules/payment/src/Payment.Web/Pages/Payment/Checkout.cshtml.cs @@ -27,6 +27,11 @@ namespace Payment.Web.Pages.Payment public async Task OnPostAsync() { PaymentRequest = await _paymentRequestAppService.GetAsync(PaymentRequestId); + + // TODO: Redirect from here. + + + } } } \ No newline at end of file diff --git a/modules/payment/src/Payment.Web/PaymentRequest/IPaymentUrlBuilder.cs b/modules/payment/src/Payment.Web/PaymentRequest/IPaymentUrlBuilder.cs new file mode 100644 index 0000000..b71880e --- /dev/null +++ b/modules/payment/src/Payment.Web/PaymentRequest/IPaymentUrlBuilder.cs @@ -0,0 +1,9 @@ +using System; + +namespace Payment.Web.PaymentRequest +{ + public interface IPaymentUrlBuilder + { + Uri BuildCheckoutUrl(Guid paymentRequestId); + } +} \ No newline at end of file diff --git a/modules/payment/src/Payment.Web/PaymentRequest/PaymentUrlBuilder.cs b/modules/payment/src/Payment.Web/PaymentRequest/PaymentUrlBuilder.cs new file mode 100644 index 0000000..3398911 --- /dev/null +++ b/modules/payment/src/Payment.Web/PaymentRequest/PaymentUrlBuilder.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.Options; +using System; +using Volo.Abp.DependencyInjection; +using Volo.Abp.UI.Navigation.Urls; + +namespace Payment.Web.PaymentRequest +{ + public class PaymentUrlBuilder : ITransientDependency, IPaymentUrlBuilder + { + private readonly AppUrlOptions urlOptions; + + public PaymentUrlBuilder(IOptions urlOptions) + { + this.urlOptions = urlOptions.Value; + } + + public virtual Uri BuildCheckoutUrl(Guid paymentRequestId) + { + return new Uri(urlOptions.Applications["MVC"].RootUrl.EnsureEndsWith('/') + "Payment/Checkout?paymentRequestId=" + paymentRequestId); + } + } +}