Skip to content

Commit

Permalink
优化Sample
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreySu committed Aug 24, 2021
1 parent d4ea918 commit 14e765e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ public async Task<IActionResult> JsApi(int productId, int hc)
var price = product == null ? 100 : (int)(product.Price * 100);//单位:分

//var xmlDataInfo = new TenPayV3UnifiedorderRequestData(TenPayV3Info.AppId, TenPayV3Info.MchId, body, sp_billno, price, HttpContext.UserHostAddress()?.ToString(), TenPayV3Info.TenPayV3Notify, TenPay.TenPayV3Type.JSAPI, openId, TenPayV3Info.Key, nonceStr);
JsApiRequestData jsApiRequestData = new(new TenpayDateTime(DateTime.Now), new JsApiRequestData.Amount() { currency = "CNY", total = price },
TenPayV3Info.MchId, name, TenPayV3Info.TenPayV3Notify, new JsApiRequestData.Payer() { openid = openId }, sp_billno, null, TenPayV3Info.AppId,
JsApiRequestData jsApiRequestData = new(new TenpayDateTime(DateTime.Now.AddHours(1)), new JsApiRequestData.Amount() { currency = "CNY", total = price },
TenPayV3Info.MchId, name, TenPayV3Info.TenPayV3Notify.Replace("/TenpayV3/", "/TenpayRealV3/"), new JsApiRequestData.Payer() { openid = openId }, sp_billno, null, TenPayV3Info.AppId,
null, null, null, null);

//var result = TenPayOldV3.Unifiedorder(xmlDataInfo);//调用统一订单接口
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void JsAPiAsyncTest()
var sp_billno = string.Format("{0}{1}{2}", TenPayV3Info.MchId/*10位*/, SystemTime.Now.ToString("yyyyMMddHHmmss"),
TenPayV3Util.BuildRandomStr(6));

JsApiRequestData jsApiRequestData = new(new TenpayDateTime(DateTime.Now), new JsApiRequestData.Amount() { currency = "CNY", total = price },
JsApiRequestData jsApiRequestData = new(new TenpayDateTime(DateTime.Now.AddHours(1)), new JsApiRequestData.Amount() { currency = "CNY", total = price },
TenPayV3Info.MchId, name, TenPayV3Info.TenPayV3Notify, new JsApiRequestData.Payer() { openid = openId }, sp_billno, null, TenPayV3Info.AppId,
null, null, null, null);

Expand Down

0 comments on commit 14e765e

Please sign in to comment.