title: Create a recurring or subscription payment using Payum Stripe on Symfony 2
body: <p>I am attempting to attach a plan to a Stripe charge using Payum on Symfony 2.  I am able to successfully charge the card but I do not understand how to add the plan to the charge.  </p>
  
  <p>I started looking into using the Stripe_Customer object directly, instead of using Payum but I am then having trouble getting the Stripe Token.  I added a plan method to the payment object. Any help would be greatly appreciated!</p>
  
  <pre><code>&lt;?php
  namespace SEC\PaymentBundle\Controller;
  use Payum\Core\Model\CreditCard;
  use Payum\Core\Request\GetHttpRequest;
  use Payum\Stripe\Action\Api\ObtainTokenAction;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use SEC\PaymentBundle\Entity\Payment;
  use Payum\Core\Request\GetHumanStatus;
  use Payum\Stripe\Request\Api\CreateCustomer;
  use Payum\Stripe\StripeJsGatewayFactory;
  use Symfony\Component\HttpFoundation\JsonResponse;
  use Symfony\Component\HttpFoundation\Request;
  class PaymentController extends Controller
  {
      public function prepareAction(Request $request)
      {
          $factory = new StripeJsGatewayFactory();
          $gateway = $factory-&gt;create(array(
              'publishable_key' =&gt; '****',
              'secret_key' =&gt; '****',
          ));
          $card = new \Payum\Core\Model\CreditCard();
          $card-&gt;setNumber('4111111111111111');
          $card-&gt;setExpireAt(new \DateTime('2018-10-10'));
          $card-&gt;setSecurityCode('123');
          $card-&gt;setHolder('Test');
          $customer = new \Stripe_Customer();
          $storage = $this-&gt;get('payum')-&gt;getStorage('SEC\PaymentBundle\Entity\Payment');
          $model = $storage-&gt;create();
          $model-&gt;setNumber(uniqid());
          $model-&gt;setCurrencyCode('USD');
          $model-&gt;setTotalAmount(100);
          $model-&gt;setClientId($this-&gt;getUser());
          $model-&gt;setDateCreated(new \DateTime('now'));
          $model-&gt;setClientEmail('test@gmail.com');
          $model-&gt;setCreatedBy($this-&gt;getUser());
          $model-&gt;setCreditCard($card);
          $model-&gt;setCustomer($customer);
          $model-&gt;setDescription('This is a description');
          $model-&gt;setPlan(1);
          $storage-&gt;update($model);
          $gateway-&gt;execute(new \Payum\Core\Request\Capture($model));
          $captureToken = $this-&gt;get('payum.security.token_factory')-&gt;createCaptureToken(
              'offline',
              $model,
              'done' // the route to redirect after capture
          );
          return $this-&gt;render('SECPaymentBundle:Default:debug.html.twig', array(
              'model2' =&gt; $model,
              'model' =&gt; $captureToken,
              'model3' =&gt; ''
          ));
      }
  </code></pre>