Am I missing a step for editing credit cards?

We have a custom form that allows members to update their current credit card.

The updating aspect is working fine, but we noticed one issue today.

If a member updates an existing expired card and gives it an expiration date in the future, Infusionsoft is not updating the card to be valid again. It still says it’s expired. I tried adding a call to “InvoiceService.validateCreditCard” but that didn’t seem to update the status either

Am I missing a step that refreshes the card status or something?

@Jake_Newsom What part of the API were you using the update the card, originally?

DataService.update and passing in the new expiration date

@Jake_Newsom You need to revalidate the card with invoiceservice.validateExistingCard. Or just add a new card.

I don’t see validateExistingCard, but I am calling validateCreditCard. EDIT: I see both examples in the XML-RPC docs, but both examples hit “validateCreditCard”

It’s returning:
[Message] => Validated 5/21/2018
[Valid] => true

But the card in Infusionsoft still says “Invalid, card has expired” until we save the card in Infusionsoft.

Adding a new card isn’t really a solution here as the user would have to type in all of the information as opposed to just updating expiration / cvc / billing address. We provide both options in our member area (updating a card & adding a new card). I don’t think we ever used to have this problem, though I’m not sure when it started.

Sorry, my bad. You use validateCreditCard, but rather then passing the new card details, what you do is first update the card, and then pass just the credit card ID.

$args = array( (int )$creditCardId );
parent::$app->send( "InvoiceService.validateCreditCard", $args );

Yes we’re sending the card ID to InvoiceService.validateCreditCard and getting a “Validated” response back, but that’s not updating it in Infusionsoft still.

Validate with just the id just returns whether that card id is still valid. I think you have to add a new card. I will ask around though. EDIT: Looking at the code you can update a card via DataService. Once updated it appears the validate will just make sure everything looks good from our side like checksums and expirations.