Integrate PayPal with Angular 6

Olan
Contributor
Contributor

I am trying to integrate PayPal with Angular 6. Previously I had subscription button which worked fine.
Now if I am just copying the code of that button into angular 6 template - the button does nothing. No redirection to paypal page.
I found how do I integrate it with express checkout, but I need RECURRING PAYMENTS. I there is any clear instructions of doing that.
The code is simple:

 

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="***********">


<input type="image" src="https://www.paypalobjects.com/en_US/IL/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="Pay with PayPal!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

 

Thank you.

Login to Me Too
1 REPLY 1

taiye-af
New Community Member

This should work; the missing part is (click)="form.submit()"

 

<form #form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="***********">


<input (click)="form.submit()" type="image" src="https://www.paypalobjects.com/en_US/IL/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="Pay with PayPal!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.