0

I am currently using ActiveMerchant to integrate with Authorize.net CIM. It's working mostly fine. However, I'm having issues updating a customer's payment profile information (kind of similar to this - How can I update customer payment profile details in Authorize.NET (CIM)?)

Basically, when ActiveMerchant wants to send an API request to Authorize.net, it requires me to build a CreditCard model for the credit card payment details instead of just providing a hash. But for updating a customer's payment profile, I don't have the real values for that card, only masked strings like "XXXX1111" for the card number or "XXXX" for the expiration date.

I can't create a validate CreditCard model with those values, yet all I need to do is pass the masked values back to Authorize.net. I can't find any documentation on how to do this though. Has anyone else faced this issue?

1 Answer 1

0

You need to create an invalid CreditCard object using only the masked card number. The CreditCard object will detect that there is no year or month present and use 'XXXX' for the full expiration date. The CreditCard object itself will be invalid but it will create a valid update request.

This is the only way I could figure out how to solve the issue because the update_customer_payment_profile method wants to be able to call the 'number' method on the object so it's expecting a credit card or another object with a 'number' there.

1
  • That makes my model validations a bit annoying, but at least it seems to work. Thanks for the heads up!
    – Bryce
    Apr 12, 2013 at 3:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.