Open Closed

Issue when using the payment module with the template module #7762


User avatar
0
taypv created

Check the docs before asking a question: https://abp.io/docs/latest/modules/payment

  • ABP Framework version: v8.2.0

  • UI Type: Blazor WASM / Blazor Server

  • Database System: EF Core (PostgreSQL)
    I encountered a 404 error and couldn't redirect to the page. Below is my project configuration.
    image.png
    log
    image.png

image.png

.Applicaiton
image.png
Application.Contracts
image.png
.Blazor
image.png
.Domain
image.png
.Domain.Shared
image.png
.EntityFrameworkCore
image.png
.HttpApi
image.png
.Http.Client
image.png
.Web
image.png
appsettings.json
image.png

page demo with blazor
image.png

My goal is to create a module that integrates ABP's payment system and works like the ABP demo. Please assist me with this. Thank you.


7 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    you can add these packages to Blazor.server project and add the module dependencies

    image.png

    BTW, payment gateway page doesn't support Blazor webassembly UI

  • User Avatar
    0
    taypv created

    I have installed the packages as you instructed, and used the method below to call, but it resulted in a 400 error.
    image.png
    image.png

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    please share the error logs

  • User Avatar
    0
    taypv created
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Redirection of the gateway selection page has to be a POST request. If you implement it as a GET request, you will get an error. You can use LocalRedirectPreserveMethod to keep the method as POST in the redirected request.

    https://abp.io/docs/latest/modules/payment#creating-one-time-payment

    You may consider using form to redirect, for example:

    <form method="post" data-ajaxForm="false" action="/Payment/GatewaySelection" id="Form">
    </form>
    
    .....
    
    await JSRuntime.InvokeVoidAsync("eval", "document.getElementById('Form').submit()");
    
  • User Avatar
    0
    taypv created

    I don't know how to implement it yet. Could you help me create a simple demo page? Thank you.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I have provided the simple code here

    image.png

    and i see there is an error message: Antiforgery token validation failed. The required antiforgery request token was not provided in either form field "__RequestVerificationToken" or header value "RequestVerificationToken".
    you can add __RequestVerificationToken to the form : https://learn.microsoft.com/en-us/aspnet/core/blazor/forms/?view=aspnetcore-8.0#input-components-and-forms

    <form method="post" data-ajaxForm="false" action="/Payment/GatewaySelection" id="Form">
        <AntiforgeryToken />
    </form>
    

    image.png

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 11, 2025, 10:10