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

Breaking change between v1.4 and v1.5 #32

Open alexghr opened 7 years ago

alexghr commented 7 years ago

Hi,

We've encountered a problem after upgrading cordova-plugin-stripe from v1.4.0 to v1.5.3. The createCardToken method no longer returns a string as it did in v1.4.0 but a full object. This is a breaking API change and should not exist in a minor version bump. Can you please update the readme with the new type information?

Thanks

desmondcain commented 7 years ago

Specifying a type of any worked for me since it no longer returns a string.

this.stripe.createCardToken(card)
    .then((res: any) => console.log(res));
brianlittmann commented 7 years ago

Yea, this was a bummer to hit. In the meantime, my workaround is thus:

let tokenId = (typeof token === "object" ? token.id : token)
ihadeed commented 7 years ago

Sorry for the breaking change. You're right, it should've been a major release.

I updated the typings here, I'll update Ionic Native soon.