Ionic native PayPal is bad in last update

The tutorial from Ionic 2 has a error https://ionicframework.com/docs/native/paypal/

import { PayPal, PayPalPayment, PayPalConfiguration } from ‘@ionic-native/pay-pal’; (here is @ionic-native/pay-pal but this code is not working, the correct code is):

import { PayPal, PayPalPayment, PayPalConfiguration } from ‘@ionic-native/paypal’;

However, when the ionic transpile is creating bad the main.js because write pay-pal.

I have one app working with Ionic Native PayPal, but, Ionic Native Paypal is not working when i did update to Ionic 2.2.2, i am receiving the error, “This device is not supported”.

I need help for resolve this problem.

When you think this, the first thing you should ask yourself is whether you have the latest version of things, and I’m guessing you don’t.

I have received the same error following the tutorial from Ionic Native. Also, I made the change to the folder structure in the @ionic-native to follow pay-pal but even this didn’t rectify the problem.

The error I get outputted is the following:-

No Provider for Paypal!

Error: DI Error
    at v (http://localhost:8100/build/polyfills.js:3:4864)
    at NoProviderError.BaseError [as constructor] (http://localhost:8100/build/main.js:37761:27)
    at NoProviderError.AbstractProviderError [as constructor] (http://localhost:8100/build/main.js:78282:16)
    at new NoProviderError (http://localhost:8100/build/main.js:78344:16)
    at ReflectiveInjector_._throwOrNull (http://localhost:8100/build/main.js:133948:19)
    at ReflectiveInjector_._getByKeyDefault (http://localhost:8100/build/main.js:133987:25)
    at ReflectiveInjector_._getByKey (http://localhost:8100/build/main.js:133919:25)
    at ReflectiveInjector_.get (http://localhost:8100/build/main.js:133788:21)
    at AppModuleInjector.NgModuleInjector.get (http://localhost:8100/build/main.js:79218:52)
    at CompiledTemplate.proxyViewClass.AppView.injectorGet (http://localhost:8100/build/main.js:134723:45)
    at CompiledTemplate.proxyViewClass.DebugAppView.injectorGet (http://localhost:8100/build/main.js:135151:49)
    at ElementInjector.get (http://localhost:8100/build/main.js:134227:27)
    at CompiledTemplate.proxyViewClass.AppView.injectorGet (http://localhost:8100/build/main.js:134723:45)
    at CompiledTemplate.proxyViewClass.DebugAppView.injectorGet (http://localhost:8100/build/main.js:135151:49)
    at ElementInjector.get (http://localhost:8100/build/main.js:134227:27)

Following this, I’ll check if my Ionic Native is up to date to see if this is the reason to the problem. Hopefully it is, then it should fix the following above.

Found what the issue is.

You need to add PayPal into your app.module.ts and declare it as a provider.

import { PayPal } from '@ionic-native/pay-pal';

...

@NgModule({
	imports: ...,
	exports: ...,
	providers: [
		...
		PayPal,
		...
	]
})

This will fix your no provider issues.