title: Implementing Stripe Connect using JSONP in an Ember.js app
body: <p>I am currently integrating <strong>Stripe Connect</strong> with an <strong>Ember.js 1.7.0-beta.4</strong> application (which supports query params).  Per <a href="https://stripe.com/docs/connect/oauth" rel="nofollow">Stripe documentation</a>, <strong>I need to receive a GET Redirect from Stripe in my Ember.js application, and use the query params to make a final POST request</strong>.</p>
  
  <p>So far, I've captured the query params and am attempting to make an AJAX POST from the same controller, but the AJAX POST returns an error because apparently Stripe's API no longer supports CORS - <a href="https://stripe.com/blog/stripejs-and-jsonp" rel="nofollow">despite a 2-year-old Stripe blog entry saying otherwise</a>:</p>
  
  <p><em>XMLHttpRequest cannot load <a href="https://connect.stripe.com/oauth/token" rel="nofollow">https://connect.stripe.com/oauth/token</a>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin is therefore not allowed access.</em></p>
  
  <p>The current Stripe docs say to use JSONP, noting in that same blog post that <em>"since JSONP only supports GET requests, but our API uses a variety of request methods, we had to implement HTTP method override support with a _method query parameter."</em></p>
  
  <p>Unfortunately, I don't know how to integrate the JSONP approach into the Ember.js application.</p>
  
  <p>Stripe's docs instruct me to "Add this script tag to your page to get started with Stripe.js."</p>
  
  <pre><code>&lt;script type="text/javascript" src="https://js.stripe.com/v2/"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Do I just paste this verbatim into a Handlebars.js template?  Then how do I make the required POST request with query params?  And where?</p>
  
  <p><strong>Bottom Line: How do I integrate Stripe's JSON approach to enable Stripe Connect in my Ember.js application?</strong></p>