我正试图通过MoneySend API在万事达卡的沙箱上提出付款请求。下面是C#的示例代码,也可以在这里找到
问题陈述:
完全异常:
mastercard.core.exceptions.apiExceptions:无法解析远程名称:“sandbox.api.mastercard.com”-->system.net.webException:无法解析远程名称:“sandbox.api.mastercard.com”在system.net.HttpWebRequest.getRequestStream(TransportContext&context)在system.net.HttpWebRequest.getRequestStream(TransportContext&context)在system.net.HttpWebRequest.getRequestStream(TransportContext config,OperationMetadata metadata,BaseObject requestMap)在mastercard.core.model.BaseObject.execute[T](String operationUUID,T inputObject)在mastercardwebservice.moneysend.payment.create(requestMap map)在mastercardwebservice.moneysend.testservice()在c:\users\name\documents\my ReceivedSVC.cs:第128行
public class PaymentTest
{
public static void Main()
{
string consumerKey = "your consumer key"; // You should copy this from "My Keys" on your project page e.g. UTfbhDCSeNYvJpLL5l028sWL9it739PYh6LU5lZja15xcRpY!fd209e6c579dc9d7be52da93d35ae6b6c167c174690b72fa
string keyAlias = "keyalias"; // For production: change this to the key alias you chose when you created your production key
string keyPassword = "keystorepassword"; // For production: change this to the key alias you chose when you created your production key
var path = MasterCard.Core.Util.GetCurrenyAssemblyPath(); // This returns the path to your assembly so it be used to locate your cert
string certPath = "mypath"; // e.g. /Users/yourname/project/sandbox.p12 | C:\Users\yourname\project\sandbox.p12
ApiConfig.SetAuthentication(new OAuthAuthentication(consumerKey, certPath, keyAlias, keyPassword)); // You only need to set this once
ApiConfig.SetDebug(true); // Enable http wire logging
ApiConfig.SetSandbox(true);
try {
RequestMap map = new RequestMap();
map.Set ("PaymentRequestV3.LocalDate", "0817");
map.Set ("PaymentRequestV3.LocalTime", "150149");
map.Set ("PaymentRequestV3.TransactionReference", "1091774875227082093");
map.Set ("PaymentRequestV3.SenderName.First", "Test");
map.Set ("PaymentRequestV3.SenderName.Middle", "T");
map.Set ("PaymentRequestV3.SenderName.Last", "Test");
map.Set ("PaymentRequestV3.SenderPhone", "7031234567");
map.Set ("PaymentRequestV3.SenderDateOfBirth", "08061977");
map.Set ("PaymentRequestV3.SenderAddress.Line1", "123 Main Street");
map.Set ("PaymentRequestV3.SenderAddress.Line2", "5A");
map.Set ("PaymentRequestV3.SenderAddress.City", "Arlington");
map.Set ("PaymentRequestV3.SenderAddress.CountrySubdivision", "VA");
map.Set ("PaymentRequestV3.SenderAddress.PostalCode", "22207");
map.Set ("PaymentRequestV3.SenderAddress.Country", "USA");
map.Set ("PaymentRequestV3.FundingCard.AccountNumber", "5184680470000023");
map.Set ("PaymentRequestV3.FundingSource", "03");
map.Set ("PaymentRequestV3.AdditionalMessage", "Test");
map.Set ("PaymentRequestV3.ParticipationID", "Test");
map.Set ("PaymentRequestV3.LanguageIdentification", "Tes");
map.Set ("PaymentRequestV3.LanguageData", "Test");
map.Set ("PaymentRequestV3.ReceivingCard.AccountNumber", "5184680430000006");
map.Set ("PaymentRequestV3.ReceiverName.Middle", "B");
map.Set ("PaymentRequestV3.ReceiverName.Last", "Lopez");
map.Set ("PaymentRequestV3.ReceiverAddress.Line1", "Pueblo Street");
map.Set ("PaymentRequestV3.ReceiverAddress.Line2", "PO BOX 12");
map.Set ("PaymentRequestV3.ReceiverAddress.City", "El PASO");
map.Set ("PaymentRequestV3.ReceiverAddress.CountrySubdivision", "TX");
map.Set ("PaymentRequestV3.ReceiverAddress.PostalCode", "79906");
map.Set ("PaymentRequestV3.ReceiverAddress.Country", "USA");
map.Set ("PaymentRequestV3.ReceiverPhone", "1800639426");
map.Set ("PaymentRequestV3.ReceiverDateOfBirth", "06211977");
map.Set ("PaymentRequestV3.ReceivingAmount.Value", "842");
map.Set ("PaymentRequestV3.ReceivingAmount.Currency", "840");
map.Set ("PaymentRequestV3.ICA", "009674");
map.Set ("PaymentRequestV3.ProcessorId", "9000000442");
map.Set ("PaymentRequestV3.RoutingAndTransitNumber", "990442082");
map.Set ("PaymentRequestV3.CardAcceptor.Name", "THE BEST BANK");
map.Set ("PaymentRequestV3.CardAcceptor.City", "ANYTOWN");
map.Set ("PaymentRequestV3.CardAcceptor.State", "MO");
map.Set ("PaymentRequestV3.CardAcceptor.PostalCode", "99999-1234");
map.Set ("PaymentRequestV3.CardAcceptor.Country", "USA");
map.Set ("PaymentRequestV3.TransactionDesc", "P2P");
map.Set ("PaymentRequestV3.MerchantId", "123456");
map.Set ("PaymentRequestV3.ReceiverIdentification.Type", "01");
map.Set ("PaymentRequestV3.ReceiverIdentification.Number", "2147483647");
map.Set ("PaymentRequestV3.ReceiverIdentification.CountryCode", "USA");
map.Set ("PaymentRequestV3.ReceiverIdentification.ExpirationDate", "10102017");
map.Set ("PaymentRequestV3.ReceiverNationality", "USA");
map.Set ("PaymentRequestV3.ReceiverCountryOfBirth", "USA");
map.Set ("PaymentRequestV3.SenderIdentification.Type", "01");
map.Set ("PaymentRequestV3.SenderIdentification.Number", "2147483647");
map.Set ("PaymentRequestV3.SenderIdentification.CountryCode", "USA");
map.Set ("PaymentRequestV3.SenderIdentification.ExpirationDate", "10102017");
map.Set ("PaymentRequestV3.SenderNationality", "USA");
map.Set ("PaymentRequestV3.SenderCountryOfBirth", "USA");
map.Set ("PaymentRequestV3.TransactionPurpose", "01");
Payment response = Payment.Create(map);
Console.WriteLine("Transfer.RequestId--> {0}", response["Transfer.RequestId"]); //Transfer.RequestId-->1413236
Console.WriteLine("Transfer.TransactionReference--> {0}", response["Transfer.TransactionReference"]); //Transfer.TransactionReference-->1091774875227082093
Console.WriteLine("Transfer.TransactionHistory.Transaction[0].Type--> {0}", response["Transfer.TransactionHistory.Transaction[0].Type"]); //Transfer.TransactionHistory.Transaction[0].Type-->PAYMENT
Console.WriteLine("Transfer.TransactionHistory.Transaction[0].SystemTraceAuditNumber--> {0}", response["Transfer.TransactionHistory.Transaction[0].SystemTraceAuditNumber"]); //Transfer.TransactionHistory.Transaction[0].SystemTraceAuditNumber-->212849
Console.WriteLine("Transfer.TransactionHistory.Transaction[0].NetworkReferenceNumber--> {0}", response["Transfer.TransactionHistory.Transaction[0].NetworkReferenceNumber"]); //Transfer.TransactionHistory.Transaction[0].NetworkReferenceNumber-->313371112
Console.WriteLine("Transfer.TransactionHistory.Transaction[0].SettlementDate--> {0}", response["Transfer.TransactionHistory.Transaction[0].SettlementDate"]); //Transfer.TransactionHistory.Transaction[0].SettlementDate-->0818
Console.WriteLine("Transfer.TransactionHistory.Transaction[0].Response.Code--> {0}", response["Transfer.TransactionHistory.Transaction[0].Response.Code"]); //Transfer.TransactionHistory.Transaction[0].Response.Code-->00
Console.WriteLine("Transfer.TransactionHistory.Transaction[0].Response.Description--> {0}", response["Transfer.TransactionHistory.Transaction[0].Response.Description"]); //Transfer.TransactionHistory.Transaction[0].Response.Description-->Approved or completed successfully
Console.WriteLine("Transfer.TransactionHistory.Transaction[0].SubmitDateTime--> {0}", response["Transfer.TransactionHistory.Transaction[0].SubmitDateTime"]); //Transfer.TransactionHistory.Transaction[0].SubmitDateTime-->2016-08-17T09:31:54Z
} catch (ApiException e) {
Console.Error.WriteLine("HttpStatus: {0}", e.HttpStatus);
Console.Error.WriteLine("Message: {0}", e.Message);
Console.Error.WriteLine("ReasonCode: {0}", e.ReasonCode);
Console.Error.WriteLine("Source: {0}", e.Source);
}
}
}
通过向服务项目的Web.config添加代理解决
<system.net>
<defaultProxy useDefaultCredentials="false">
<proxy
proxyaddress="http://myurladdress:myport"
bypassonlocal="True"
usesystemdefault="False"
/>
</defaultProxy>
</system.net>
这样的问题已经问过好几次了,我明白为什么会发生,大概除了重试,我们对此无能为力。 我有一个关于名称解析的问题。 我使用的是3.5.NET的AWS.NET SDK。我正在上传一个大文件(>500MB到1.5GB,医学图像)。我调用方法。 错误发生在大约250MB上载完成后。 这是实际的例外
我创建了一个基本的.NET framework MVC web应用程序,并添加了使用Cloud Watch logs SDK向AWS Cloud Watch logs发送日志的逻辑,它在LocalSystem/LocalHost中运行良好,但当我对映像进行对接时,就开始出现异常。请指导我解决这个问题。 Amazon.Runtime.AmazonServiceException:“引发了状态为Nam
问题内容: 我一直在尝试导入以下Web服务:http : //soap.genome.jp/KEGG.wsdl和$ {JAVA_HOME} / bin / wsimport: 但出现以下错误: 问题是来自WSDL还是来自wsimport的实现?我应该使用其他工具吗? 谢谢 皮埃尔 问题答案: 我从此错误报告中发现了(显然是)解决方法:https : //netbeans.org/bugzilla/
我正在使用Client编写一个Eureka客户端应用程序。这是我的POM 如您所见,我使用的是spring boot版本
我有一个EJB服务器在一台Liberty服务器上运行,而客户端在另一台服务器上运行。 如果我使用下面的代码手动查找远程EJB,我可以访问EJB。 上述工作按预期方式工作,它能够调用在另一个服务器实例上运行的远程 EJB 并按预期工作。 我尝试在我的< code>@Controller类中使用Spring,并通过注释< code>@EJB或< code > @自动连线引用EJB mvc-dispat