Integrate PayPal with Angular 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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>
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Customising Paypal Checkout Button in PayPal Payments Standard
- does api-m.sandbox.paypal.com or the real api endpoint support IPv6? in REST APIs
- Need help to integrate PayPal Checkout (PPCP) with OpenCart? in PayPal Upgrade Community
- Getting errors when integrating standard checkout with my web site. Probably a beginner problem. in SDKs
- How can I integrate PayPal to enable direct tipping features between users on a content platform? in REST APIs