ysfuture.payment
1.0.2
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
dotnet add package ysfuture.payment --version 1.0.2
NuGet\Install-Package ysfuture.payment -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ysfuture.payment" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ysfuture.payment" Version="1.0.2" />
<PackageReference Include="ysfuture.payment" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ysfuture.payment --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ysfuture.payment, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ysfuture.payment@1.0.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ysfuture.payment&version=1.0.2
#tool nuget:?package=ysfuture.payment&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ysfuture.payment
盈硕未来内部支付服务客户端 SDK。
安装
dotnet add package ysfuture.payment --version 1.0.2
ASP.NET Core 接入
builder.Services.AddYSFuturePayment(builder.Configuration.GetSection("YSFuturePayment"));
配置由接入项目自行提供,SDK 不包含任何支付密钥:
{
"YSFuturePayment": {
"BaseUrl": "https://payment.ysfuture.com.cn",
"AppId": "<your-app-id>",
"ApiSecret": "<your-api-secret>",
"WebhookSecret": "<your-webhook-secret>",
"TimeoutSeconds": 15
}
}
微信扫码调用:
public class CheckoutService(IYSFuturePaymentClient paymentClient)
{
public Task<YSFuturePaymentOrder> CreateOrderAsync()
{
return paymentClient.CreateOrderAsync(new YSFutureCreatePaymentOrderRequest
{
ClientOrderNo = YSFuturePaymentOrderNo.Create(),
ExternalUserId = "user-001",
ProductCode = "ACTIVITY-STANDARD-7D-TRIAL",
PayProvider = YSFuturePayProviders.WeChat,
PayMode = YSFuturePayModes.Native,
ReturnUrl = "https://your-site.example/pay/success",
QuitUrl = "https://your-site.example/pay/cancel"
});
}
}
微信 native 返回 CodeUrl / QrCodeSvg,可以直接渲染二维码。
支付宝电脑网站支付使用 native,返回 AlipayFormHtml,接入项目应把该 HTML 写入新页面或作为 text/html 返回给浏览器,让表单自动提交到支付宝:
var order = await paymentClient.CreateOrderAsync(new YSFutureCreatePaymentOrderRequest
{
ClientOrderNo = YSFuturePaymentOrderNo.Create("order"),
ExternalUserId = "user-001",
ProductCode = "CREATOR",
PayProvider = YSFuturePayProviders.Alipay,
PayMode = YSFuturePayModes.Native,
ReturnUrl = "https://your-site.example/pay/success",
QuitUrl = "https://your-site.example/pay/cancel"
});
var html = order.AlipayFormHtml;
Webhook 验签
var ok = YSFuturePaymentWebhookVerifier.VerifySignature(
webhookSecret,
method: "POST",
pathAndQuery: Request.Path + Request.QueryString,
timestamp: Request.Headers["X-Payment-Timestamp"],
nonce: Request.Headers["X-Payment-Nonce"],
body: bodyJson,
signature: Request.Headers["X-Payment-Signature"]);
完整接入文档见仓库 docs/payment-integration.md。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- System.Text.Json (>= 8.0.5)
-
net8.0
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
1.0.2: 更新支付宝 native 接入说明,明确支付宝 native 返回 AlipayFormHtml;保留 data.list 商品响应解析。