Search code examples
braintree

Can you store credit card details in the vault, without charging them, with Braintree v.zero?


With the old Braintree API it was possible to just store credit card details in the vault to charge later (for a variable subscription model). Is it possible to do this with their v.zero API? I looked at their documentation and it wasn't clear. It mentions it can do it with Paypal accounts but I'm not sure if this includes credit cards (no Paypal).


Solution

  • Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.

    Yes! When a customer fills out their credit card information in the Drop-in it is processed by the Braintree API. Once complete, the client receives the payment method (i.e. credit card) nonce which should be sent to your server. This nonce can be used for a whole variety of tasks including simply storing in the vault, as you are trying to do:

    result = Braintree::PaymentMethod.create(
      :customer_id => "131866",
      :payment_method_nonce => nonce_from_the_client
    )
    

    Steps:

    1. Your client embeds the Drop-in
    2. User fills out data in Drop-in
    3. Client receives Nonce
    4. Client sends Nonce to server
    5. Server uses nonce to create a payment method in the vault

    Cheers!