javascript - Paypal Express Checkout with AngularJS -
has had success integrating paypal express checkout api angularjs web app? have tried adapt "in-context" integration steps angular site; however, works once.
my scenario this:
- i have paypal button on page
- clicking paypal button calls
paypal.checkout.initxo()
, , makes server-side call generate express checkout token - when call returns, pass token
paypal.checkout.startflow(tokenfromserver)
- the paypal api creates popup , collects paypal account info
- the browser gets navigated confirm page based on set server-side when generated express checkout token.
as said above, works fine once; paypal api navigates browser confirmation page expect. however, subsequent attempts use express checkout api don't navigate browser after finishing paypal popup window. refreshing browser allows me use express checkout again, once.
i'm not seeing errors in javascript console.
in meantime i've added ui.router
state start point of "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 page on subsequent visits state, resets paypal api. works. it's ugly, works.
Comments
Post a Comment