cancel
Showing results for 
Search instead for 
Did you mean: 

Create new customer using SDK

Spoiler
 

 

I am planning on using the SDK to integrate with AuthNet. I am unable to find documentation or samples on the SDK.

Where can I find this? For instance. I am trying to create a new customer with a billing address. This is how I am doing it.

 

AuthorizeNet.

CustomerGateway gate = new AuthorizeNet.CustomerGateway(loginId, transactionKey);

           

var response = gate.CreateCustomer(null, uniqueId);

           

if (response != null)

            {

                AuthorizeNet.

Customer cust = gate.GetCustomer(response.ProfileID);

                AuthorizeNet.

Address addr = new AuthorizeNet.Address();

                addr.Street =

string.Format("{0}, {1}", address1, address2);

                addr.City = city;

                addr.State = state;

                addr.Zip = zip;

                addr.Country =

"USA";

               

if (cust.BillingAddress == null)

                {

                    cust.BillingAddress = addr;

                }

               

if (gate.UpdateCustomer(cust))

                {

                   

                }

            }

When I UpdateCustomer the code breaks on this line (line 533) in CustomerGateway.UpdateCustomer() method.

req.profile.customerProfileId = customer.ProfileID;

 

The profile property of the request is null in this instance.

 

Am I using the correct method calls here? I doubt that I am.

 

Any help would be appreciated.

 

TK
Contributor
3 REPLIES 3

Has this issue been resolved?

 

I am encountering the exact same error.

 

- Peter

souk99avatar
Member

I'm getting same error... a little support would be nice...

Insert the following code at line 532:

 

req.profile = new customerProfileExType();