mirror of https://github.com/abpframework/eventhub
3 changed files with 36 additions and 0 deletions
@ -0,0 +1,9 @@ |
|||
using System; |
|||
|
|||
namespace Payment.Web.PaymentRequest |
|||
{ |
|||
public interface IPaymentUrlBuilder |
|||
{ |
|||
Uri BuildCheckoutUrl(Guid paymentRequestId); |
|||
} |
|||
} |
|||
@ -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<AppUrlOptions> urlOptions) |
|||
{ |
|||
this.urlOptions = urlOptions.Value; |
|||
} |
|||
|
|||
public virtual Uri BuildCheckoutUrl(Guid paymentRequestId) |
|||
{ |
|||
return new Uri(urlOptions.Applications["MVC"].RootUrl.EnsureEndsWith('/') + "Payment/Checkout?paymentRequestId=" + paymentRequestId); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue