zyra / cordova-plugin-stripe

A Cordova plugin that lets you use Stripe's Native SDKs for Android and iOS.
MIT License
93 stars 57 forks source link

Exception calling native with command :: CordovaStripe :: setPublishableKey ::exception=TypeError: errorCallback is not a function #11

Closed gujiman closed 7 years ago

gujiman commented 7 years ago

hi,

i created a blank V2 app with the latest stripe plugin. i can get the android version to work. However i'm having problem with the browser version. I get the following error:

Exception calling native with command :: CordovaStripe :: setPublishableKey ::exception=TypeError: errorCallback is not a function

Exception calling native with command :: CordovaStripe :: createCardToken ::exception=TypeError: errorCallback is not a function

What i'm using: "@angular/common": "2.4.8", "@angular/compiler": "2.4.8", "@angular/compiler-cli": "2.4.8", "@angular/core": "2.4.8", "@angular/forms": "2.4.8", "@angular/http": "2.4.8", "@angular/platform-browser": "2.4.8", "@angular/platform-browser-dynamic": "2.4.8", "@angular/platform-server": "2.4.8", "@ionic/storage": "2.0.0", "ionic-angular": "2.2.0", "ionic-native": "2.4.1", "ionicons": "3.0.0", "rxjs": "5.0.1", "sw-toolbox": "3.4.0", "zone.js": "0.7.2"

ihadeed commented 7 years ago

@gujiman are you using the Ionic Native wrapper? or using the plugin directly?

gujiman commented 7 years ago

Hi @ihadeed im using the ionic Native wrapper, with the sample code provided in the docs.

Steps taken to reproduce the error:

  1. $ ionic start myApp blank --v2

  2. add the following to package.json (had to do it this way to avoid issue https://github.com/zyramedia/cordova-plugin-stripe/issues/9):

  "cordovaPlugins": [
    ...
    {
      "locator": "https://github.com/zyramedia/cordova-plugin-stripe.git",
      "id": "cordova-plugin-stripe"
    }
    ...
  ],
  1. $ ionic state reset -- plugins

  2. add sample code from http://ionicframework.com/docs/v2/native/stripe/.

  3. $ ionic build browser

  4. $ ionic run browser

ihadeed commented 7 years ago

Fixed and now available in latest version 1.4.0.