title: How to create Stripe Customers based on firebase cloud function that triggers after a field is created
body: <p>I'm using the Firestripe example for Firebase cloud functions, but I want to change up the createStripeCustomer function. Instead of firing on the creation of a new user, I want it to trigger when a field is added under that user. Let's say for example, a firstName is added to the user. At that point, I would like to create a Stripe Customer. </p>
  
  <p>My database structure would look like this:</p>
  
  <pre><code>stripe_customers
       uid
         firstName
  </code></pre>
  
  <p>Here is what I tried, but it doesn't seem to be working. I'm very new to Node.js so I'm not familiar with a lot of the syntax.</p>
  
  <pre><code>exports.createStripeCustomer = functions.database.ref('/stripe_customers/{userId}/firstName').onCreate((snap, context) =&gt; {
    return stripe.customers.create({
      email: context.auth.email,
    }).then((customer) =&gt; {
      return admin.database().ref(`/stripe_customers/${context.params.userId}/customer_id`).set(customer.id);
    });
  });
  </code></pre>