Starts in:
0 DAY
22 HRS
40 MIN
33 SEC
Starts in:
0 D
22 H
40 M
33 S
Open Closed

Stripe payment #4552


User avatar
0
FabriceC created
  • ABP Framework version: v5.3.5
  • UI type:MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hi,

I use the Payment module for subscriptions and it works well. But there are two points that need to be improved.

  1. When collecting payment by credit card, it is not possible to ask the interface to collect the customer's address. This is problematic for the first invoice. Even if I collect the address later and save it to Stripe, the address is not there because the invoice is not editable.
  2. Webhooks work, information is updated in Saas and custom processing takes place on SubscriptionCreatedEto. But the result in Stripe is still 500.

Here is the code : var paymentRequest = await SubscriptionAppService.CreateSubscriptionAsync(EditionId, CurrentTenant.GetId()); return LocalRedirectPreserveMethod("/Payment/GatewaySelection?paymentRequestId=" + paymentRequest.Id);

I want to stay on .net core 6 for now.

Thank you for your help.


3 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    When collecting payment by credit card, it is not possible to ask the interface to collect the customer's address. This is problematic for the first invoice. Even if I collect the address later and save it to Stripe, the address is not there because the invoice is not editable.

    You can override PrePayment.cshtml file to perform some operations before payment from Volo.Payment.Stripe.Web assembly.

    Let me show the file that you can override:

    Pages/Payment/Stripe/PrePayment.cshtml

    @page
    @model Volo.Payment.Stripe.Pages.Payment.Stripe.PrePaymentModel
    @{
        Layout = null;
    }
    
    <!DOCTYPE html>
    <html>
    <head>
        <title>Redirecting</title>
        <script src="https://js.stripe.com/v3/"></script>
        <script>
            // Do something before redirecting to checkout page.
            Stripe("@Model.PublishableKey").redirectToCheckout({ sessionId: "@Model.SessionId"});
        </script>
    </head>
    <body>
        <p>Redirecting...</p>
        <script src="/client-proxies/payment-proxy.js"></script>
    </body>
    </html>
    

    This page is returned after a POST request, so you can't post any data in this page, but you can add some javascript code before redirection to stripe checkout page.

    You can remove <p>Redirecting...</p> part and place a form that asks some information including address and post that form with javascript client proxies, then you can call scripe redirection function. (Stripe("@Model.PublishableKey").redirectToCheckout({ sessionId: "@Model.SessionId"});)


    Webhooks work, information is updated in Saas and custom processing takes place on SubscriptionCreatedEto. But the result in Stripe is still 500.

    Can you share the 500 result? If something to do on our side, we can make improvements

  • User Avatar
    0
    FabriceC created

    Hi,

    here is the result i have in audit logs

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Unfortunately we can't say anything without stacktrace. If you have stacktrace of the exception, please provide us. In the audit logs, nothing is presented about the exception

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