mirror of https://github.com/abpframework/eventhub
6 changed files with 80 additions and 29 deletions
@ -1,10 +1,13 @@ |
|||||
using System.Threading.Tasks; |
using System; |
||||
|
using System.Threading.Tasks; |
||||
using Volo.Abp.Application.Services; |
using Volo.Abp.Application.Services; |
||||
|
|
||||
namespace Payment.PaymentRequests |
namespace Payment.PaymentRequests |
||||
{ |
{ |
||||
public interface IPaymentRequestAppService : IApplicationService |
public interface IPaymentRequestAppService : IApplicationService |
||||
{ |
{ |
||||
|
Task<PaymentRequestDto> GetAsync(Guid id); |
||||
|
|
||||
Task<PaymentRequestDto> CreateAsync(PaymentRequestCreationDto input); |
Task<PaymentRequestDto> CreateAsync(PaymentRequestCreationDto input); |
||||
} |
} |
||||
} |
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
@page |
||||
|
@using Microsoft.Extensions.Localization |
||||
|
@using Payment.Localization |
||||
|
@using Payment.Web.Pages.Payment |
||||
|
@model Payment.Web.Pages.Payment.CheckoutPageModel |
||||
|
@inject IStringLocalizer<PaymentResource> L |
||||
|
|
||||
|
@section scripts { |
||||
|
<abp-script-bundle name="@typeof(CheckoutPageModel).FullName"> |
||||
|
<abp-script src="/client-proxies/Payment-proxy.js" /> |
||||
|
</abp-script-bundle> |
||||
|
} |
||||
|
|
||||
|
<h1>Checkout</h1> |
||||
|
|
||||
|
<abp-card> |
||||
|
<abp-card-header> |
||||
|
<h2>Product Information</h2> |
||||
|
</abp-card-header> |
||||
|
<abp-card-body> |
||||
|
<ul> |
||||
|
<li>Product name: @Model.PaymentRequest.ProductName</li> |
||||
|
<li>Amount: @Model.PaymentRequest.Amount</li> |
||||
|
</ul> |
||||
|
</abp-card-body> |
||||
|
</abp-card> |
||||
|
|
||||
|
<abp-card> |
||||
|
<abp-card-body> |
||||
|
<form method="post"> |
||||
|
<abp-button type="submit" button-type="Primary">Complete the payment</abp-button> |
||||
|
</form> |
||||
|
</abp-card-body> |
||||
|
</abp-card> |
||||
@ -0,0 +1,32 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Payment.PaymentRequests; |
||||
|
|
||||
|
namespace Payment.Web.Pages.Payment |
||||
|
{ |
||||
|
public class CheckoutPageModel : PaymentPageModel |
||||
|
{ |
||||
|
[BindProperty(SupportsGet = true)] |
||||
|
public Guid PaymentRequestId { get; set; } |
||||
|
|
||||
|
public PaymentRequestDto PaymentRequest { get; set; } |
||||
|
|
||||
|
private readonly IPaymentRequestAppService _paymentRequestAppService; |
||||
|
|
||||
|
public CheckoutPageModel(IPaymentRequestAppService paymentRequestAppService) |
||||
|
{ |
||||
|
_paymentRequestAppService = paymentRequestAppService; |
||||
|
} |
||||
|
|
||||
|
public async Task OnGetAsync() |
||||
|
{ |
||||
|
PaymentRequest = await _paymentRequestAppService.GetAsync(PaymentRequestId); |
||||
|
} |
||||
|
|
||||
|
public async Task OnPostAsync() |
||||
|
{ |
||||
|
PaymentRequest = await _paymentRequestAppService.GetAsync(PaymentRequestId); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,17 +0,0 @@ |
|||||
@page |
|
||||
@using Microsoft.Extensions.Localization |
|
||||
@using Payment.Localization |
|
||||
@using Payment.Web.Pages.Payment |
|
||||
@model Payment.Web.Pages.Payment.IndexModel |
|
||||
@inject IStringLocalizer<PaymentResource> L |
|
||||
|
|
||||
@section scripts { |
|
||||
<abp-script-bundle name="@typeof(IndexModel).FullName"> |
|
||||
<abp-script src="/client-proxies/Payment-proxy.js" /> |
|
||||
</abp-script-bundle> |
|
||||
} |
|
||||
|
|
||||
@{ |
|
||||
} |
|
||||
<h1>Payment</h1> |
|
||||
<p>@L["SamplePageMessage"]</p> |
|
||||
@ -1,9 +0,0 @@ |
|||||
namespace Payment.Web.Pages.Payment |
|
||||
{ |
|
||||
public class IndexModel : PaymentPageModel |
|
||||
{ |
|
||||
public void OnGet() |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue