javascript - PayPal Angular Integration -
i have angular application, need integrate paypal payment process. i've been following tutorials, stuck 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>
index.html - add
<paypal-button [props]="{ payment: payment, onauthorize: onauthorize }"></paypal-button>
page need button rendered at app.module.ts, exported , imported (in ngmodule imports list) new module this:
declare const paypal:any; export const paypalbuttonmodule = paypal.button.driver('angular2',{component,ngmodule,elementref,ngzone});
add component (lets call mypaypalcomponent.ts) need render button:
payment() { console.log('payment'); } onauthorize() { console.log("onauthorize"); }
and button being rendered, next step? how to, @ mypaypalcomponent.ts, "overload" functions payment, onauthorize , oncancel, make work?
Comments
Post a Comment