Reputation: 664
I'm trying to get the transaction ID by AuthorizeAndCapture
method from AuthorizeNet API.
private static void CreateTransaction(long profileId, long paymentProfileId)
{
CustomerGateway target = new CustomerGateway(ApiLogin, TransactionKey);
var response = target.AuthorizeAndCapture(profileId.ToString(), paymentProfileId.ToString(), 1020.00M);
Console.WriteLine("Hola" + response.TransactionID);
}
But, when i execute the method, the property response.TransactionID
returns empty.
I tried to change from sandbox to production and doesn't works neither.
Upvotes: 0
Views: 318
Reputation: 664
I solve the issue using another gateway of the Authorize Net
private static void CreateTransaction(long profileId, long paymentProfileId)
{
Gateway target = new Gateway(ApiLogin, TransactionKey, true);
Customer cust = new Customer {ProfileID = profileId.ToString()};
IGatewayRequest request = new AuthorizationRequest("4111111111111111", "0224", 20.10M,
"AuthCap transaction approved testing", true);
request.AddCustomer("31358164", "[email protected]", "", "", "street", "City",
"State","256984");
const string description = "AuthCap transaction approved testing";
var actual = target.Send(request, description);
Into "actual" we found transactionID.
I hope to help others.
Upvotes: 1