mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-16 07:59:44 +08:00
style: clean code
This commit is contained in:
parent
cf94c2816f
commit
125b69063f
@ -43,13 +43,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.CreateRequest(request, HttpMethod.Get, "bill", "tradebill")
|
||||
.SetQueryParam("bill_date", request.BillDateString);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.SubMerchantId))
|
||||
if (request.SubMerchantId != null)
|
||||
flurlReq.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.BillType))
|
||||
if (request.BillType != null)
|
||||
flurlReq.SetQueryParam("bill_type", request.BillType);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.TarType))
|
||||
if (request.TarType != null)
|
||||
flurlReq.SetQueryParam("tar_type", request.TarType);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetBillTradeBillResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
@ -84,10 +84,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.CreateRequest(request, HttpMethod.Get, "bill", "fundflowbill")
|
||||
.SetQueryParam("bill_date", request.BillDateString);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.AccountType))
|
||||
if (request.AccountType != null)
|
||||
flurlReq.SetQueryParam("account_type", request.AccountType);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.TarType))
|
||||
if (request.TarType != null)
|
||||
flurlReq.SetQueryParam("tar_type", request.TarType);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetBillFundflowBillResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
@ -117,10 +117,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.SetQueryParam("bill_date", request.BillDateString)
|
||||
.SetQueryParam("algorithm", request.Algorithm);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.AccountType))
|
||||
if (request.AccountType != null)
|
||||
flurlReq.SetQueryParam("account_type", request.AccountType);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.TarType))
|
||||
if (request.TarType != null)
|
||||
flurlReq.SetQueryParam("tar_type", request.TarType);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetBillSubMerchantFundflowBillResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
|
@ -52,7 +52,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.CreateRequest(request, HttpMethod.Get, "businesscircle", "user-authorizations", request.OpenId)
|
||||
.SetQueryParam("appid", request.AppId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.SubMerchantId))
|
||||
if (request.SubMerchantId != null)
|
||||
flurlReq.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetBusinessCircleUserAuthorizationByOpenIdResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
|
@ -28,14 +28,14 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.CombineMerchantId))
|
||||
if (request.CombineMerchantId == null)
|
||||
request.CombineMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
if (request.SubOrderList != null)
|
||||
{
|
||||
foreach (var subOrder in request.SubOrderList)
|
||||
{
|
||||
if (string.IsNullOrEmpty(subOrder.MerchantId))
|
||||
if (subOrder.MerchantId == null)
|
||||
subOrder.MerchantId = request.CombineMerchantId;
|
||||
}
|
||||
}
|
||||
@ -62,14 +62,14 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.CombineMerchantId))
|
||||
if (request.CombineMerchantId == null)
|
||||
request.CombineMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
if (request.SubOrderList != null)
|
||||
{
|
||||
foreach (var subOrder in request.SubOrderList)
|
||||
{
|
||||
if (string.IsNullOrEmpty(subOrder.MerchantId))
|
||||
if (subOrder.MerchantId == null)
|
||||
subOrder.MerchantId = request.CombineMerchantId;
|
||||
}
|
||||
}
|
||||
@ -94,14 +94,14 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.CombineMerchantId))
|
||||
if (request.CombineMerchantId == null)
|
||||
request.CombineMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
if (request.SubOrderList != null)
|
||||
{
|
||||
foreach (var subOrder in request.SubOrderList)
|
||||
{
|
||||
if (string.IsNullOrEmpty(subOrder.MerchantId))
|
||||
if (subOrder.MerchantId == null)
|
||||
subOrder.MerchantId = request.CombineMerchantId;
|
||||
}
|
||||
}
|
||||
@ -126,14 +126,14 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.CombineMerchantId))
|
||||
if (request.CombineMerchantId == null)
|
||||
request.CombineMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
if (request.SubOrderList != null)
|
||||
{
|
||||
foreach (var subOrder in request.SubOrderList)
|
||||
{
|
||||
if (string.IsNullOrEmpty(subOrder.MerchantId))
|
||||
if (subOrder.MerchantId == null)
|
||||
subOrder.MerchantId = request.CombineMerchantId;
|
||||
}
|
||||
}
|
||||
@ -182,7 +182,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
{
|
||||
foreach (var subOrder in request.SubOrderList)
|
||||
{
|
||||
if (string.IsNullOrEmpty(subOrder.MerchantId))
|
||||
if (subOrder.MerchantId == null)
|
||||
subOrder.MerchantId = client.Credentials.MerchantId;
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.SetQueryParam("account_type", request.AccountType)
|
||||
.SetQueryParam("algorithm", request.Algorithm);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.TarType))
|
||||
if (request.TarType != null)
|
||||
flurlReq.SetQueryParam("tar_type", request.TarType);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetEcommerceBillFundflowBillResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
|
@ -33,7 +33,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Get, "ecommerce", "fund", "balance", request.SubMerchantId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.AccountType))
|
||||
if (request.AccountType != null)
|
||||
flurlReq.SetQueryParam("account_type", request.AccountType);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetEcommerceFundBalanceResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
|
@ -30,13 +30,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileName))
|
||||
if (request.FileName == null)
|
||||
request.FileName = Guid.NewGuid().ToString("N").ToLower() + ".txt";
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileHash))
|
||||
if (request.FileHash == null)
|
||||
request.FileHash = Security.SHA256Utility.Hash(request.FileBytes).ToLower();
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileContentType))
|
||||
if (request.FileContentType == null)
|
||||
request.FileContentType = Utilities.FileNameToContentTypeMapper.GetContentTypeForImage(request.FileName!) ?? "text/plain";
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
|
@ -28,7 +28,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.BelongMerchantId))
|
||||
if (request.BelongMerchantId == null)
|
||||
request.BelongMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -155,25 +155,25 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.CreateRequest(request, HttpMethod.Get, "marketing", "busifavor", "users", request.OpenId, "coupons")
|
||||
.SetQueryParam("appid", request.AppId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.StockId))
|
||||
if (request.StockId != null)
|
||||
flurlReq.SetQueryParam("stock_id", request.StockId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.CouponState))
|
||||
if (request.CouponState != null)
|
||||
flurlReq.SetQueryParam("coupon_state", request.CouponState);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.CreatorMerchantId))
|
||||
if (request.CreatorMerchantId != null)
|
||||
flurlReq.SetQueryParam("creator_mchid", request.CreatorMerchantId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.SenderMerchantId))
|
||||
if (request.SenderMerchantId != null)
|
||||
flurlReq.SetQueryParam("sender_mchid", request.SenderMerchantId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.BelongMerchantId))
|
||||
if (request.BelongMerchantId != null)
|
||||
flurlReq.SetQueryParam("belong_merchant", request.BelongMerchantId);
|
||||
|
||||
if (request.Limit.HasValue)
|
||||
if (request.Limit != null)
|
||||
flurlReq.SetQueryParam("limit", request.Limit.Value.ToString());
|
||||
|
||||
if (request.Offset.HasValue)
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset.Value.ToString());
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QueryMarketingBusifavorUserCouponsResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
@ -312,7 +312,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -336,7 +336,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -359,10 +359,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.PayerMerchantId))
|
||||
if (request.PayerMerchantId == null)
|
||||
request.PayerMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
if (string.IsNullOrEmpty(request.PayeeMerchantId))
|
||||
if (request.PayeeMerchantId == null)
|
||||
request.PayeeMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -405,10 +405,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.PayerMerchantId))
|
||||
if (request.PayerMerchantId == null)
|
||||
request.PayerMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
if (string.IsNullOrEmpty(request.PayeeMerchantId))
|
||||
if (request.PayeeMerchantId == null)
|
||||
request.PayeeMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
|
@ -28,7 +28,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.BelongMerchantId))
|
||||
if (request.BelongMerchantId == null)
|
||||
request.BelongMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -52,7 +52,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.StockCreatorMerchantId))
|
||||
if (request.StockCreatorMerchantId == null)
|
||||
request.StockCreatorMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -76,7 +76,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.StockCreatorMerchantId))
|
||||
if (request.StockCreatorMerchantId == null)
|
||||
request.StockCreatorMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -100,7 +100,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.StockCreatorMerchantId))
|
||||
if (request.StockCreatorMerchantId == null)
|
||||
request.StockCreatorMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -124,7 +124,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.StockCreatorMerchantId))
|
||||
if (request.StockCreatorMerchantId == null)
|
||||
request.StockCreatorMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -148,7 +148,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.StockCreatorMerchantId))
|
||||
if (request.StockCreatorMerchantId == null)
|
||||
request.StockCreatorMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -157,13 +157,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.SetQueryParam("limit", request.Limit.ToString())
|
||||
.SetQueryParam("offset", request.Offset.ToString());
|
||||
|
||||
if (request.CreateStartTime.HasValue)
|
||||
if (request.CreateStartTime != null)
|
||||
flurlReq.SetQueryParam("create_start_time", request.CreateStartTime.Value.ToString("yyyy-MM-dd'T'HH:mm:sszzz"));
|
||||
|
||||
if (request.CreateEndTime.HasValue)
|
||||
if (request.CreateEndTime != null)
|
||||
flurlReq.SetQueryParam("create_end_time", request.CreateEndTime.Value.ToString("yyyy-MM-dd'T'HH:mm:sszzz"));
|
||||
|
||||
if (!string.IsNullOrEmpty(request.Status))
|
||||
if (request.Status != null)
|
||||
flurlReq.SetQueryParam("status", request.Status);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QueryMarketingFavorStocksResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
@ -183,7 +183,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.StockCreatorMerchantId))
|
||||
if (request.StockCreatorMerchantId == null)
|
||||
request.StockCreatorMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -209,7 +209,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.StockCreatorMerchantId))
|
||||
if (request.StockCreatorMerchantId == null)
|
||||
request.StockCreatorMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -277,7 +277,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.StockCreatorMerchantId))
|
||||
if (request.StockCreatorMerchantId == null)
|
||||
request.StockCreatorMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -326,25 +326,25 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.CreateRequest(request, HttpMethod.Get, "marketing", "favor", "users", request.OpenId, "coupons")
|
||||
.SetQueryParam("appid", request.AppId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.StockId))
|
||||
if (request.StockId != null)
|
||||
flurlReq.SetQueryParam("stock_id", request.StockId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.Status))
|
||||
if (request.Status != null)
|
||||
flurlReq.SetQueryParam("status", request.Status);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.CreatorMerchantId))
|
||||
if (request.CreatorMerchantId != null)
|
||||
flurlReq.SetQueryParam("creator_mchid", request.CreatorMerchantId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.SenderMerchantId))
|
||||
if (request.SenderMerchantId != null)
|
||||
flurlReq.SetQueryParam("sender_mchid", request.SenderMerchantId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.AvailableMerchantId))
|
||||
if (request.AvailableMerchantId != null)
|
||||
flurlReq.SetQueryParam("available_mchid", request.AvailableMerchantId);
|
||||
|
||||
if (request.Limit.HasValue)
|
||||
if (request.Limit != null)
|
||||
flurlReq.SetQueryParam("limit", request.Limit.Value.ToString());
|
||||
|
||||
if (request.Offset.HasValue)
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset.Value.ToString());
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QueryMarketingFavorUserCouponsResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
@ -364,7 +364,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
|
@ -30,13 +30,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileName))
|
||||
if (request.FileName == null)
|
||||
request.FileName = Guid.NewGuid().ToString("N").ToLower() + ".png";
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileHash))
|
||||
if (request.FileHash == null)
|
||||
request.FileHash = Security.SHA256Utility.Hash(request.FileBytes).ToLower();
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileContentType))
|
||||
if (request.FileContentType == null)
|
||||
request.FileContentType = Utilities.FileNameToContentTypeMapper.GetContentTypeForImage(request.FileName!) ?? "image/png";
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
|
@ -79,10 +79,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (request.AuthorizedData != null)
|
||||
flurlReq.SetQueryParam("authorized_data", client.JsonSerializer.Serialize(request.AuthorizedData));
|
||||
|
||||
if (request.Limit.HasValue)
|
||||
if (request.Limit != null)
|
||||
flurlReq.SetQueryParam("limit", request.Limit.Value.ToString());
|
||||
|
||||
if (request.Offset.HasValue)
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset.Value.ToString());
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QueryMarketingPartnershipsResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
|
@ -73,13 +73,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.SetQueryParam("limit", request.Limit.ToString())
|
||||
.SetQueryParam("offset", request.Offset.ToString());
|
||||
|
||||
if (!string.IsNullOrEmpty(request.ActivityName))
|
||||
if (request.ActivityName != null)
|
||||
flurlReq.SetQueryParam("activity_name", request.ActivityName);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.ActivityStatus))
|
||||
if (request.ActivityStatus != null)
|
||||
flurlReq.SetQueryParam("activity_status", request.ActivityStatus);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.AwardType))
|
||||
if (request.AwardType != null)
|
||||
flurlReq.SetQueryParam("award_type", request.AwardType);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QueryMarketingPayGiftActivitiesResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
@ -142,10 +142,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Get, "marketing", "paygiftactivity", "activities", request.ActivityId, "merchants");
|
||||
|
||||
if (request.Limit.HasValue)
|
||||
if (request.Limit != null)
|
||||
flurlReq.SetQueryParam("limit", request.Limit.Value.ToString());
|
||||
|
||||
if (request.Offset.HasValue)
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset.Value.ToString());
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QueryMarketingPayGiftActivityMerchantsResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
@ -188,10 +188,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Get, "marketing", "paygiftactivity", "activities", request.ActivityId, "goods");
|
||||
|
||||
if (request.Limit.HasValue)
|
||||
if (request.Limit != null)
|
||||
flurlReq.SetQueryParam("limit", request.Limit.Value.ToString());
|
||||
|
||||
if (request.Offset.HasValue)
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset.Value.ToString());
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QueryMarketingPayGiftActivityGoodsResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
|
@ -34,7 +34,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.SetQueryParam("date", request.DateString)
|
||||
.SetQueryParam("limit", request.Limit);
|
||||
|
||||
if (request.Offset.HasValue)
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QueryMerchantFundMerchantIncomeRecordsResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
@ -60,7 +60,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.SetQueryParam("date", request.DateString)
|
||||
.SetQueryParam("limit", request.Limit);
|
||||
|
||||
if (request.Offset.HasValue)
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QueryMerchantFundPartnerIncomeRecordsResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
|
@ -89,7 +89,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.CreateRequest(request, HttpMethod.Get, "merchant", "fund", "withdraw", "bill-type", request.BillType)
|
||||
.SetQueryParam("bill_date", request.BillDateString);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.TarType))
|
||||
if (request.TarType != null)
|
||||
flurlReq.SetQueryParam("tar_type", request.TarType);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetMerchantFundWithdrawBillResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
|
@ -30,13 +30,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileName))
|
||||
if (request.FileName == null)
|
||||
request.FileName = Guid.NewGuid().ToString("N").ToLower() + ".png";
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileHash))
|
||||
if (request.FileHash == null)
|
||||
request.FileHash = Security.SHA256Utility.Hash(request.FileBytes).ToLower();
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileContentType))
|
||||
if (request.FileContentType == null)
|
||||
request.FileContentType = Utilities.FileNameToContentTypeMapper.GetContentTypeForImage(request.FileName!) ?? "image/png";
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -69,13 +69,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileName))
|
||||
if (request.FileName == null)
|
||||
request.FileName = Guid.NewGuid().ToString("N").ToLower() + ".mp4";
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileHash))
|
||||
if (request.FileHash == null)
|
||||
request.FileHash = Security.SHA256Utility.Hash(request.FileBytes).ToLower();
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileContentType))
|
||||
if (request.FileContentType == null)
|
||||
request.FileContentType = Utilities.FileNameToContentTypeMapper.GetContentTypeForVideo(request.FileName!) ?? "video/mp4";
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
|
@ -35,13 +35,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.SetQueryParam("begin_date", request.BeginDateString)
|
||||
.SetQueryParam("end_date", request.EndDateString);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.ComplaintedMerchantId))
|
||||
if (request.ComplaintedMerchantId != null)
|
||||
flurlReq.SetQueryParam("complainted_mchid", request.ComplaintedMerchantId);
|
||||
|
||||
if (request.Limit.HasValue)
|
||||
if (request.Limit != null)
|
||||
flurlReq.SetQueryParam("limit", request.Limit.Value.ToString());
|
||||
|
||||
if (request.Offset.HasValue)
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset.Value.ToString());
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QueryMerchantServiceComplaintsResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
@ -84,10 +84,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Get, "merchant-service", "complaints-v2", request.ComplaintId, "negotiation-historys");
|
||||
|
||||
if (request.Limit.HasValue)
|
||||
if (request.Limit != null)
|
||||
flurlReq.SetQueryParam("limit", request.Limit.Value.ToString());
|
||||
|
||||
if (request.Offset.HasValue)
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset.Value.ToString());
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QueryMerchantServiceComplaintNegotiationHistoriesResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
@ -107,7 +107,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.ComplaintedMerchantId))
|
||||
if (request.ComplaintedMerchantId == null)
|
||||
request.ComplaintedMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -130,7 +130,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.ComplaintedMerchantId))
|
||||
if (request.ComplaintedMerchantId == null)
|
||||
request.ComplaintedMerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -233,13 +233,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileName))
|
||||
if (request.FileName == null)
|
||||
request.FileName = Guid.NewGuid().ToString("N").ToLower() + ".png";
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileHash))
|
||||
if (request.FileHash == null)
|
||||
request.FileHash = Security.SHA256Utility.Hash(request.FileBytes).ToLower();
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileContentType))
|
||||
if (request.FileContentType == null)
|
||||
request.FileContentType = Utilities.FileNameToContentTypeMapper.GetContentTypeForImage(request.FileName!) ?? "image/png";
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
|
@ -50,15 +50,15 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.CreateRequest(request, HttpMethod.Get, "partner-transfer", "batches", "batch-id", request.BatchId)
|
||||
.SetQueryParam("need_query_detail", request.RequireQueryDetail);
|
||||
|
||||
if (request.Offset.HasValue)
|
||||
if (request.DetailStatus != null)
|
||||
flurlReq.SetQueryParam("detail_status", request.DetailStatus);
|
||||
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset.Value);
|
||||
|
||||
if (request.Limit.HasValue)
|
||||
if (request.Limit != null)
|
||||
flurlReq.SetQueryParam("limit", request.Limit.Value);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.DetailStatus))
|
||||
flurlReq.SetQueryParam("detail_status", request.DetailStatus);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetPartnerTransferBatchByBatchIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
@ -98,15 +98,15 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.CreateRequest(request, HttpMethod.Get, "partner-transfer", "batches", "out-batch-no", request.OutBatchNumber)
|
||||
.SetQueryParam("need_query_detail", request.RequireQueryDetail);
|
||||
|
||||
if (request.Offset.HasValue)
|
||||
if (request.DetailStatus != null)
|
||||
flurlReq.SetQueryParam("detail_status", request.DetailStatus);
|
||||
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset.Value);
|
||||
|
||||
if (request.Limit.HasValue)
|
||||
if (request.Limit != null)
|
||||
flurlReq.SetQueryParam("limit", request.Limit.Value);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.DetailStatus))
|
||||
flurlReq.SetQueryParam("detail_status", request.DetailStatus);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetPartnerTransferBatchByOutBatchNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -53,7 +53,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -76,7 +76,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -98,7 +98,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -125,7 +125,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -154,7 +154,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -183,7 +183,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
|
@ -93,10 +93,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.SetQueryParam("appid", request.AppId)
|
||||
.SetQueryParam("sub_appid", request.SubAppId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.OpenId))
|
||||
if (request.OpenId != null)
|
||||
flurlReq.SetQueryParam("openid", request.OpenId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.SubOpenId))
|
||||
if (request.SubOpenId != null)
|
||||
flurlReq.SetQueryParam("sub_openid", request.SubOpenId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetPayScorePartnerPermissionsByOpenIdResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
|
@ -27,7 +27,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -50,7 +50,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -72,7 +72,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -94,7 +94,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -120,7 +120,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -147,7 +147,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
@ -174,7 +174,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.MerchantId))
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
|
@ -52,7 +52,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.CreateRequest(request, HttpMethod.Get, "profitsharing", "orders", request.OutOrderNumber)
|
||||
.SetQueryParam("transaction_id", request.TransactionId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.SubMerchantId))
|
||||
if (request.SubMerchantId != null)
|
||||
flurlReq.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetProfitSharingOrderByOutOrderNumberResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
@ -97,7 +97,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.SetQueryParam("out_order_no", request.OutOrderNumber)
|
||||
.SetQueryParam("out_return_no", request.OutReturnNumber);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.SubMerchantId))
|
||||
if (request.SubMerchantId != null)
|
||||
flurlReq.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetProfitSharingReturnOrderByOutOrderNumberResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
@ -221,10 +221,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.CreateRequest(request, HttpMethod.Get, "profitsharing", "bills")
|
||||
.SetQueryParam("bill_date", request.BillDateString);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.SubMerchantId))
|
||||
if (request.SubMerchantId != null)
|
||||
flurlReq.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.TarType))
|
||||
if (request.TarType != null)
|
||||
flurlReq.SetQueryParam("tar_type", request.TarType);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetProfitSharingBillResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
|
@ -73,7 +73,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Get, "refund", "domestic", "refunds", request.OutRefundNumber);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.SubMerchantId))
|
||||
if (request.SubMerchantId != null)
|
||||
flurlReq.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetRefundDomesticRefundByOutRefundNumberResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
|
@ -72,22 +72,22 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.CreateRequest(request, HttpMethod.Get, "smartguide", "guides")
|
||||
.SetQueryParam("store_id", request.StoreId.ToString());
|
||||
|
||||
if (!string.IsNullOrEmpty(request.SubMerchantId))
|
||||
if (request.SubMerchantId != null)
|
||||
flurlReq.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.UserId))
|
||||
if (request.UserId != null)
|
||||
flurlReq.SetQueryParam("userid", request.UserId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.UserMobile))
|
||||
if (request.UserMobile != null)
|
||||
flurlReq.SetQueryParam("mobile", request.UserMobile);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.UserWorkId))
|
||||
if (request.UserWorkId != null)
|
||||
flurlReq.SetQueryParam("work_id", request.UserWorkId);
|
||||
|
||||
if (request.Limit.HasValue)
|
||||
if (request.Limit != null)
|
||||
flurlReq.SetQueryParam("limit", request.Limit.Value.ToString());
|
||||
|
||||
if (request.Offset.HasValue)
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset.Value.ToString());
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QuerySmartGuidesResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
|
@ -51,15 +51,15 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.CreateRequest(request, HttpMethod.Get, "transfer", "batches", "batch-id", request.BatchId)
|
||||
.SetQueryParam("need_query_detail", request.RequireQueryDetail);
|
||||
|
||||
if (request.Offset.HasValue)
|
||||
if (request.DetailStatus != null)
|
||||
flurlReq.SetQueryParam("detail_status", request.DetailStatus);
|
||||
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset.Value);
|
||||
|
||||
if (request.Limit.HasValue)
|
||||
if (request.Limit != null)
|
||||
flurlReq.SetQueryParam("limit", request.Limit.Value);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.DetailStatus))
|
||||
flurlReq.SetQueryParam("detail_status", request.DetailStatus);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetTransferBatchByBatchIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
@ -99,15 +99,15 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.CreateRequest(request, HttpMethod.Get, "transfer", "batches", "out-batch-no", request.OutBatchNumber)
|
||||
.SetQueryParam("need_query_detail", request.RequireQueryDetail);
|
||||
|
||||
if (request.Offset.HasValue)
|
||||
if (request.DetailStatus != null)
|
||||
flurlReq.SetQueryParam("detail_status", request.DetailStatus);
|
||||
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset.Value);
|
||||
|
||||
if (request.Limit.HasValue)
|
||||
if (request.Limit != null)
|
||||
flurlReq.SetQueryParam("limit", request.Limit.Value);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.DetailStatus))
|
||||
flurlReq.SetQueryParam("detail_status", request.DetailStatus);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetTransferBatchByOutBatchNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
@ -213,7 +213,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.SetQueryParam("accept_type", request.AcceptType)
|
||||
.SetQueryParam("out_detail_no", request.OutDetailNumber);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.OutBatchNumber))
|
||||
if (request.OutBatchNumber != null)
|
||||
flurlReq.SetQueryParam("out_batch_no", request.OutBatchNumber);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetTransferDetailElectronicReceiptByOutDetailNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
|
@ -35,7 +35,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
.SetQueryParam("plate_color", request.PlateColor)
|
||||
.SetQueryParam("openid", request.OpenId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.SubMerchantId))
|
||||
if (request.SubMerchantId != null)
|
||||
flurlReq.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetVehicleParkingServiceResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
@ -98,7 +98,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Get, "vehicle", "transactions", "out-trade-no", request.OutTradeNumber);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.SubMerchantId))
|
||||
if (request.SubMerchantId != null)
|
||||
flurlReq.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetVehicleTransactionByOutTradeNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
|
@ -68,12 +68,12 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
{
|
||||
IFlurlRequest flurlRequest = FlurlClient.Request(urlSegments).WithVerb(method);
|
||||
|
||||
if (request.Timeout.HasValue)
|
||||
if (request.Timeout != null)
|
||||
{
|
||||
flurlRequest.WithTimeout(TimeSpan.FromMilliseconds(request.Timeout.Value));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(request.WechatpayCertSerialNumber))
|
||||
if (request.WechatpayCertSerialNumber != null)
|
||||
{
|
||||
flurlRequest.Headers.Remove("Wechatpay-Serial");
|
||||
flurlRequest.WithHeader("Wechatpay-Serial", request.WechatpayCertSerialNumber);
|
||||
|
Loading…
Reference in New Issue
Block a user