Browse Source

Merge remote-tracking branch 'origin/rel-11.0' into auto-merge-forward/rel-11.0-to-dev-185

pull/26483/head
github-actions[bot] 1 week ago
parent
commit
4476b5ff2c
  1. 2
      Directory.Packages.props
  2. 2
      docs/en/modules/payment-custom-gateway.md
  3. 6
      docs/en/package-version-changes.md
  4. 23
      docs/en/release-info/migration-guides/abp-11-0.md

2
Directory.Packages.props

@ -124,7 +124,7 @@
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.19.2" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.19.2" />
<PackageVersion Include="Minio" Version="6.0.5" />
<PackageVersion Include="MongoDB.Driver" Version="3.13.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.14.0" />
<PackageVersion Include="Elastic.Clients.Elasticsearch" Version="8.19.27" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
<PackageVersion Include="Nito.AsyncEx.Context" Version="5.1.2" />

2
docs/en/modules/payment-custom-gateway.md

@ -149,6 +149,8 @@ This document explains how to create a custom payment gateway that is different
The Payment module does not call `IsValid` when offering or selecting gateways; the gateways offered to the user are determined by the `PaymentOptions.Gateways` and `PaymentWebOptions.Gateways` registrations (see [PaymentOptions](payment.md#paymentoptions)). Some built-in gateways call their own `IsValid` inside `CompleteAsync` to verify the provider response, and a custom gateway can do the same. `StartAsync` passes the request currency to the provider adapter together with the amount. `CompleteAsync` verifies the provider response and reconciles the request identifier, amount, currency, and provider transaction identifier before changing the request state. `HandleWebhookAsync` must validate the webhook signature or equivalent authenticity proof before processing its payload.
Payment prices are `float`. If your provider adapter needs a `decimal`, convert them with `PaymentAmountHelper.ToDecimal` from the `Volo.Payment` namespace. On .NET 11, a direct conversion keeps the binary error of the `float`, so `19.99f` becomes `19.9899997711181640625m`.
`IMyGatewayTransactionRepository` is application-owned; it isn't part of the Payment module. Implement `TryBindAsync` as an atomic insert-or-match operation. For this one-time gateway, add unique database constraints for both the provider transaction identifier and the payment request identifier, accept an existing row only when the same pair is retried, and execute the binding and payment-request update in the same unit of work. This persists the provider transaction identifier while rejecting cross-request replay and a different transaction for an already-bound request.
The Payment HTTP API forwards `POST /api/payment/{paymentMethod}/webhook` to `HandleWebhookAsync`. Configure the provider to use this URL with your gateway name as `paymentMethod`, for example `/api/payment/MyGateway/webhook`. Always validate the provider signature before processing the payload.

6
docs/en/package-version-changes.md

@ -7,6 +7,12 @@
# Package Version Changes
## 11.0.0-rc.2
| Package | Old Version | New Version | PR |
|---------|-------------|-------------|-----|
| MongoDB.Driver | 3.13.0 | 3.14.0 | #26481 |
## 10.7.2
| Package | Old Version | New Version | PR |

23
docs/en/release-info/migration-guides/abp-11-0.md

@ -328,3 +328,26 @@ Reference the `Polly` package in the projects that use it, as described in the o
Add the new parameter to your derived constructors and pass it to the base constructor. If you override `RegisterPasskey`, change its return type to `Task<PasskeyDto>`.
No database migration is needed. The AAGUID is stored inside the existing passkey data, and the passkeys registered before the upgrade have no AAGUID, so they keep showing as unnamed until the user renames them.
### Payment Amount Conversions
**Who is affected**
- Custom payment gateways and application code that convert Payment module prices from `float` to `decimal`.
**What changed**
Payment prices are still `float`. On .NET 11, converting `19.99f` directly to `decimal` returns `19.9899997711181640625m` instead of `19.99m`. This can change amounts sent to payment providers or compared with their responses. The built-in gateways already handle these conversions on .NET 11.
**What to do**
No action is needed if you only use the built-in gateways and don't convert these prices yourself. Otherwise, use `PaymentAmountHelper.ToDecimal(float)` from the `Volo.Payment.Domain` package when converting Payment prices to `decimal`:
```csharp
using Volo.Payment;
decimal unitPrice = PaymentAmountHelper.ToDecimal(product.UnitPrice);
decimal totalPrice = PaymentAmountHelper.ToDecimal(product.TotalPrice);
```
The helper rounds to seven significant digits, rather than a fixed number of decimal places. For your own decimal constants, use a decimal literal such as `19.99m` instead of `(decimal)19.99f`.

Loading…
Cancel
Save