I have an Angular application, where I need to integrate a PayPal payment process. I've been following some tutorials, but now I am stuck with this.
What I've done until now?
- run 'npm install xcomponent'
- run 'npm instal paypal-checkout'
- add
<scriptsrc="https://www.paypalobjects.com/api/checkout.js"></script>to index.html - add
<paypal-button [props]="{ payment: payment, onAuthorize: onAuthorize }"></paypal-button>to the page I need the button to be rendered At app.module.ts, exported and imported (in NgModule imports list) a new Module like this:
declare const paypal:any; export const PayPalButtonModule = paypal.Button.driver('angular2',{Component,NgModule,ElementRef,NgZone});
Add to the component (lets call it MyPayPalComponent.ts) I need to render the button:
payment() { console.log('payment'); } onAuthorize() { console.log("onAuthorize"); }
And the button is being rendered, but what is the next step? How to, at MyPayPalComponent.ts, "overload" the functions payment, onAuthorize and onCancel, to make everything work?