Has anyone had success integrating the PayPal Express Checkout API into an AngularJS web app? I have tried to adapt the "in-context" integration steps into my angular site; however, it only works properly once.
My scenario is this:
paypal.checkout.initXO()
, and then makes a server-side call to generate an express checkout token paypal.checkout.startFlow(tokenFromServer)
As I said above, this works fine once; the PayPal API navigates the browser to my confirmation page just as I expect. However, subsequent attempts to use the express checkout API don't navigate the browser after finishing with the paypal popup window. Refreshing the browser allows me to use express checkout again, once.
I'm not seeing any errors in the Javascript console.
In the meantime I've added this to the ui.router
state that is the start point of my "purchase" workflow:
.state("example.buy.the.thing", {
url: "/buy",
templateUrl: "path/to/my/template.html",
controller: ["$window", ($window) => {
if ($window.needsPaypalRefresh) {
$window.location.reload();
}
$window.needsPaypalRefresh = true;
}]
})
It refreshes the page on subsequent visits to this state, which resets the PayPal API. It works. It's ugly, but it works.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.