So, I have a payment form that I’m putting up to get the customer’s credit card information. I have a checkbox “save this card for future visits” to get the user’s permission, and since I"m going to be deploying this in Europe, I’m using the payment form’s verifyBuyer(…) call to get the additional verification token that will be needed in Europe. In the verification information that I pass into the verifyBuyer() call, there is an “intent” field which should be set to “STORE” for saving a user’s card, or to “CHARGE” for an immediate charge.
The problem is that I want to first save the card, AND THEN charge the card.
There are 4 scenarios that I can think of:
- I don’t have a card on file for the user, and the user doesn’t want to create one.
- I don’t have a card on file, but the user wants to create it, for current and future purchases.
- I have a card on file and the user wants to use it.
- I have a card on file but the user wants to use a different card, or replace the current one.
There are a couple of scenarios in there where I need to BOTH store the card for the user AND use it for the current purchase. This appears to be causing problems with the creation of the Payment for the current order, which is giving me the following error: “BAD_REQUEST: Invalid verification_token: INTENT_MISMATCH (Field: verification_token)”.
When I created the verificationDetails to send to verifyBuyer, I specified “STORE” as the intent, because I wanted to store the card, but then I get the error above when creating the payment. Should I use “CHARGE” instead, and will that verification token cause problems when I make the call to “CreateCustomerCard”?