Ends in:
7 DAYS
18 HRS
58 MIN
17 SEC
Ends in:
7 D
18 H
58 M
17 S
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. log

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

page demo with blazor

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

    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.

  • 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

    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>
    

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06