SDKTest.cs 5.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.IO;
  3. using Nbcb.Cobp.SDK;
  4. namespace CSharpSDKDemo
  5. {
  6. class SDKTest
  7. {
  8. public static void Main(string[] args)
  9. {
  10. //Console.WriteLine("测试!!!");
  11. string path = Path.GetFullPath("../..");//获取项目根目录
  12. string configName = "/config.ini";
  13. //上传文件私钥测试
  14. //string privateKey = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCjbLssgRiBGy2c873MDmEeM0WCfWFIwZl/dtko+6MMAcW6rah6s5mm3TNgjAMR/hmfRfzVjvhQ6mKFVWVvtS3KUVx6NMtVxGfmuaccnqQSAM1drruI9nJzTCwbWiL0JFx4jyNCZKasNdZ1TuKRS4vtRomhQtzAb8bdRD99MA5NTz0cE5nqCjfH0usC0vMdFSGmbznKvjuvTEeYCatWd7HKNazlFerDpW4ZcTp6+AL6G3eQ1vXHSVKJ7MTk9QZLc8I/4BrF0vYcYdxVefyvzNVudhygBj3vn56dLMsQFFtybISsa9PeeSYrtlV1TdimJkfJ2byeeqrvz/wYbD87HpR1AgMBAAECggEAYKcl7CRNwc25JGJjlhPLDHl2Wr6cktMtXV2FAeARhkBmGQor4qXl8fJROICWMEYAEVrrNcLgybpVmlXvMCoPcuC7uOsQdyE58hNK6npIvv0KeKWm9FINTnN2gpbEpW/74LGHQPUWPjN5KtgE17m+gA5/x4gr1wREsQh0JC4Px1hr8HzjgwLY670lIVqd/5tpHWD/I4StYDtAFye14Li/n7xt2RFYB/mHd3R0BglgVG2sKRXbcrZuhlKMa9WhObhdnPH7ADOrWo0uLsuQFHcI8tLURvA1iZfegOxRVNHj0LdhuC4pT7Wd3hohTlEwkKAs53isb4xyZgNWaRqLtGgjAQKBgQDOPVV0Qu+fIv7A9Xb5PMAoRDNkB+fY3PboWRl2GpOvMfTcEItuBlU6znFIHpI3HrpEIbchSqOUfzxtik+vSHbZ40HhLK91MTeZNrxrNr4i5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/ThfSEBdaApaMFAUqk1G8upcG7szqNDHJyzzRAHPdEN3tMdVPwJRHOIKXM5YuYcCgYEArJzg3SWoalQ12ijCmAr8YZVuJkZWNwAz7SmN7GsBLGHuId7ntZ7yuVfOoXJRy61HNUJ6qsmy/fNSWTCOslesgRjx+/Y0z+q+YUCRV/l97cXaqi8d8b2mYcAR/eh92WZrmSQ58/emkwsnrS56+QT5yEGhBpY+6Z/7S4Hn3ZS1BzE=";
  16. var test =NbcbSDK.init(path, configName, privateKey);
  17. //String dataJson1 = "{\"Data\":{\"custId\":\"0000112058\",\"cdSign\": \"0\",\"bankAccList\":[\"40010122000156763\"],\"beginDate\": \"2023-01-01\",\"endDate\": \"2023-01-30\",\"queryType\": \"0\",\"pageSize\":\"10\",\"currentPage\":\"1\"}}";
  18. // String dataJson1 = "{\"Data\":{\"custId\":\"0000289668\",\"bankAccList\":[\"75012025000040912\"],\"beginDate\": \"2024-01-01\",\"endDate\": \"2024-01-30\",\"queryType\": \"0\",\"pageSize\":\"200\",\"currentPage\":\"1\"}}";
  19. //string res1 = NbcbSDK.send("", "tmsReport", "queryAccDetail", dataJson1);
  20. //String dataJson2 = "{\"Data\":{\"custId\":\"0000289668\", \"corpCode\":\"1000\",\"rcvAcc\":\"75010122000831345\",\"queryType\":\"1\",\"pageSize\":\"200\", \"currentPage\":\"1\", \"beginDate\":\"20240101\",\"endDate\":\"20240131\"}}";
  21. var dataJson2 = "{\"Data\":{\"custId\":\"0000289668\",\"corpCode\":\"1000\",\"rcvAcc\":\"75012025000040912\",\"payName\":null,\"remitCurCode\":null,\"queryType\":null,\"refNo\":null,\"beginAmt\":null,\"endAmt\":null,\"beginDate\":null,\"endDate\":null,\"pageSize\":\"200\",\"currentPage\":\"1\"}}";
  22. string res2 = NbcbSDK.send("", "tmsForex", "inwardRemittanceQuery", dataJson2);
  23. //上传文件
  24. //String res = NbcbSDK.sendFile("", "productId", "open-filegateway", @"D:\\test\\abc.txt");
  25. //下载文件
  26. // FileDownloadResponse res = NbcbSDK.sendFileDownload("", "productId", "111", "8efd26d0-06ed-4577-b290-dcf5144b977d", @"D:\\ab\\test\\11\\csharp");
  27. Console.WriteLine("响应内容:" + res2);
  28. Console.WriteLine("结束");
  29. Console.ReadLine();
  30. }
  31. }
  32. }