We are using authorize.net CIM API via webservice located at https://apitest.authorize.net/soap/v1/Service.asmx
After consuming this service we are making transactions of type AuthCapture using following code
ProfileTransAuthCaptureType authCapture = new ProfileTransAuthCaptureType();
authCapture.customerProfileId = long.Parse(customerProfileID);
authCapture.customerPaymentProfileId = long.Parse(customerPaymentProfileID);
authCapture.amount = amount;
authCapture.order = new OrderExType();
authCapture.order.invoiceNumber = invoiceNo;
authCapture.order.description = description;
authCapture.recurringBilling = isRecurring;
authCapture.recurringBillingSpecified = isRecurring;
ProfileTransactionType transaction = new ProfileTransactionType();
transaction.Item = authCapture;
try
{
string extraOptions = "x_duplicate_window=1";
CreateCustomerProfileTransactionResponseType response = AuthorizeNetWSHelper.ServiceCaller.CreateCustomerProfileTransaction(AuthorizeNetWSHelper.MerchantAuthentication, transaction, extraOptions);
if (response.resultCode == MessageTypeEnum.Ok)
{
TransactionVariables tvs = TransactionVariables.Parse(response.directResponse);
transactionID = tvs.TransactionID.ToString();
return true;
}
else if (response != null)
{
internalError = "directResponse : " + response.directResponse;
string outErr;
error = FormatError(response.messages, out outErr);
if (!string.IsNullOrEmpty(outErr))
internalError += "<br/>Error Message(s) : " + outErr;
internalError += "<br/><br/>Copy the 3rd item in <b>directResponse</b> comma seperated string and see this Error Detail <a target='_blank' href='http://www.authorize.net/support/merchant/Merchant_Integration_Guide.htm#Transaction_Response/Respon... >here </a>";
}
else
{
error = _customError;
}
}
catch (Exception e)
{
error = _customError;
internalError = "System Exception : " + e.Message + "<br/>Source : " + e.Source;
}
What I wanted to know if the webservice is responding in synchronous manner or operations respond in asynchronously ??
We have 30 days subscriptions everyday our code is collecting all the subscriptions close to expire and make recurring transactions to authorize.net. When we get response from authorize.net we update our database. Sometimes we don't get response in real time and next day in our authorize panel we see previous transactions with settled status.
โ02-20-2012 11:38 PM
What do you mean by "don't get response in real time"? Does your script die before it completes a transaction? Does it fail one transaction and then give failures for all the ones after that? Are you catching the response via Silent Post? Please explain.
โ02-21-2012 07:29 PM
I am trying to do this from a web page.
Does anybody have any working examples of executing webservice calls in native Javascript or Jquery?
โ10-21-2013 02:10 PM
You can google jquery and webservice, but again, you can NOT pass the transactionKey to a client/customer browser, in script or form, or in anyway.
โ10-21-2013 05:41 PM