+ {
+ new PaymentRequestProductCreateDto
+ {
+ Code = "Product_01",
+ Name = "LEGO Super Mario",
+ Count = 1,
+ UnitPrice = 60,
+ TotalPrice = 60
+ }
+ },
+ ExtraProperties = new ExtraPropertyDictionary
+ {
+ // For Iyzico - Customer information
+ { "Name", "John" },
+ { "Surname", "Doe" },
+ { "Email", "john.doe@example.com" },
+ { "Address", "123 Main St" },
+ { "City", "Istanbul" },
+ { "Country", "Turkey" },
+ { "ZipCode", "34000" },
+
+ // For PayU - Customer information
+ { "BuyerName", "John" },
+ { "BuyerSurname", "Doe" },
+ { "BuyerEmail", "john.doe@example.com" }
+ }
+ });
+```
+
+#### Handling the Callback (Optional)
+
+When a user completes a payment on the external payment gateway, the following flow occurs:
+
+1. The user is redirected to the **PostPayment page** (handled internally by the payment module)
+2. The PostPayment page validates the payment with the gateway and updates the payment request status to **Completed**
+3. If a `CallbackUrl` is configured in `PaymentBlazorOptions`, the user is then redirected to that URL with the `paymentRequestId` as a query parameter
+
+Create a page to handle this callback and perform any application-specific actions:
+
+```csharp
+@page "/PaymentSucceed"
+@using Microsoft.AspNetCore.WebUtilities
+
+Payment Successful!
+Thank you for your purchase.
+Payment Request ID: @PaymentRequestId
+
+@code {
+ [Parameter]
+ [SupplyParameterFromQuery]
+ public Guid? PaymentRequestId { get; set; }
+
+ protected override async Task OnInitializedAsync()
+ {
+ if (PaymentRequestId.HasValue)
+ {
+ // The payment is already completed at this point.
+ // Perform application-specific actions here:
+ // e.g., activate subscription, send confirmation email,
+ // update order status, grant access to purchased content, etc.
+ }
+ }
+}
+```
+
+> **Note:** By the time the user reaches your callback page, the payment request status has already been set to **Completed** by the PostPayment page. Your callback page is for performing additional application-specific logic. It is also your responsibility to handle if a payment request is used more than once. If you have already delivered your product for a given `PaymentRequestId`, you should not deliver it again when the callback URL is visited a second time.
### Angular UI
-#### Installation
+For Angular applications, you need to read and apply the steps explained in the following sections:
+
+#### Configurations
In order to configure the application to use the payment module, you first need to import `PaymentAdminConfigModule` from `@volo/abp.ng.payment/admin/config` to the root configuration. `PaymentAdminConfigModule` has a static `forRoot` method which you should call for a proper configuration:
@@ -120,15 +387,35 @@ const APP_ROUTES: Routes = [
];
```
-#### Payment plans page
+### Pages
+
+#### Public Pages
+
+##### Payment Gateway Selection
+
+This page allows selecting a payment gateway. If there is only one payment gateway configured for the application, this page will be skipped.
+
+
+
+##### PrePayment Page
+
+Some payment gateways require additional information before redirecting to the payment gateway. For example, PayU and Iyzico require customer information (Name, Surname, Email Address, etc.) before processing the payment.
+
+
+
+#### Admin Pages
+
+##### Payment Plans Page
+
Payment plans for subscriptions can be managed on this page. You can connect external subscriptions for each gateway to a plan.


-#### Payment request list
-This page lists all the payment request operations in application.
+##### Payment Request List
+
+This page lists all the payment request operations in the application.

@@ -171,7 +458,22 @@ Configure(options =>
* ```PrePaymentUrl```: URL of the page before redirecting user to payment gateway for payment.
* ```PostPaymentUrl```: URL of the page when user redirected back from payment gateway to your website. This page is used to validate the payment mostly.
* ```Order```: Order of payment gateway for gateway selection page.
- * ```Recommended```: Is payment gateway is recommended or not. This information is displayed on payment gateway selection page.
+ * ```Recommended```: Is payment gateway recommended or not. This information is displayed on payment gateway selection page.
+ * ```ExtraInfos```: List of informative strings for payment gateway. These texts are displayed on payment gateway selection page.
+
+### PaymentBlazorOptions
+
+```PaymentBlazorOptions``` is used to configure Blazor application related configurations. This is the Blazor equivalent of `PaymentWebOptions`.
+
+* ```CallbackUrl```: Final callback URL for internal payment gateway modules to return. User will be redirected to this URL on your website after a successful payment.
+* ```RootUrl```: Root URL of your Blazor application.
+* ```GatewaySelectionCheckoutButtonStyle```: CSS style to add to the Checkout button on the gateway selection page. This class can be used for tracking user activity via 3rd party tools like Google Tag Manager.
+* ```PaymentGatewayBlazorConfigurationDictionary```: Used to store Blazor related payment gateway configuration.
+ * ```Name```: Name of payment gateway.
+ * ```PrePaymentUrl```: URL of the Blazor page before redirecting user to payment gateway for payment.
+ * ```PostPaymentUrl```: URL of the Blazor page when user is redirected back from payment gateway to your website.
+ * ```Order```: Order of payment gateway for gateway selection page.
+ * ```Recommended```: Is payment gateway recommended or not. This information is displayed on payment gateway selection page.
* ```ExtraInfos```: List of informative strings for payment gateway. These texts are displayed on payment gateway selection page.
### PayuOptions
@@ -193,9 +495,17 @@ Configure(options =>
```PayuWebOptions``` is used to configure PayU payment gateway web options.
-* ```Recommended```: Is payment gateway is recommended or not. This information is displayed on payment gateway selection page.
+* ```Recommended```: Is payment gateway recommended or not. This information is displayed on payment gateway selection page.
* ```ExtraInfos```: List of informative strings for payment gateway. These texts are displayed on payment gateway selection page.
-* ```PrePaymentCheckoutButtonStyle```: Css style to add Checkout button on PayU prepayment page. This class can be used for tracking user activity via 3rd party tools like Google Tag Manager.
+* ```PrePaymentCheckoutButtonStyle```: CSS style to add to the Checkout button on the PayU prepayment page. This class can be used for tracking user activity via 3rd party tools like Google Tag Manager.
+
+### PayuBlazorOptions
+
+```PayuBlazorOptions``` is used to configure PayU payment gateway Blazor options.
+
+* ```Recommended```: Is payment gateway recommended or not. This information is displayed on payment gateway selection page.
+* ```ExtraInfos```: List of informative strings for payment gateway. These texts are displayed on payment gateway selection page.
+* ```PrePaymentCheckoutButtonStyle```: CSS style to add to the Checkout button on the PayU prepayment page.
### TwoCheckoutOptions
@@ -210,7 +520,14 @@ Configure(options =>
```TwoCheckoutWebOptions``` is used to configure TwoCheckout payment gateway web options.
-* ```Recommended```: Is payment gateway is recommended or not. This information is displayed on payment gateway selection page.
+* ```Recommended```: Is payment gateway recommended or not. This information is displayed on payment gateway selection page.
+* ```ExtraInfos```: List of informative strings for payment gateway. These texts are displayed on payment gateway selection page.
+
+### TwoCheckoutBlazorOptions
+
+```TwoCheckoutBlazorOptions``` is used to configure TwoCheckout payment gateway Blazor options.
+
+* ```Recommended```: Is payment gateway recommended or not. This information is displayed on payment gateway selection page.
* ```ExtraInfos```: List of informative strings for payment gateway. These texts are displayed on payment gateway selection page.
### StripeOptions
@@ -228,7 +545,14 @@ Configure(options =>
```StripeWebOptions``` is used to configure Stripe payment gateway web options.
-* ```Recommended```: Is payment gateway is recommended or not. This information is displayed on payment gateway selection page.
+* ```Recommended```: Is payment gateway recommended or not. This information is displayed on payment gateway selection page.
+* ```ExtraInfos```: List of informative strings for payment gateway. These texts are displayed on payment gateway selection page.
+
+### StripeBlazorOptions
+
+```StripeBlazorOptions``` is used to configure Stripe payment gateway Blazor options.
+
+* ```Recommended```: Is payment gateway recommended or not. This information is displayed on payment gateway selection page.
* ```ExtraInfos```: List of informative strings for payment gateway. These texts are displayed on payment gateway selection page.
### PayPalOptions
@@ -245,7 +569,14 @@ Configure(options =>
```PayPalWebOptions``` is used to configure PayPal payment gateway web options.
-* ```Recommended```: Is payment gateway is recommended or not. This information is displayed on payment gateway selection page.
+* ```Recommended```: Is payment gateway recommended or not. This information is displayed on payment gateway selection page.
+* ```ExtraInfos```: List of informative strings for payment gateway. These texts are displayed on payment gateway selection page.
+
+### PayPalBlazorOptions
+
+```PayPalBlazorOptions``` is used to configure PayPal payment gateway Blazor options.
+
+* ```Recommended```: Is payment gateway recommended or not. This information is displayed on payment gateway selection page.
* ```ExtraInfos```: List of informative strings for payment gateway. These texts are displayed on payment gateway selection page.
### IyzicoOptions
@@ -263,9 +594,17 @@ Configure(options =>
```IyzicoWebOptions``` is used to configure Iyzico payment gateway web options.
-* ```Recommended```: Is payment gateway is recommended or not. This information is displayed on payment gateway selection page.
+* ```Recommended```: Is payment gateway recommended or not. This information is displayed on payment gateway selection page.
+* ```ExtraInfos```: List of informative strings for payment gateway. These texts are displayed on payment gateway selection page.
+* ```PrePaymentCheckoutButtonStyle```: CSS style to add to the Checkout button on the Iyzico prepayment page. This class can be used for tracking user activity via 3rd party tools like Google Tag Manager.
+
+### IyzicoBlazorOptions
+
+```IyzicoBlazorOptions``` is used to configure Iyzico payment gateway Blazor options.
+
+* ```Recommended```: Is payment gateway recommended or not. This information is displayed on payment gateway selection page.
* ```ExtraInfos```: List of informative strings for payment gateway. These texts are displayed on payment gateway selection page.
-* ```PrePaymentCheckoutButtonStyle```: CSS style to add Checkout button on Iyzico prepayment page. This class can be used for tracking user activity via 3rd party tools like Google Tag Manager.
+* ```PrePaymentCheckoutButtonStyle```: CSS style to add to the Checkout button on the Iyzico prepayment page.
### AlipayOptions
@@ -285,9 +624,17 @@ Configure(options =>
#### AlipayWebOptions
-* ```Recommended```: Is payment gateway is recommended or not. This information is displayed on payment gateway selection page.
+* ```Recommended```: Is payment gateway recommended or not. This information is displayed on payment gateway selection page.
+* ```ExtraInfos```: List of informative strings for payment gateway. These texts are displayed on payment gateway selection page.
+* ```PrePaymentCheckoutButtonStyle```: CSS style to add to the Checkout button on the Alipay prepayment page. This class can be used for tracking user activity via 3rd party tools like Google Tag Manager.
+
+#### AlipayBlazorOptions
+
+```AlipayBlazorOptions``` is used to configure Alipay payment gateway Blazor options.
+
+* ```Recommended```: Is payment gateway recommended or not. This information is displayed on payment gateway selection page.
* ```ExtraInfos```: List of informative strings for payment gateway. These texts are displayed on payment gateway selection page.
-* ```PrePaymentCheckoutButtonStyle```: CSS style to add Checkout button on Iyzico prepayment page. This class can be used for tracking user activity via 3rd party tools like Google Tag Manager.
+* ```PrePaymentCheckoutButtonStyle```: CSS style to add to the Checkout button on the Alipay prepayment page.
> You can check the [Alipay document](https://opendocs.alipay.com/open/02np97) for more details.
@@ -541,7 +888,7 @@ PrePayment page asks users for extra information if requested by the external pa
PostPayment page is responsible for validation of the response of the external payment gateway. When a user completes the payment, user is redirected to PostPayment page for that payment gateway and PostPayment page validates the status of the payment. If the payment is succeeded, status of the payment request is updated and user is redirected to main application.
-Note: It is main application's responsibility to handle if a payment request is used more than one time. For example if PostPayment page generates a URL like https://mywebsite.com/PaymentSucceed?PaymentRequestId={PaymentRequestId}, this URL can be visited more than onec manually by end users. If you already delivered your product for a given PaymentRequestId, you shouldn't deliver it when this URL is visited second time.
+Note: It is the main application's responsibility to handle if a payment request is used more than once. For example, if the PostPayment page generates a URL like https://mywebsite.com/PaymentSucceed?PaymentRequestId={PaymentRequestId}, this URL can be visited more than once manually by end users. If you have already delivered your product for a given PaymentRequestId, you shouldn't deliver it when this URL is visited a second time.
### Creating One-Time Payment
@@ -563,7 +910,7 @@ public class IndexModel: PageModel
{
var paymentRequest = await _paymentRequestAppService.CreateAsync(new PaymentRequestCreateDto()
{
- Currency= "USD",
+ Currency = "USD",
Products = new List()
{
new PaymentRequestProductCreateDto
@@ -582,7 +929,7 @@ public class IndexModel: PageModel
}
```
-If the payment is successful, payment module will return to configured ```PaymentWebOptions.CallbackUrl```. The main application can take necessary actions for a successful payment (Activating a user account, triggering a shipment start process etc...).
+If the payment is successful, payment module will return to the configured ```PaymentWebOptions.CallbackUrl```. The main application can take necessary actions for a successful payment (activating a user account, triggering a shipment start process, etc.).
## Subscriptions