Reply
Member
Posts: 9
Registered: ‎06-08-2012
Accepted Solution

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?


Accepted Solutions
Solution
Accepted by topic author amitthakkar2228
‎08-21-2015 01:58 AM
All Star
Posts: 1,072
Registered: ‎08-17-2009

Re: Object Reference Exception upon updating Credit Card Information

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


All Replies
Member
Posts: 9
Registered: ‎06-08-2012

Re: Object Reference Exception upon updating Credit Card Information

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.

Solution
Accepted by topic author amitthakkar2228
‎08-21-2015 01:58 AM
All Star
Posts: 1,072
Registered: ‎08-17-2009

Re: Object Reference Exception upon updating Credit Card Information

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

Member
Posts: 9
Registered: ‎06-08-2012

Re: Object Reference Exception upon updating Credit Card Information

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