Search code examples
braintree

Braintree: What is paymentMethodToken required in creating subscriptions?


https://developer.paypal.com/braintree/docs/guides/recurring-billing/create

    result = Braintree_Subscription::create(array(
    'paymentMethodToken' => 'the_token',
    'planId' => 'silver_plan'
    ));

Is it a random generated string in my code? Or is it something else?


Solution

  • The paymentMethodToken is a unique identifier for the customer's credit card to use. After you create a Customer with a stored payment method you can use the returned token to subscribe a user to a plan. This article explains it well:

    https://developer.paypal.com/braintree/docs/guides/recurring-billing/overview