Open Closed

Culture bug in payment module - paypal gateway #5340


User avatar
0
svote created
  • ABP Framework version: v7.2.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:

I created a simple new ABP Solution and added the payment module. I want to use the PayPal gateway and set it up as following:

  • added appsettings for Payment:Paypal (api credentials, env, etc.)
  • added the sample payment request from the docs

After trying it out I received an error from PayPal - invalid_request After some investigation I found out that there there seams to be a problem with the gateway depending on the UI Culture Because I am using the German ui culture - the format of the value from the testing method converted in a wrong way for PayPal (Paypal requires decimal point)

Request captured from Paypal: { "application_context": { "cancel_url": "https://localhost:44365", "locale": "de-DE", "return_url": "https://localhost:44365/Payment/PayPal/PostPayment" }, "intent": "CAPTURE", "purchase_units": [ { "amount": { "breakdown": { "item_total": { "currency_code": "EUR", "value": "41,20" } }, "currency_code": "EUR", "value": "41,20" } .... }

By using the parameter CultureInfo.InvariantCulture for the ToString method in the PayPalPaymentGateway it seams to work correctly. But at this point the package is not usable for me

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can replace it, remove and add yours MyPayPalPaymentGateway.

    Configure<PaymentOptions>(options =>
    {
        options.Gateways.Add(
            new PaymentGatewayConfiguration(
                PayPalConsts.GatewayName,
                new FixedLocalizableString("PayPal"),
                isSubscriptionSupported: false,
                typeof(PayPalPaymentGateway)
            )
        );
    });
    

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.