cancel
Showing results for 
Search instead for 
Did you mean: 

Object Reference Exception upon updating Credit Card Information

Hi,

 

i have trying to update the billing address and credit card information using the below Code in c#.

if (gateway.IsNull())
            {
                SetGateway();
            }
            PaymentProfile oldprofile = gateway.GetCustomer(profileID).PaymentProfiles.Where(i=>i.ProfileID.Equals(paymentProfileID)).First();
            
            oldprofile.BillingAddress = billTo;
            oldprofile.CardCode = cardCode;
            oldprofile.CardExpiration = string.Format("{1}-{0}", expirationMonth, expirationYear);
            oldprofile.CardNumber = cardNumber;
            return  gateway.UpdatePaymentProfile(profileID, oldprofile);

 But, upong UpdatePaymentProfile i get a object reference Exception. can someone please point me in the right direction?

1 ACCEPTED SOLUTION

Accepted Solutions

Hey amitthakkar2228,

 

Thanks for bringing this up. It looks like there's a bug in the SDK. I've passed this on to our developers for them to have a look at.

 

Thanks,

 

Michelle

Developer Community Manager

View solution in original post

3 REPLIES 3

okay, if i just enter the billing address it gives me an error E00029 - Payment information is required.

Now , how do i enter the payment information?

 

i believe we need to pass a PaymentEXType, but upon creating new PaymentProfile instance it just allows me to create a maskedType. that gives me a object reference exception.

 

i have just added the Authorize.Net DLL in my project and am creating a library for performing maintenance activities like adding, deleting and updating credit and customer information.

 

Please help.

Hey amitthakkar2228,

 

Thanks for bringing this up. It looks like there's a bug in the SDK. I've passed this on to our developers for them to have a look at.

 

Thanks,

 

Michelle

Developer Community Manager

Yes, i figured the same and downloaded the source and fixed it. Thank you for looking into it.