mirror of https://github.com/abpframework/eventhub
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
5 years ago | |
|---|---|---|
| .. | ||
| src | 5 years ago | |
| test | 5 years ago | |
| .gitattributes | 5 years ago | |
| .gitignore | 5 years ago | |
| .prettierrc | 5 years ago | |
| NuGet.Config | 5 years ago | |
| Payment.sln | 5 years ago | |
| Payment.sln.DotSettings | 5 years ago | |
| README.md | 5 years ago | |
| common.props | 5 years ago | |
| global.json | 5 years ago | |
README.md
Payment Module
Payment module provides an API to make payments via using PayPal easily.
Installation
TODO
Usage
-
Create a Payment Request via using
IPaymentRequestAppService -
Build an URL to redirect to checkout page via using
IPaymentUrlBuilderpublic class MyPageModel : AbpPageModel { protected IPaymentRequestAppService PaymentRequestAppService { get; } protected IPaymentUrlBuilder PaymentUrlBuilder { get; } public MyPageModel( IPaymentRequestAppService paymentRequestAppService, IPaymentUrlBuilder paymentUrlBuilder) { PaymentRequestAppService = paymentRequestAppService; PaymentUrlBuilder = paymentUrlBuilder; } public async Task OnPostAsync() { var paymentRequest = await PaymentRequestAppService.CreateAsync(new PaymentRequestCreationDto { Amount = 9.90m, CustomerId = CurrentUser.Id.ToString(), ProductId = "UniqueProductId", ProductName = "Awesome Product" }); var checkoutUrl = PaymentUrlBuilder.BuildCheckoutUrl(paymentRequest.Id).AbsoluteUri; Response.Redirect(checkoutUrl); } }