The remote name could not be resolved: 'sandbox.api.mastercard.com'
I am trying to Make a request on MasterCard's sandbox for payment through MoneySend api. here is the sample code which can also be found here for c#
Problem Statement:
When I am trying to make request through directly visual studio it works perfectly, but when I deployed this service at IIS this show an error
The remote name could not be resolved: 'sandbox.api.mastercard.com'
Further Explanation:
Created Solution in VS 2017, Created 2 projects in it, One of services and other for testing same services in console. By pointing service reference of services in console, it worked fine. When I deployed services on IIS and replaced endpoint of services from local VS link to deployed IIS link in console app, I got above error.
Update:
I am working in a corporation where internet service has its own dns and proxy settings.
Full Exception:
MasterCard.Core.Exceptions.ApiException: The remote name could not be resolved: 'sandbox.api.mastercard.com' --->
System.Net.WebException: The remote name could not be resolved:
'sandbox.api.mastercard.com'
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at RestSharp.Http.WriteRequestBody(HttpWebRequest webRequest)
at RestSharp.Http.PostPutInternal(String method)
at RestSharp.RestClient.Execute(IRestRequest request, String httpMethod, Func`3 getResponse)
--- End of inner exception stack trace ---
at MasterCard.Core.ApiController.Execute(OperationConfig config, OperationMetadata metadata, BaseObject requestMap)
at MasterCard.Core.Model.BaseObject.Execute[T](String operationUUID, T inputObject)
at MasterCard.Api.Moneysend.Payment.Create(RequestMap map)
at MasterCardWebService.MoneySend.testService() in C:UsersnameDocumentsMy Received
FilesMasterCardWebServiceMasterCardWebServiceMasterCardWebServiceMoneySend.svc.cs:line
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:Usersyournameprojectsandbox.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);
}
}
}
c# mastercard
|
show 21 more comments
I am trying to Make a request on MasterCard's sandbox for payment through MoneySend api. here is the sample code which can also be found here for c#
Problem Statement:
When I am trying to make request through directly visual studio it works perfectly, but when I deployed this service at IIS this show an error
The remote name could not be resolved: 'sandbox.api.mastercard.com'
Further Explanation:
Created Solution in VS 2017, Created 2 projects in it, One of services and other for testing same services in console. By pointing service reference of services in console, it worked fine. When I deployed services on IIS and replaced endpoint of services from local VS link to deployed IIS link in console app, I got above error.
Update:
I am working in a corporation where internet service has its own dns and proxy settings.
Full Exception:
MasterCard.Core.Exceptions.ApiException: The remote name could not be resolved: 'sandbox.api.mastercard.com' --->
System.Net.WebException: The remote name could not be resolved:
'sandbox.api.mastercard.com'
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at RestSharp.Http.WriteRequestBody(HttpWebRequest webRequest)
at RestSharp.Http.PostPutInternal(String method)
at RestSharp.RestClient.Execute(IRestRequest request, String httpMethod, Func`3 getResponse)
--- End of inner exception stack trace ---
at MasterCard.Core.ApiController.Execute(OperationConfig config, OperationMetadata metadata, BaseObject requestMap)
at MasterCard.Core.Model.BaseObject.Execute[T](String operationUUID, T inputObject)
at MasterCard.Api.Moneysend.Payment.Create(RequestMap map)
at MasterCardWebService.MoneySend.testService() in C:UsersnameDocumentsMy Received
FilesMasterCardWebServiceMasterCardWebServiceMasterCardWebServiceMoneySend.svc.cs:line
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:Usersyournameprojectsandbox.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);
}
}
}
c# mastercard
1
That’s a dreadful looking “API” by the way.
– MickyD
Nov 8 '18 at 6:41
1
Hmm well I'm guessing that MasterCard doesn't allow you to make a copy of their service on your local machine. Kinda makes sense
– MickyD
Nov 8 '18 at 6:51
1
@MickyD You completely misunderstand the issue I think. According to OP, above code works when running the application using the VS debugger (so using IIS Express), but it fails when running the application in IIS.
– Stijn
Nov 14 '18 at 10:49
2
@Stijn the error message has nothing to do with the code posted here or IIS. That's a plain old DNS error message. It says thatsandbox.api.mastercard.com
can't be found.
– Panagiotis Kanavos
Nov 14 '18 at 10:52
3
From the duplicate's answerYour machine is using a DNS server that filters queries. This is common in corporate environments; filtering is done to try to stop malware from working.
. The real solution is to communicate with the administrator to find out how DNS is configured and what gets filtered. You'll have to do that before production deployment anyway. The app pool may have to run under a specific account. In the meantime, a hack would be to configure the IIS App pool to run with your account. Another hack could be to edit thehosts
file and enter the target's IP
– Panagiotis Kanavos
Nov 14 '18 at 11:18
|
show 21 more comments
I am trying to Make a request on MasterCard's sandbox for payment through MoneySend api. here is the sample code which can also be found here for c#
Problem Statement:
When I am trying to make request through directly visual studio it works perfectly, but when I deployed this service at IIS this show an error
The remote name could not be resolved: 'sandbox.api.mastercard.com'
Further Explanation:
Created Solution in VS 2017, Created 2 projects in it, One of services and other for testing same services in console. By pointing service reference of services in console, it worked fine. When I deployed services on IIS and replaced endpoint of services from local VS link to deployed IIS link in console app, I got above error.
Update:
I am working in a corporation where internet service has its own dns and proxy settings.
Full Exception:
MasterCard.Core.Exceptions.ApiException: The remote name could not be resolved: 'sandbox.api.mastercard.com' --->
System.Net.WebException: The remote name could not be resolved:
'sandbox.api.mastercard.com'
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at RestSharp.Http.WriteRequestBody(HttpWebRequest webRequest)
at RestSharp.Http.PostPutInternal(String method)
at RestSharp.RestClient.Execute(IRestRequest request, String httpMethod, Func`3 getResponse)
--- End of inner exception stack trace ---
at MasterCard.Core.ApiController.Execute(OperationConfig config, OperationMetadata metadata, BaseObject requestMap)
at MasterCard.Core.Model.BaseObject.Execute[T](String operationUUID, T inputObject)
at MasterCard.Api.Moneysend.Payment.Create(RequestMap map)
at MasterCardWebService.MoneySend.testService() in C:UsersnameDocumentsMy Received
FilesMasterCardWebServiceMasterCardWebServiceMasterCardWebServiceMoneySend.svc.cs:line
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:Usersyournameprojectsandbox.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);
}
}
}
c# mastercard
I am trying to Make a request on MasterCard's sandbox for payment through MoneySend api. here is the sample code which can also be found here for c#
Problem Statement:
When I am trying to make request through directly visual studio it works perfectly, but when I deployed this service at IIS this show an error
The remote name could not be resolved: 'sandbox.api.mastercard.com'
Further Explanation:
Created Solution in VS 2017, Created 2 projects in it, One of services and other for testing same services in console. By pointing service reference of services in console, it worked fine. When I deployed services on IIS and replaced endpoint of services from local VS link to deployed IIS link in console app, I got above error.
Update:
I am working in a corporation where internet service has its own dns and proxy settings.
Full Exception:
MasterCard.Core.Exceptions.ApiException: The remote name could not be resolved: 'sandbox.api.mastercard.com' --->
System.Net.WebException: The remote name could not be resolved:
'sandbox.api.mastercard.com'
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at RestSharp.Http.WriteRequestBody(HttpWebRequest webRequest)
at RestSharp.Http.PostPutInternal(String method)
at RestSharp.RestClient.Execute(IRestRequest request, String httpMethod, Func`3 getResponse)
--- End of inner exception stack trace ---
at MasterCard.Core.ApiController.Execute(OperationConfig config, OperationMetadata metadata, BaseObject requestMap)
at MasterCard.Core.Model.BaseObject.Execute[T](String operationUUID, T inputObject)
at MasterCard.Api.Moneysend.Payment.Create(RequestMap map)
at MasterCardWebService.MoneySend.testService() in C:UsersnameDocumentsMy Received
FilesMasterCardWebServiceMasterCardWebServiceMasterCardWebServiceMoneySend.svc.cs:line
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:Usersyournameprojectsandbox.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);
}
}
}
c# mastercard
c# mastercard
edited Nov 15 '18 at 12:03
OrionMD
109128
109128
asked Nov 8 '18 at 6:36
trighatitrighati
47031230
47031230
1
That’s a dreadful looking “API” by the way.
– MickyD
Nov 8 '18 at 6:41
1
Hmm well I'm guessing that MasterCard doesn't allow you to make a copy of their service on your local machine. Kinda makes sense
– MickyD
Nov 8 '18 at 6:51
1
@MickyD You completely misunderstand the issue I think. According to OP, above code works when running the application using the VS debugger (so using IIS Express), but it fails when running the application in IIS.
– Stijn
Nov 14 '18 at 10:49
2
@Stijn the error message has nothing to do with the code posted here or IIS. That's a plain old DNS error message. It says thatsandbox.api.mastercard.com
can't be found.
– Panagiotis Kanavos
Nov 14 '18 at 10:52
3
From the duplicate's answerYour machine is using a DNS server that filters queries. This is common in corporate environments; filtering is done to try to stop malware from working.
. The real solution is to communicate with the administrator to find out how DNS is configured and what gets filtered. You'll have to do that before production deployment anyway. The app pool may have to run under a specific account. In the meantime, a hack would be to configure the IIS App pool to run with your account. Another hack could be to edit thehosts
file and enter the target's IP
– Panagiotis Kanavos
Nov 14 '18 at 11:18
|
show 21 more comments
1
That’s a dreadful looking “API” by the way.
– MickyD
Nov 8 '18 at 6:41
1
Hmm well I'm guessing that MasterCard doesn't allow you to make a copy of their service on your local machine. Kinda makes sense
– MickyD
Nov 8 '18 at 6:51
1
@MickyD You completely misunderstand the issue I think. According to OP, above code works when running the application using the VS debugger (so using IIS Express), but it fails when running the application in IIS.
– Stijn
Nov 14 '18 at 10:49
2
@Stijn the error message has nothing to do with the code posted here or IIS. That's a plain old DNS error message. It says thatsandbox.api.mastercard.com
can't be found.
– Panagiotis Kanavos
Nov 14 '18 at 10:52
3
From the duplicate's answerYour machine is using a DNS server that filters queries. This is common in corporate environments; filtering is done to try to stop malware from working.
. The real solution is to communicate with the administrator to find out how DNS is configured and what gets filtered. You'll have to do that before production deployment anyway. The app pool may have to run under a specific account. In the meantime, a hack would be to configure the IIS App pool to run with your account. Another hack could be to edit thehosts
file and enter the target's IP
– Panagiotis Kanavos
Nov 14 '18 at 11:18
1
1
That’s a dreadful looking “API” by the way.
– MickyD
Nov 8 '18 at 6:41
That’s a dreadful looking “API” by the way.
– MickyD
Nov 8 '18 at 6:41
1
1
Hmm well I'm guessing that MasterCard doesn't allow you to make a copy of their service on your local machine. Kinda makes sense
– MickyD
Nov 8 '18 at 6:51
Hmm well I'm guessing that MasterCard doesn't allow you to make a copy of their service on your local machine. Kinda makes sense
– MickyD
Nov 8 '18 at 6:51
1
1
@MickyD You completely misunderstand the issue I think. According to OP, above code works when running the application using the VS debugger (so using IIS Express), but it fails when running the application in IIS.
– Stijn
Nov 14 '18 at 10:49
@MickyD You completely misunderstand the issue I think. According to OP, above code works when running the application using the VS debugger (so using IIS Express), but it fails when running the application in IIS.
– Stijn
Nov 14 '18 at 10:49
2
2
@Stijn the error message has nothing to do with the code posted here or IIS. That's a plain old DNS error message. It says that
sandbox.api.mastercard.com
can't be found.– Panagiotis Kanavos
Nov 14 '18 at 10:52
@Stijn the error message has nothing to do with the code posted here or IIS. That's a plain old DNS error message. It says that
sandbox.api.mastercard.com
can't be found.– Panagiotis Kanavos
Nov 14 '18 at 10:52
3
3
From the duplicate's answer
Your machine is using a DNS server that filters queries. This is common in corporate environments; filtering is done to try to stop malware from working.
. The real solution is to communicate with the administrator to find out how DNS is configured and what gets filtered. You'll have to do that before production deployment anyway. The app pool may have to run under a specific account. In the meantime, a hack would be to configure the IIS App pool to run with your account. Another hack could be to edit the hosts
file and enter the target's IP– Panagiotis Kanavos
Nov 14 '18 at 11:18
From the duplicate's answer
Your machine is using a DNS server that filters queries. This is common in corporate environments; filtering is done to try to stop malware from working.
. The real solution is to communicate with the administrator to find out how DNS is configured and what gets filtered. You'll have to do that before production deployment anyway. The app pool may have to run under a specific account. In the meantime, a hack would be to configure the IIS App pool to run with your account. Another hack could be to edit the hosts
file and enter the target's IP– Panagiotis Kanavos
Nov 14 '18 at 11:18
|
show 21 more comments
2 Answers
2
active
oldest
votes
Solved by adding proxy to web.config of service project
<system.net>
<defaultProxy useDefaultCredentials="false">
<proxy
proxyaddress="http://myurladdress:myport"
bypassonlocal="True"
usesystemdefault="False"
/>
</defaultProxy>
</system.net>
add a comment |
Seems like your DNS is not resolving. You can force it like this:
Open Notepad as Administrator on your server.
Browse and open C:WindowsSystem32driversetchosts
At the bottom add: 88.221.244.150 sandbox.api.mastercard.com
Save the file.
The application should now find sandbox.api.mastercard.com.
got an exception:Unable to connect to the remote server
Inner Exception:A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 88.221.244.150:443
– trighati
Nov 15 '18 at 9:10
When i run thissandbox.api.mastercard.com
in browser it says Service Unavailable andThe server is temporarily unable to service your request. Please try again later.
with reference number
– trighati
Nov 15 '18 at 9:13
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53202579%2fthe-remote-name-could-not-be-resolved-sandbox-api-mastercard-com%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Solved by adding proxy to web.config of service project
<system.net>
<defaultProxy useDefaultCredentials="false">
<proxy
proxyaddress="http://myurladdress:myport"
bypassonlocal="True"
usesystemdefault="False"
/>
</defaultProxy>
</system.net>
add a comment |
Solved by adding proxy to web.config of service project
<system.net>
<defaultProxy useDefaultCredentials="false">
<proxy
proxyaddress="http://myurladdress:myport"
bypassonlocal="True"
usesystemdefault="False"
/>
</defaultProxy>
</system.net>
add a comment |
Solved by adding proxy to web.config of service project
<system.net>
<defaultProxy useDefaultCredentials="false">
<proxy
proxyaddress="http://myurladdress:myport"
bypassonlocal="True"
usesystemdefault="False"
/>
</defaultProxy>
</system.net>
Solved by adding proxy to web.config of service project
<system.net>
<defaultProxy useDefaultCredentials="false">
<proxy
proxyaddress="http://myurladdress:myport"
bypassonlocal="True"
usesystemdefault="False"
/>
</defaultProxy>
</system.net>
answered Nov 15 '18 at 10:42
trighatitrighati
47031230
47031230
add a comment |
add a comment |
Seems like your DNS is not resolving. You can force it like this:
Open Notepad as Administrator on your server.
Browse and open C:WindowsSystem32driversetchosts
At the bottom add: 88.221.244.150 sandbox.api.mastercard.com
Save the file.
The application should now find sandbox.api.mastercard.com.
got an exception:Unable to connect to the remote server
Inner Exception:A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 88.221.244.150:443
– trighati
Nov 15 '18 at 9:10
When i run thissandbox.api.mastercard.com
in browser it says Service Unavailable andThe server is temporarily unable to service your request. Please try again later.
with reference number
– trighati
Nov 15 '18 at 9:13
add a comment |
Seems like your DNS is not resolving. You can force it like this:
Open Notepad as Administrator on your server.
Browse and open C:WindowsSystem32driversetchosts
At the bottom add: 88.221.244.150 sandbox.api.mastercard.com
Save the file.
The application should now find sandbox.api.mastercard.com.
got an exception:Unable to connect to the remote server
Inner Exception:A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 88.221.244.150:443
– trighati
Nov 15 '18 at 9:10
When i run thissandbox.api.mastercard.com
in browser it says Service Unavailable andThe server is temporarily unable to service your request. Please try again later.
with reference number
– trighati
Nov 15 '18 at 9:13
add a comment |
Seems like your DNS is not resolving. You can force it like this:
Open Notepad as Administrator on your server.
Browse and open C:WindowsSystem32driversetchosts
At the bottom add: 88.221.244.150 sandbox.api.mastercard.com
Save the file.
The application should now find sandbox.api.mastercard.com.
Seems like your DNS is not resolving. You can force it like this:
Open Notepad as Administrator on your server.
Browse and open C:WindowsSystem32driversetchosts
At the bottom add: 88.221.244.150 sandbox.api.mastercard.com
Save the file.
The application should now find sandbox.api.mastercard.com.
answered Nov 15 '18 at 1:30
Sean ThorburnSean Thorburn
1,135519
1,135519
got an exception:Unable to connect to the remote server
Inner Exception:A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 88.221.244.150:443
– trighati
Nov 15 '18 at 9:10
When i run thissandbox.api.mastercard.com
in browser it says Service Unavailable andThe server is temporarily unable to service your request. Please try again later.
with reference number
– trighati
Nov 15 '18 at 9:13
add a comment |
got an exception:Unable to connect to the remote server
Inner Exception:A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 88.221.244.150:443
– trighati
Nov 15 '18 at 9:10
When i run thissandbox.api.mastercard.com
in browser it says Service Unavailable andThe server is temporarily unable to service your request. Please try again later.
with reference number
– trighati
Nov 15 '18 at 9:13
got an exception:
Unable to connect to the remote server
Inner Exception: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 88.221.244.150:443
– trighati
Nov 15 '18 at 9:10
got an exception:
Unable to connect to the remote server
Inner Exception: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 88.221.244.150:443
– trighati
Nov 15 '18 at 9:10
When i run this
sandbox.api.mastercard.com
in browser it says Service Unavailable and The server is temporarily unable to service your request. Please try again later.
with reference number– trighati
Nov 15 '18 at 9:13
When i run this
sandbox.api.mastercard.com
in browser it says Service Unavailable and The server is temporarily unable to service your request. Please try again later.
with reference number– trighati
Nov 15 '18 at 9:13
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53202579%2fthe-remote-name-could-not-be-resolved-sandbox-api-mastercard-com%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
That’s a dreadful looking “API” by the way.
– MickyD
Nov 8 '18 at 6:41
1
Hmm well I'm guessing that MasterCard doesn't allow you to make a copy of their service on your local machine. Kinda makes sense
– MickyD
Nov 8 '18 at 6:51
1
@MickyD You completely misunderstand the issue I think. According to OP, above code works when running the application using the VS debugger (so using IIS Express), but it fails when running the application in IIS.
– Stijn
Nov 14 '18 at 10:49
2
@Stijn the error message has nothing to do with the code posted here or IIS. That's a plain old DNS error message. It says that
sandbox.api.mastercard.com
can't be found.– Panagiotis Kanavos
Nov 14 '18 at 10:52
3
From the duplicate's answer
Your machine is using a DNS server that filters queries. This is common in corporate environments; filtering is done to try to stop malware from working.
. The real solution is to communicate with the administrator to find out how DNS is configured and what gets filtered. You'll have to do that before production deployment anyway. The app pool may have to run under a specific account. In the meantime, a hack would be to configure the IIS App pool to run with your account. Another hack could be to edit thehosts
file and enter the target's IP– Panagiotis Kanavos
Nov 14 '18 at 11:18