ionic 3: Stripe, stripe .js must be loaded from js.stripe.com

Viewed 117

In my ionic 3 app, I have used Stripe for making payments.

When I build the app for android using ionic cordova build android the stripe works fine. But when I want to debug the app using ionic cordova run android --livereload it's giving me the below error:

ERROR Error: Uncaught (in promise): IntegrationError: Stripe.js must be loaded from js.stripe.com. 
For more information https://stripe.com/docs/stripe-js/reference#including-stripejs

The code is as follows:

declare var Stripe;
export class StripePaymentPage {
  stripe: any
  constructor() {
    this.stripe = Stripe(localStorage.getItem("my_stripe_key")); // Getting error on this line.
  }
}

If you need more information, please comment below.

0 Answers
Related