title: Stripe redirectToCheckout handle result (Angular)
body: <p>I have code to make payment using Stripe checkout</p>
  
  <p>Here is code</p>
  
  <pre><code>async pay(price: number, name: string, description: string) {
      const stripe = await loadStripe('***************');
      this._subscriptionService.createStripeSession(price, name, description, this.document.location.origin)
      .subscribe(async result =&gt; {
          this.sessionId = result;
          const { error } = await stripe.redirectToCheckout({
              sessionId: this.sessionId
          });
      });
  }
  </code></pre>
  
  <p>Now it works well and after the success I go to SuccesUrl, that defined in session, that created on back end.</p>
  
  <p>But also I need to catch the result of function and run another function. How I can do this? </p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Here is <code>createStripeSession</code></p>
  
  <pre><code>createStripeSession(price: number | null | undefined, name: string | null | undefined, description: string | null | undefined, locationUrl: string | null | undefined): Observable&lt;string&gt; {
      let url_ = this.baseUrl + "/api/services/app/Subscription/CreateStripeSession?";
      if (price !== undefined)
          url_ += "price=" + encodeURIComponent("" + price) + "&amp;"; 
      if (name !== undefined)
          url_ += "name=" + encodeURIComponent("" + name) + "&amp;"; 
      if (description !== undefined)
          url_ += "description=" + encodeURIComponent("" + description) + "&amp;"; 
      if (locationUrl !== undefined)
          url_ += "locationUrl=" + encodeURIComponent("" + locationUrl) + "&amp;"; 
      url_ = url_.replace(/[?&amp;]$/, "");
  
      let options_ : any = {
          observe: "response",
          responseType: "blob",
          headers: new HttpHeaders({
              "Accept": "application/json"
          })
      };
  
      return this.http.request("post", url_, options_).pipe(_observableMergeMap((response_ : any) =&gt; {
          return this.processCreateStripeSession(response_);
      })).pipe(_observableCatch((response_: any) =&gt; {
          if (response_ instanceof HttpResponseBase) {
              try {
                  return this.processCreateStripeSession(&lt;any&gt;response_);
              } catch (e) {
                  return &lt;Observable&lt;string&gt;&gt;&lt;any&gt;_observableThrow(e);
              }
          } else
              return &lt;Observable&lt;string&gt;&gt;&lt;any&gt;_observableThrow(response_);
      }));
  }
  </code></pre>