Skip to content

Commit

Permalink
新增line pay幕後、line pay退款、aftee幕後、後支付確認、交易取消超商代碼等相關api串接參數
Browse files Browse the repository at this point in the history
  • Loading branch information
payuni committed Dec 23, 2024
1 parent dfd4e89 commit be29751
Show file tree
Hide file tree
Showing 29 changed files with 99 additions and 45 deletions.
Binary file added .vs/payuni/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file added .vs/payuni/v16/.suo
Binary file not shown.
3 changes: 2 additions & 1 deletion PayuniSDK/Models/EncryptInfoModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public class EncryptInfoModel
public string CardExpired { get; set; }
public string CreditHash { get; set; }
public string API3D { get; set; }

public string PayNo { get; set; }

//trade_close
public string CloseType { get; set; }
public string TradeNo { get; set; }
Expand Down
Binary file modified PayuniSDK/bin/Debug/payuniSDK.dll
Binary file not shown.
Binary file modified PayuniSDK/bin/Debug/payuniSDK.pdb
Binary file not shown.
Binary file modified PayuniSDK/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7d3567eb3ddd365d402f95a5c679a44374fa09f9
355b267e70599b570db2fb106485d8380e9a6327
11 changes: 11 additions & 0 deletions PayuniSDK/obj/Debug/payuniSDK.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,14 @@ C:\Users\wistronits\Downloads\payuni20240613\payuniSDK\obj\Debug\payuniSDK.cspro
C:\Users\wistronits\Downloads\payuni20240613\payuniSDK\obj\Debug\payuniSDK.csproj.CopyComplete
C:\Users\wistronits\Downloads\payuni20240613\payuniSDK\obj\Debug\payuniSDK.dll
C:\Users\wistronits\Downloads\payuni20240613\payuniSDK\obj\Debug\payuniSDK.pdb
D:\payuni20240924\payuniSDK\bin\Debug\payuniSDK.dll
D:\payuni20240924\payuniSDK\bin\Debug\payuniSDK.pdb
D:\payuni20240924\payuniSDK\bin\Debug\BouncyCastle.Crypto.dll
D:\payuni20240924\payuniSDK\bin\Debug\Newtonsoft.Json.dll
D:\payuni20240924\payuniSDK\bin\Debug\BouncyCastle.Crypto.xml
D:\payuni20240924\payuniSDK\bin\Debug\Newtonsoft.Json.xml
D:\payuni20240924\payuniSDK\obj\Debug\payuniSDK.csproj.AssemblyReference.cache
D:\payuni20240924\payuniSDK\obj\Debug\payuniSDK.csproj.CoreCompileInputs.cache
D:\payuni20240924\payuniSDK\obj\Debug\payuniSDK.csproj.CopyComplete
D:\payuni20240924\payuniSDK\obj\Debug\payuniSDK.dll
D:\payuni20240924\payuniSDK\obj\Debug\payuniSDK.pdb
Binary file modified PayuniSDK/obj/Debug/payuniSDK.dll
Binary file not shown.
Binary file modified PayuniSDK/obj/Debug/payuniSDK.pdb
Binary file not shown.
62 changes: 41 additions & 21 deletions PayuniSDK/payuniAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,81 +90,95 @@ public string UniversalTrade(EncryptInfoModel EnInfo, string tradeType,string ve
case "upp":// 交易建立 整合式支付頁
case "atm":// 交易建立 虛擬帳號幕後
case "cvs":// 交易建立 超商代碼幕後
case "linepay":// 交易建立 Line Pay 幕後
case "aftee_direct"://交易建立 AFTEE 幕後
if (tradeType == "linepay")
{
Parameter.Version = "1.1";
}
if (string.IsNullOrEmpty(EncryptInfo.MerTradeNo))
{
Result.Message = "MerTradeNo is not setting";
Result.Message = "商店訂單編號為必填(MerTradeNo is not setting)";
}
if (string.IsNullOrEmpty(EncryptInfo.TradeAmt))
{
Result.Message = "TradeAmt is not setting";
Result.Message = "訂單金額為必填(TradeAmt is not setting)";
}
break;
case "credit":// 交易建立 信用卡幕後
if (string.IsNullOrEmpty(EncryptInfo.MerTradeNo))
{
Result.Message = "MerTradeNo is not setting";
Result.Message = "商店訂單編號為必填(MerTradeNo is not setting)";
}
if (string.IsNullOrEmpty(EncryptInfo.TradeAmt))
{
Result.Message = "TradeAmt is not setting";
Result.Message = "訂單金額為必填(TradeAmt is not setting)";
}
if (EncryptInfo.CreditHash == null) {
if (string.IsNullOrEmpty(EncryptInfo.CardNo))
{
Result.Message = "CardNo is not setting";
Result.Message = "信用卡卡號為必填(CardNo is not setting)";
}
if (string.IsNullOrEmpty(EncryptInfo.CardExpired))
{
Result.Message = "CardExpired is not setting";
Result.Message = "信用卡到期年月為必填(CardExpired is not setting)";
}
if (string.IsNullOrEmpty(EncryptInfo.CardCVC))
{
Result.Message = "CardCVC is not setting";
Result.Message = "信用卡安全碼為必填(CardCVC is not setting)";
}
}
break;
case "trade_close":// 交易請退款
if (string.IsNullOrEmpty(EncryptInfo.TradeNo))
{
Result.Message = "TradeNo is not setting";
Result.Message = "uni序號為必填(TradeNo is not setting)";
}
if (string.IsNullOrEmpty(EncryptInfo.CloseType))
{
Result.Message = "CloseType is not setting";
Result.Message = "關帳類型為必填(CloseType is not setting)";
}
break;
case "trade_cancel":// 交易取消授權
case "trade_confirm_aftee":// 後支付確認(AFTEE)
if (string.IsNullOrEmpty(EncryptInfo.TradeNo))
{
Result.Message = "TradeNo is not setting";
Result.Message = "uni序號為必填(TradeNo is not setting)";
}
break;
case "cancel_cvs": // 交易取消超商代碼(CVS)
if (string.IsNullOrEmpty(EncryptInfo.PayNo))
{
Result.Message = "超商代碼為必填(PayNo is not setting)";
}
break;
case "credit_bind_cancel":// 信用卡token取消(約定/記憶卡號)
if (string.IsNullOrEmpty(EncryptInfo.UseTokenType))
{
Result.Message = "UseTokenType is not setting";
Result.Message = "信用卡Token類型為必填(UseTokenType is not setting)";
}
if (string.IsNullOrEmpty(EncryptInfo.BindVal))
{
Result.Message = "BindVal is not setting";
Result.Message = "綁定回傳值 /信用卡Token(BindVal is not setting)";
}
break;
case "trade_refund_icash":// 愛金卡退款(ICASH)
case "trade_refund_aftee":// 後支付退款(AFTEE)
case "trade_refund_linepay":// LINE Pay退款(LINE)
if (string.IsNullOrEmpty(EncryptInfo.TradeNo))
{
Result.Message = "TradeNo is not setting";
Result.Message = "uni序號為必填(TradeNo is not setting)";
}
if (string.IsNullOrEmpty(EncryptInfo.TradeAmt))
{
Result.Message = "TradeAmt is not setting";
Result.Message = "訂單金額為必填(TradeAmt is not setting)";
}
break;
case "trade_query":// 交易查詢
case "credit_bind_query":// 信用卡token查詢(約定)
break;
default:
Result.Message = "Unknown params";
Result.Message = "未提供該參數類型(Unknown params)";
break;
}

Expand Down Expand Up @@ -221,20 +235,20 @@ public ResultModel ResultProcess(string CurlResult)
string chkHash = Hash(resultParam.EncryptInfo);
if (chkHash != resultParam.HashInfo)
{
resultArr.Message = "Hash mismatch";
resultArr.Message = "Hash值比對失敗(Hash mismatch)";
return resultArr;
}
resultArr.Message = Decrypt(resultParam.EncryptInfo);
resultArr.Success = true;
}
else
{
resultArr.Message = "missing HashInfo";
resultArr.Message = "缺少Hash資訊(missing HashInfo)";
}
}
else
{
resultArr.Message = "missing EncryptInfo";
resultArr.Message = "缺少加密字串(missing EncryptInfo)";
switch (resultParam.Status) {
case "API00003":
resultArr.Message = "無API版本號";
Expand All @@ -245,7 +259,7 @@ public ResultModel ResultProcess(string CurlResult)
}
catch
{
resultArr.Message = "Result must be an array";
resultArr.Message = "傳入參數需為陣列(Result must be an array)";
return resultArr;
}
}
Expand Down Expand Up @@ -329,6 +343,12 @@ private string contrast(string tradeType)
case "trade_refund_aftee":
tradeType = "trade/common/refund/aftee";
break;
case "trade_confirm_aftee":
tradeType = "trade/common/confirm/aftee";
break;
case "trade_refund_linepay":
tradeType = "trade/common/refund/linepay";
break;
}
return tradeType;
}
Expand Down Expand Up @@ -374,12 +394,12 @@ private ResultModel CheckParams()
{
if (string.IsNullOrEmpty(EncryptInfo.MerID))
{
Result.Message = "MerID is not setting";
Result.Message = "商店代號為必填(MerID is not setting)";
return Result;
}
if (string.IsNullOrEmpty(EncryptInfo.Timestamp.ToString()))
{
Result.Message = "Timestamp is not setting";
Result.Message = "時間戳記為必填(Timestamp is not setting)";
return Result;
}
Result.Success = true;
Expand Down
Binary file modified example/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown.
Binary file modified example/obj/Debug/example.csproj.AssemblyReference.cache
Binary file not shown.
Binary file modified payuniSDK/obj/Debug/payuniSDK.csproj.AssemblyReference.cache
Binary file not shown.
Binary file modified testuni/bin/Debug/netcoreapp3.1/payuniSDK.dll
Binary file not shown.
Binary file modified testuni/bin/Debug/netcoreapp3.1/payuniSDK.pdb
Binary file not shown.
Binary file modified testuni/bin/Debug/netcoreapp3.1/testuni.dll
Binary file not shown.
Binary file modified testuni/bin/Debug/netcoreapp3.1/testuni.pdb
Binary file not shown.
6 changes: 4 additions & 2 deletions testuni/examples/cardit_bind/testuni.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ static void Main(string[] args)
string key = "RgVEIpc55RolRo3ji91UsDiNb3OcYVG8";
string iv = "z6dHDPE0PbQ1C4JN";
string type = "t";
string tradeType = "trade_refund_icash";
string tradeType = "trade_refund_linepay";
EncryptInfoModel info = new EncryptInfoModel();

info.MerID = "S07753315";
info.TradeNo = "Yz20230503103428";
info.MerTradeNo = "Yz20230503103428";
info.TradeAmt = "100";
info.BankType = "822";
info.Timestamp = "1664418868";
info.Timestamp = DateTimeOffset.Now.ToUnixTimeSeconds().ToString();
info.PayNo = "12345";
//info.IsPlatForm = "";//代理商模式 若要啟用 參數給1
//info.MerTradeNo = "Yz20230503103428";
//info.CardNo = "4147631000000001";//payuni 文件提供的測試卡號
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
is_global = true
build_property.RootNamespace = testuni
build_property.ProjectDir = C:\Users\wistronits\Desktop\payuni20240924\testuni\
build_property.ProjectDir = D:\payuni20240924\testuni\
Binary file modified testuni/obj/Debug/netcoreapp3.1/testuni.assets.cache
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c12d565a4b8fdd01e8c071442fc5af44ac531678
2ae9deeb7bf3335c9847cffc2a38d31cc73d95da
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,23 @@ C:\Users\wistronits\Downloads\payuni20240613\testuni\obj\Debug\netcoreapp3.1\tes
C:\Users\wistronits\Downloads\payuni20240613\testuni\obj\Debug\netcoreapp3.1\testuni.dll
C:\Users\wistronits\Downloads\payuni20240613\testuni\obj\Debug\netcoreapp3.1\testuni.pdb
C:\Users\wistronits\Downloads\payuni20240613\testuni\obj\Debug\netcoreapp3.1\testuni.genruntimeconfig.cache
D:\payuni20240924\testuni\bin\Debug\netcoreapp3.1\testuni.exe
D:\payuni20240924\testuni\bin\Debug\netcoreapp3.1\testuni.deps.json
D:\payuni20240924\testuni\bin\Debug\netcoreapp3.1\testuni.runtimeconfig.json
D:\payuni20240924\testuni\bin\Debug\netcoreapp3.1\testuni.runtimeconfig.dev.json
D:\payuni20240924\testuni\bin\Debug\netcoreapp3.1\testuni.dll
D:\payuni20240924\testuni\bin\Debug\netcoreapp3.1\testuni.pdb
D:\payuni20240924\testuni\bin\Debug\netcoreapp3.1\Newtonsoft.Json.dll
D:\payuni20240924\testuni\bin\Debug\netcoreapp3.1\payuniSDK.dll
D:\payuni20240924\testuni\bin\Debug\netcoreapp3.1\BouncyCastle.Crypto.dll
D:\payuni20240924\testuni\bin\Debug\netcoreapp3.1\payuniSDK.pdb
D:\payuni20240924\testuni\bin\Debug\netcoreapp3.1\BouncyCastle.Crypto.xml
D:\payuni20240924\testuni\obj\Debug\netcoreapp3.1\testuni.csproj.AssemblyReference.cache
D:\payuni20240924\testuni\obj\Debug\netcoreapp3.1\testuni.GeneratedMSBuildEditorConfig.editorconfig
D:\payuni20240924\testuni\obj\Debug\netcoreapp3.1\testuni.AssemblyInfoInputs.cache
D:\payuni20240924\testuni\obj\Debug\netcoreapp3.1\testuni.AssemblyInfo.cs
D:\payuni20240924\testuni\obj\Debug\netcoreapp3.1\testuni.csproj.CoreCompileInputs.cache
D:\payuni20240924\testuni\obj\Debug\netcoreapp3.1\testuni.csproj.CopyComplete
D:\payuni20240924\testuni\obj\Debug\netcoreapp3.1\testuni.dll
D:\payuni20240924\testuni\obj\Debug\netcoreapp3.1\testuni.pdb
D:\payuni20240924\testuni\obj\Debug\netcoreapp3.1\testuni.genruntimeconfig.cache
Binary file modified testuni/obj/Debug/netcoreapp3.1/testuni.dll
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9aa3017f4c0fd6e01d276f43107d51447d5e223b
054d646b7b54a6ece0f9a137fee2c71409cdabe4
Binary file modified testuni/obj/Debug/netcoreapp3.1/testuni.pdb
Binary file not shown.
10 changes: 5 additions & 5 deletions testuni/obj/project.assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\wistronits\\Desktop\\payuni20240924\\testuni\\testuni.csproj",
"projectUniqueName": "D:\\payuni20240924\\testuni\\testuni.csproj",
"projectName": "testuni",
"projectPath": "C:\\Users\\wistronits\\Desktop\\payuni20240924\\testuni\\testuni.csproj",
"projectPath": "D:\\payuni20240924\\testuni\\testuni.csproj",
"packagesPath": "C:\\Users\\wistronits\\.nuget\\packages\\",
"outputPath": "C:\\Users\\wistronits\\Desktop\\payuni20240924\\testuni\\obj\\",
"outputPath": "D:\\payuni20240924\\testuni\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\wistronits\\AppData\\Roaming\\NuGet\\NuGet.Config",
Expand All @@ -89,8 +89,8 @@
"netcoreapp3.1": {
"targetAlias": "netcoreapp3.1",
"projectReferences": {
"C:\\Users\\wistronits\\Desktop\\payuni20240924\\payuniSDK\\payuniSDK.csproj": {
"projectPath": "C:\\Users\\wistronits\\Desktop\\payuni20240924\\payuniSDK\\payuniSDK.csproj"
"D:\\payuni20240924\\payuniSDK\\payuniSDK.csproj": {
"projectPath": "D:\\payuni20240924\\payuniSDK\\payuniSDK.csproj"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions testuni/obj/project.nuget.cache
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"version": 2,
"dgSpecHash": "hod868bO/G+jBoO1yj6Aoqzj2Zlu1MhS8yPjpl/r31d2dPsmxHwnYg0rQTbO7MkSG8EaVP/zCnsz4jZ6Ao2lcA==",
"dgSpecHash": "2n3OPr1scFwMRRPZ8wI3ysukGF4lXWWuvr9FhJMSrE9FVg434/DYjy2oAn8AEIKk1QNUkOH5x/v4l9OEieJkaQ==",
"success": true,
"projectFilePath": "C:\\Users\\wistronits\\Desktop\\payuni20240924\\testuni\\testuni.csproj",
"projectFilePath": "D:\\payuni20240924\\testuni\\testuni.csproj",
"expectedPackageFiles": [
"C:\\Users\\wistronits\\.nuget\\packages\\newtonsoft.json\\13.0.1\\newtonsoft.json.13.0.1.nupkg.sha512"
],
Expand Down
20 changes: 10 additions & 10 deletions testuni/obj/testuni.csproj.nuget.dgspec.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"format": 1,
"restore": {
"C:\\Users\\wistronits\\Desktop\\payuni20240924\\testuni\\testuni.csproj": {}
"D:\\payuni20240924\\testuni\\testuni.csproj": {}
},
"projects": {
"C:\\Users\\wistronits\\Desktop\\payuni20240924\\payuniSDK\\payuniSDK.csproj": {
"D:\\payuni20240924\\payuniSDK\\payuniSDK.csproj": {
"restore": {
"projectUniqueName": "C:\\Users\\wistronits\\Desktop\\payuni20240924\\payuniSDK\\payuniSDK.csproj",
"projectUniqueName": "D:\\payuni20240924\\payuniSDK\\payuniSDK.csproj",
"projectName": "payuniSDK",
"projectPath": "C:\\Users\\wistronits\\Desktop\\payuni20240924\\payuniSDK\\payuniSDK.csproj",
"projectPath": "D:\\payuni20240924\\payuniSDK\\payuniSDK.csproj",
"frameworks": {
"net472": {
"projectReferences": {}
Expand All @@ -19,14 +19,14 @@
"net472": {}
}
},
"C:\\Users\\wistronits\\Desktop\\payuni20240924\\testuni\\testuni.csproj": {
"D:\\payuni20240924\\testuni\\testuni.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\wistronits\\Desktop\\payuni20240924\\testuni\\testuni.csproj",
"projectUniqueName": "D:\\payuni20240924\\testuni\\testuni.csproj",
"projectName": "testuni",
"projectPath": "C:\\Users\\wistronits\\Desktop\\payuni20240924\\testuni\\testuni.csproj",
"projectPath": "D:\\payuni20240924\\testuni\\testuni.csproj",
"packagesPath": "C:\\Users\\wistronits\\.nuget\\packages\\",
"outputPath": "C:\\Users\\wistronits\\Desktop\\payuni20240924\\testuni\\obj\\",
"outputPath": "D:\\payuni20240924\\testuni\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\wistronits\\AppData\\Roaming\\NuGet\\NuGet.Config",
Expand All @@ -43,8 +43,8 @@
"netcoreapp3.1": {
"targetAlias": "netcoreapp3.1",
"projectReferences": {
"C:\\Users\\wistronits\\Desktop\\payuni20240924\\payuniSDK\\payuniSDK.csproj": {
"projectPath": "C:\\Users\\wistronits\\Desktop\\payuni20240924\\payuniSDK\\payuniSDK.csproj"
"D:\\payuni20240924\\payuniSDK\\payuniSDK.csproj": {
"projectPath": "D:\\payuni20240924\\payuniSDK\\payuniSDK.csproj"
}
}
}
Expand Down

0 comments on commit be29751

Please sign in to comment.