Search code examples
paymentadyen

Adyen, create token for credit card without making payment


I know that a token can be created in Adyen for a credit card, when specifying shopperReference and storePaymentMethod to the payment request, together with the desired amount and currency. But I need to do that, without making an actual payment. So I need to save the card, get token for it and in the next step make the payment with that token.

Is that possible?


Solution

  • You can make a payment with the amount of 0. This will tokenize the card without actually charging the card. These zero dollar verifications flow is something established by visa/mc to make sure that card details can be verified vs tokenizing a fake or invalid card.

    {
      "amount": {
        "currency": "USD",
        "value": 0
      },
      "reference": "Your order number",
      "paymentMethod": {
        "type": "scheme",
        "encryptedCardNumber": "test_4111111111111111",
        "encryptedExpiryMonth": "test_03",
        "encryptedExpiryYear": "test_2030",
        "encryptedSecurityCode": "test_737"
      },
      "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
    }
    

    That said, not all banks support zero dollar verification but the vast majority of banks do. For banks that don't support it, Adyen will automatically perform a 1 dollar auth followed by an immediate cancel of that auth.