Stripe Charge promise doesn't resolve
<p>I'm making an AJAX call from <code>StripeCheckout.configure({ })</code> on the <code>token</code> parameter, like this:</p>

<pre><code>StripeCheckout.configure({
  ...,
  token: function(stripeToken) {
    $.post( url, {
      // post data
    }, function(data) {
      console.log("data", data);
      return data;
    });
  }
});
</code></pre>

<p>At the URL which receives the AJAX call (let's call it <code>/charge</code>), I have this code:</p>

<pre><code>const charge = (req, res) =&gt; {
  const {
    // get AJAX post data, e.g amount, description, STRIPE_TOKEN, etc
  } = req.body 
  return stripe.charges.create({
    amount: amount,
    currency: 'gbp',
    source: STRIPE_TOKEN,
    description: description,
  })
  .then((charge) =&gt; {
    const {params} = charge // get various parameters from the successful charge data to be passed into book()
    return book(params) // promise function which goes to an external provider
    .then((data) =&gt; {
      return data // data returns from book and is then lost between here and the original AJAX callback 
    })
  }).catch((err) =&gt; {
    console.log(err)
  })
}
</code></pre>

<p>as you can see from the comments, the <code>data</code> in the charge function is correct, but then between that promise and the original AJAX call, it's lost and the AJAX call gets nothing. If I look at the network request in Chrome devtools, it says that <code>charge</code> received the data but the AJAX call times out as it receives no response data.</p>

<p>I think I've been looking at this too long and have probably made a super easy and stupid mistake.</p>