angular-stripe-checkout icon indicating copy to clipboard operation
angular-stripe-checkout copied to clipboard

Fixed issue 24 where publishable-key could not be loaded from control…

Open MileanCo opened this issue 8 years ago • 3 comments

…ler settings

Fixes simply by adding a short $timeout that waits for the {{ }} variables to finish resolving.

MileanCo avatar Oct 18 '17 08:10 MileanCo

Any update here @tobyn ??

MileanCo avatar Oct 24 '17 08:10 MileanCo

I'm not likely to add a random $timeout to this library for no good reason. Give me a concise test case (or a decent explanation as to why this is a problem with the library rather than your app), and I'll be happy to merge your PR.

tobyn avatar Oct 25 '17 20:10 tobyn

I agree with you, but this is the only fix right now for using a publishable_key from $scope (instead of embedding it in the HTML code). The reason we have this in $scope is because we want different Stripe Keys in DEBUG (test) and PRODUCTION (live) environments.

The issue is documented here https://github.com/tobyn/angular-stripe-checkout/issues/21 My theory is that with a very short timeout (50ms - can probably get away with even less, like 15ms or something), the angular $scope has time to register the {{publishable_key}} with the real value.

MileanCo avatar Oct 27 '17 13:10 MileanCo