title: Request to URL from Angular To payfast payment vendor
body: <p>I need to perform a form POST to a 3rd party payment provider with Angular
  <a href="https://i.stack.imgur.com/u5MRS.png" rel="nofollow noreferrer">The flow need to be as follows.</a></p>
  <p><strong>The payment gateway I'm using is <a href="https://developers.payfast.co.za/docs#quickstart" rel="nofollow noreferrer">PayFast</a>.</strong></p>
  <p>The problem is that in some cases when I perform URL redirect successfully I don't receive any response from payment gateway. When a user clicks &quot;Pay&quot;. he is redirected to the success page <a href="http://example.com/success" rel="nofollow noreferrer">http://example.com/success</a> and in case of error response to page <a href="http://example.com/cancel" rel="nofollow noreferrer">http://example.com/cancel</a>.</p>
  <p>HttpClient through service</p>
  <p>I've also tried making HttpClient POST request inside the Angular app and without NodeJS backend. In that case, I call the Payment Gateway URL directly but with CORS error.</p>
  <p>payment.service.ts:</p>
  <pre><code>payFunction(parameters: any){
    return this._httpClient.post('https://test-wallet.example.com/checkout/'+ 
        'param1='+parameters.param1+ 
        '&amp;param2='+parameters.param2+
        '&amp;param3='+parameters.param3+ 
        '&amp;param4='+parameters.param4+ 
        '&amp;param5='+parameters.param5+
        '&amp;param6='+parameters.param6+ 
        '&amp;param7='+parameters.param7+
        '&amp;param8='+parameters.param8+
        '&amp;param9='+parameters.param9
        ,parameters
        ,this.httpOptions 
      )
     .catch(err =&gt; {
        console.log(err);
        return Observable.of(err)
     })
  }
  </code></pre>
  <p>I call the previous service in component:</p>
  <pre><code>async test(form){
    await this._myPaymentService.payFunction(form.value).subscribe(res =&gt; {
          console.log(res);
  })
  </code></pre>
  <p><strong>But here I'm getting cors policy error if I even go with allow header with cross origin to * then it will not work with production modes</strong></p>
  <p>Next method I used is <strong>Form Post method</strong> as shown below.</p>
  <pre><code>&lt;form [action]=&quot;'https://test-wallet.example.com/checkout/'&quot; ngNoForm method=&quot;POST&quot; target=&quot;_blank&quot;&gt;
    &lt;button type=&quot;submit&quot;&gt;Pay with card&lt;/button&gt;
    &lt;input name='param1' value='param1'&gt;
    &lt;input name='param2' value='param2'&gt;
    &lt;input name='param3' value='param3'&gt;
    &lt;input name='param4' value='param4'&gt;
    &lt;input name='param5' value='param5'&gt;
    &lt;input name='param6' value='param6'&gt;
    &lt;input name='param7' value='param7'&gt;
    &lt;input name='param8' value='param8'&gt;
    &lt;input name='param9' value='param9'&gt;
  </code></pre>
  
  **But no way to catch the response back from that.**
  <p>Can any one please help me out for how to make it out in backend .NET Core API and send the response back to the front end based on which i can show a message to user.</p>
  <p>Thanks in advace.</p>