title: stripe: Create a 30-day trial subscription charge on a saved card but allow user to upgrade and start charging immediately?
body: <p>So before a user can create an account I want to save their credit card to charge a subscription with 30 day trial AND the ability to immediately charge the card for a subscription if the user demands it.</p>
  
  <p>so my logic is to</p>
  
  <p>1) create a customer</p>
  
  <p>2) add payment details for customer</p>
  
  <p>3) create subscription with 30 day trial</p>
  
  <p>4) activate subscription upon user upgrade action</p>
  
  <p>I'm not clear on how 4) is possible. I get that on 3), after 30 days, they are on a subscription. but what if the customer wants to start using the full version immediately before the trial is over, how would I create a charge for the subscription?</p>
  
  <pre><code>const stripe = require('stripe')('sk_test_asdfasdf');
  (async () =&gt; {
    // Create a Customer:
  stripe.customers.create({
    email: 'jenny.rosen@example.com',
    payment_method: 'pm_1FWS6ZClCIKljWvsVCvkdyWg',
    invoice_settings: {
      default_payment_method: 'pm_1FWS6ZClCIKljWvsVCvkdyWg',
    },
  }, function(err, customer) {
    // asynchronously called
  });
  
  //create subscription
  stripe.subscriptions.create({
    customer: 'cus_4fdAW5ftNQow1a',
    items: [
      {
        plan: 'plan_CBXbz9i7AIOTzr',
      },
    ],
    expand: ['latest_invoice.payment_intent'],
  }, function(err, subscription) {
      // asynchronously called
    }
  );
  
  })();
  </code></pre>