title: Angular2 Stripe function token() http.post undefined
body: <p>I've got a problem with Stripe Checkout and Angular2. I use the token() function to post my token.id to the server side but the web console return me "Cannot read property 'post' of undefined".</p>
  
  <p>But I can do http.post in others functions in this component and it works.</p>
  
  <p>Can you help me ?</p>
  
  <p><strong>component.ts</strong></p>
  
  <pre><code>import {Injectable} from '@angular/core';
  import {ToastOptions} from "ng2-toasty";
  import {Http, Response, Headers, RequestOptions} from "@angular/http";
  import {Observable} from "rxjs";
  
  @Injectable()
  export class CartService {
  
  cart: any = [];
  
  constructor(public http: Http) { }
  
  openCheckout() {
      var handler = (&lt;any&gt;window).StripeCheckout.configure({
          key: 'pk_test_stripe',
          locale: 'auto',
          token: function (token: any) {
  
              alert(token.id); //This work !
  
              let client = {
                  // client JSON object
              };
  
              //Cannot read property 'post' of undefined
              this.http.post('PHP script URL', { // This doesn't work !
                  products: this.cart,
                  client: client,
                  stripeToken: token
              }).subscribe(data =&gt; {
                      console.log(data);
                  }, error =&gt; {
                      console.log("Oooops!");
                  });
          }
      });
  
      handler.open({
          name: 'Site demo',
          description: 'Commande',
          currency: 'chf',
          panelLabel: 'Payer {{amount}}',
          amount: 24500
      });
  
  }
  </code></pre>
  
  <p><strong>component.html</strong></p>
  
  <pre><code>&lt;button (click)="this.cartService.openCheckout()"&gt;Stripe&lt;/button&gt;
  </code></pre>