Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Highlighted
Member
Posts: 3
Registered: ‎01-06-2011
Accepted Solution

AIM - Customer Information not saved

I'm using the AIM AuthorizeNet library for .NET to process AUTH_CAPTURE transactions.

 

The transaction goes thru OK and it appears to get some of the data I pass it - like the fact that it's an AUTH_CAPTURE and the amount, but it doesn't have any of the Customer Billing Information (Invoice, Description, Address, Phone, Email) or Additional Information (Freight, Tax) that I pass it.

 

Am I not doing this correctly?

 

Here's my code:

 

        Dim authReq As AuthorizeNet.AuthorizationRequest

        Dim post_values As New System.Collections.Specialized.NameValueCollection

 

        post_values.Add("x_login", "xxxxx")

        post_values.Add("x_tran_key", "xxxxxxxxxx")

        post_values.Add("x_version", "3.1")

 

        post_values.Add("x_delim_data", "TRUE")

        post_values.Add("x_delim_char", "|")

        post_values.Add("x_relay_response", "FALSE")

 

        post_values.Add("x_type", "AUTH_CAPTURE")

        post_values.Add("x_method", "CC")

        post_values.Add("x_card_num", txtCreditCard.Text.Replace(" ", "").Replace("-", ""))

        post_values.Add("x_card_code", txtCCV.Text)

        post_values.Add("x_exp_date", txtExpDate.Text)

 

        post_values.Add("x_amount", order.OrderTotal.ToString("0.00"))

        post_values.Add("x_tax", order.SalesTax.ToString("0.00"))

        post_values.Add("x_freight", order.ShippingAmount.ToString("0.00"))

        post_values.Add("x_description", "Order " + order.OrderId.ToString + " for Project " + order.ProjectName)

        post_values.Add("x_invoice_num", "P-" + order.ProjectId.ToString + "O-" + order.OrderId.ToString)

 

        post_values.Add("x_address", txtBillAddr1.Text)

        post_values.Add("x_city", txtBillCity.Text)

        post_values.Add("x_state", txtBillState.Text)

        post_values.Add("x_zip", txtBillZip.Text)

        post_values.Add("x_phone", txtPhoneNumber.Text)

 

        post_values.Add("x_cust_id", systemUser.UserId.ToString)

        post_values.Add("x_email", systemUser.Email)

        post_values.Add("x_customer_ip", request.UserHostAddress)

 

        authReq = New AuthorizeNet.AuthorizationRequest(post_values)

 

        Dim gate As New AuthorizeNet.Gateway("4kL4H8gRy", "225JNwmN52sw566f", True)

        Dim resp As AuthorizeNet.IGatewayResponse = gate.Send(authReq)

 

I get a successful response back including TransId and AuthCode, but the email I get back (see below) doesn't have any of the extended information in it.

 

Here's an example of an email receipt I get back...

 

 

========= ORDER INFORMATION =========

Invoice :

Description :

Amount : 132.00 (USD)

Payment Method : Visa

Type : Authorization and Capture

 

============== RESULTS ==============

Response : This transaction has been approved.

Authorization Code : xxxxx

Transaction ID : xxxxxxxxx

Address Verification : Street Address: Match -- First 5 Digits of Zip: Match

 

==== CUSTOMER BILLING INFORMATION ===

Customer ID :

First Name :

Last Name :

Company :

Address :

City :

State/Province :

Zip/Postal Code :

Country :

Phone :

Fax :

E-Mail :

 

==== CUSTOMER SHIPPING INFORMATION ===

First Name :

Last Name :

Company :

Address :

City :

State/Province :

Zip/Postal Code :

Country :

 

======= ADDITIONAL INFORMATION ======

Tax :

Duty :

Freight :

Tax Exempt :

PO Number :

 

Thanks for the help,

 

Mike


Accepted Solutions
Solution
Accepted by topic author mshepus
‎08-21-2015 01:58 AM
Member
Posts: 3
Registered: ‎01-06-2011

Re: AIM - Customer Information not saved

Thank you Clement - worked like a charm!

 

Cheers,

 

Mike

View solution in original post


All Replies
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: AIM - Customer Information not saved

Look like the .net SDK only passing CC#, CC Exp and Amount for AIM AUTH_CAPTURE.

 

Member
Posts: 3
Registered: ‎01-06-2011

Re: AIM - Customer Information not saved

So is that a bug in the .NET SDK?  Is there something I should do differently?

 

Thanks,

 

Mike

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: AIM - Customer Information not saved

after

authReq = New AuthorizeNet.AuthorizationRequest(post_values)

you can add the other fields

authReq.AddMerchantValue("key","value");

e.g.

authReq.AddMerchantValue(("x_tax", order.SalesTax.ToString("0.00"));

 

Solution
Accepted by topic author mshepus
‎08-21-2015 01:58 AM
Member
Posts: 3
Registered: ‎01-06-2011

Re: AIM - Customer Information not saved

Thank you Clement - worked like a charm!

 

Cheers,

 

Mike

Member
Posts: 2
Registered: ‎04-19-2013

Re: AIM - Customer Information not saved

Hi, 

 

I am having almost same problem i-e. no  CUSTOMER SHIPPING INFORMATION and no ADDITIONAL INFORMATION. Following is the result email i am getting.

 

Response : This transaction has been approved.
Authorization Code : 375767
Transaction ID : 5128485806
Address Verification : Street Address: Match -- First 5 Digits of Zip: Match

==== CUSTOMER BILLING INFORMATION ===
Customer ID :
First Name : abc
Last Name : def
Company :
Address : 74 sadlajkl
City : Langhorne
State/Province : PA
Zip/Postal Code : 19047
Country : US
Phone :
Fax :
E-Mail :

==== CUSTOMER SHIPPING INFORMATION ===
First Name :
Last Name :
Company :
Address :
City :
State/Province :
Zip/Postal Code :
Country :

======= ADDITIONAL INFORMATION ======
Tax :
Duty :
Freight :
Tax Exempt :
PO Number :

 

 

 

When i checked the code I was not actually putting these things in NameValueCollection object. its actually using  public void ProcessPayment(PaymentInfo paymentInfo, Customer customer, Guid orderGuid, ref ProcessPaymentResult processPaymentResult) method and I dont get any orderInfo object in this method to add additional information. below is my code with fields added so far.

 

 

NameValueCollection form = new NameValueCollection();
form.Add("x_login", loginID);
form.Add("x_tran_key", transactionKey);
if (useSandBox)
form.Add("x_test_request", "TRUE");
else
form.Add("x_test_request", "FALSE");

form.Add("x_delim_data", "TRUE");
form.Add("x_delim_char", "|");
form.Add("x_encap_char", "");
form.Add("x_version", APIVersion);
form.Add("x_relay_response", "FALSE");
form.Add("x_method", "CC");
form.Add("x_currency_code", CurrencyManager.PrimaryStoreCurrency.CurrencyCode);
if (transactionMode == TransactMode.Authorize)
form.Add("x_type", "AUTH_ONLY");
else if (transactionMode == TransactMode.AuthorizeAndCapture)
form.Add("x_type", "AUTH_CAPTURE");
else
throw new NopException("Not supported transaction mode");

form.Add("x_amount", paymentInfo.OrderTotal.ToString("0.00", CultureInfo.InvariantCulture));
form.Add("x_card_num", paymentInfo.CreditCardNumber);
form.Add("x_exp_date", paymentInfo.CreditCardExpireMonth.ToString("D2") + paymentInfo.CreditCardExpireYear.ToString());
form.Add("x_card_code", paymentInfo.CreditCardCvv2);
form.Add("x_first_name", paymentInfo.BillingAddress.FirstName);
form.Add("x_last_name", paymentInfo.BillingAddress.LastName);
if (string.IsNullOrEmpty(paymentInfo.BillingAddress.Company))
form.Add("x_company", paymentInfo.BillingAddress.Company);
form.Add("x_address", paymentInfo.BillingAddress.Address1);
form.Add("x_city", paymentInfo.BillingAddress.City);
if (paymentInfo.BillingAddress.StateProvince != null)
form.Add("x_state", paymentInfo.BillingAddress.StateProvince.Abbreviation);
form.Add("x_zip", paymentInfo.BillingAddress.ZipPostalCode);
if (paymentInfo.BillingAddress.Country != null)
form.Add("x_country", paymentInfo.BillingAddress.Country.TwoLetterIsoCode);
form.Add("x_invoice_num", orderGuid.ToString());
form.Add("x_customer_ip", HttpContext.Current.Request.UserHostAddress);
//x_ship_to_state

form.Add("x_ship_to_first_name", customer.ShippingAddress.FirstName);
form.Add("x_ship_to_last_name", customer.ShippingAddress.LastName);
form.Add("x_ship_to_company", customer.ShippingAddress.Company);
form.Add("x_ship_to_address", customer.ShippingAddress.Address1 + customer.ShippingAddress.Address1);
form.Add("x_ship_to_city", customer.ShippingAddress.City);
form.Add("x_ship_to_state", customer.ShippingAddress.StateProvince.Name);
form.Add("x_ship_to_zip", customer.ShippingAddress.ZipPostalCode);
form.Add("x_ship_to_country", customer.ShippingAddress.Country.Name);

 

however I am still unable to figure out where should I add the fields below.

 

form.Add("x_invoice_num", "P-" + paymentInfo.ProjectId.ToString + "O-" + paymentInfo.o.ToString);
form.Add("x_amount", orderInfo.GrandTotal.ToString("0.00", ci_enUS));
form.Add("x_tax", orderInfo.Tax.ToString("0.00", ci_enUS));
form.Add("x_freight", customer.ShippingAddress ("0.00", ci_enUS));

 

can you please help me out in this regard.

 

 

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: AIM - Customer Information not saved

Contributor
Posts: 12
Registered: ‎04-09-2013

Re: AIM - Customer Information not saved

Hi Mike 

I am also working AIM Functionality.......

 

But facing few error.........

 

If you dont mind,.....can You share me a sample application , so that I can check out properly for all fields.

 

Member
Posts: 2
Registered: ‎04-19-2013

Re: AIM - Customer Information not saved

hi Raynor...

 

Sorry I was a bit busy in some other tasks was unable to reply back, Acutally I was looking at the solution you suggested but I was unable to find the authReq = New AuthorizeNet.AuthorizationRequest(post_values) in my code. 

 

And authReq.AddMerchantValue(("x_tax", order.SalesTax.ToString("0.00")); is also using order object which I dont have in ProcessPayment method. Below is function signature for processPayment that is calling.

 

public void ProcessPayment(PaymentInfo paymentInfo, Customer customer, Guid orderGuid, ref ProcessPaymentResult processPaymentResult);

 

Your help will be highly appreciated. Thanks

 

 

Samee Javaid

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: AIM - Customer Information not saved

public void ProcessPayment(PaymentInfo paymentInfo, Customer customer, Guid orderGuid, ref ProcessPaymentResult processPaymentResult);

 

That look like your custom code. Can't you run debug and see what wrong with it?