Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
tooclian committed Mar 5, 2024
2 parents 7caf32b + a7bb389 commit 855028c
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.100
dotnet-version: 8.0.100

# Publish
- name: publish on version change
Expand Down
8 changes: 4 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project>
<PropertyGroup>
<TargetFrameworkVersion>net7.0</TargetFrameworkVersion>
<TargetFrameworkVersion>net8.0</TargetFrameworkVersion>

<MicrosoftPackageVersion>7.0.0</MicrosoftPackageVersion>
<MediationPackageVersion>7.0.0</MediationPackageVersion>
<MicrosoftPackageVersion>8.0.0</MicrosoftPackageVersion>
<MediationPackageVersion>8.1.0</MediationPackageVersion>

<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>7.0.0</Version>
<Version>8.0.0</Version>
<NoWarn>$(NoWarn);CS1591;CS8618;CA2211</NoWarn>
<Authors>tooclian</Authors>
<Company>toocliancode</Company>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public class WeChatAppletCode2SessionResponse : WeChatHttpResponse
/// 用户在开放平台的唯一标识符,在满足 UnionID 下发条件的情况下会返回
/// </summary>
[JsonPropertyName("unionid")]
public string UnionId { get; set; }
public string? UnionId { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/WeChat.Pay/Domain/RefundAmount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class RefundAmount
/// 上述任一条件不满足将返回错误
/// </remarks>
[JsonPropertyName("from")]
public List<RefundAmountFrom> From { get; set; }
public List<RefundAmountFrom>? From { get; set; }

/// <summary>
/// 原订单金额
Expand Down
3 changes: 1 addition & 2 deletions src/WeChat.Pay/Notify/WeChatPayNotifyRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ public class WeChatPayNotifyRequest<TWeChatPayNotifyResponse>
[JsonPropertyName("resource")]
public Resource Resource { get; set; }


[JsonIgnore]
public virtual JsonSerializerOptions? JsonSerializerOptions { get; set; } = new()
protected virtual JsonSerializerOptions? JsonSerializerOptions { get; } = new()
{
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
Expand Down
2 changes: 1 addition & 1 deletion src/WeChat.Pay/Request/App/WeChatPayAppSdkRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override Task<WeChatPayAppSdkResponse> Handle(IWeChatRequetHandleContext
var mchid = Options.MchId;
var timeStamp = HttpUtility.GetTimeStamp();
var nonceStr = HttpUtility.GenerateNonceStr();
var paySign = CryptographyExtensions.SHA256WithRSAEncrypt(rsa, $"{appId}\n{timeStamp}\n{nonceStr}\n{PrepayId}");
var paySign = CryptographyExtensions.SHA256WithRSAEncrypt(rsa, $"{appId}\n{timeStamp}\n{nonceStr}\n{PrepayId}\n");

return Task.FromResult(new WeChatPayAppSdkResponse(appId, mchid, PrepayId, timeStamp, nonceStr, paySign));
}
Expand Down
2 changes: 1 addition & 1 deletion src/WeChat.Pay/Request/Jsapi/WeChatPayJsapiSdkRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override Task<WeChatPayJsapiSdkResponse> Handle(IWeChatRequetHandleContex
var timeStamp = HttpUtility.GetTimeStamp();
var nonceStr = HttpUtility.GenerateNonceStr();
var package = $"prepay_id={PrepayId}";
var paySign = CryptographyExtensions.SHA256WithRSAEncrypt(rsa, $"{appId}\n{timeStamp}\n{nonceStr}\n{package}");
var paySign = CryptographyExtensions.SHA256WithRSAEncrypt(rsa, $"{appId}\n{timeStamp}\n{nonceStr}\n{package}\n");

return Task.FromResult(new WeChatPayJsapiSdkResponse(Options.AppId, timeStamp, nonceStr, package, paySign));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class WeChatPayDomesticRefundsRequest
: WeChatPayHttpRequest<WeChatPayDomesticRefundsResponse>
, IHasRefundNotifyUrl
{
public static string Endpoint = "/v3/refund/domestic/refunds";

/// <summary>
/// 子商户号
/// </summary>
Expand Down Expand Up @@ -110,4 +112,6 @@ public class WeChatPayDomesticRefundsRequest
/// </remarks>
[JsonPropertyName("goods_detail")]
public List<RefundGoodsDetail>? GoodsDetail { get; set; }

protected override string GetRequestUri() => $"{WeChatPayProperties.Domain}{Endpoint}";
}

0 comments on commit 855028c

Please sign in to comment.