NAXAM / stripe-android-binding

Xamarin Binding Library - Stripe Android SDK
https://github.com/stripe/stripe-android
MIT License
8 stars 6 forks source link

Can't get SourceTypeModel from Source (Java.Lang.NoSuchMethodError: no non-static method "Lcom/stripe/android/model/Source;.getSourceTypeModel()Lcom/stripe/android/model/StripeJsonModel;) #2

Open kyhosy opened 7 years ago

kyhosy commented 7 years ago

Hi NAXAM. I'm implementing stride sdk for payment on xamarin android, so i'm using package Naxam.Stripe.Droid 5.1.1. And in the package, i can't get value of SourceTypeModel from Source. SourceCardData sourceCardData = (SourceCardData)s.SourceTypeModel;

It always throw exception: {Java.Lang.NoSuchMethodError: no non-static method "Lcom/stripe/android/model/Source;.getSourceTypeModel()Lcom/stripe/android/model/StripeJsonModel;" ...... }

When i compare between native code of Stripe sdk and the generated C# file. I found that return type of method "getSourceTypeModel" is not correct. It should be "StripeSourceTypeModel" instead of "StripeJsonModel".

So I have solution for the issue: we try to update "return type" on RegisterAttribute. [Register ("getSourceTypeModel", "()Lcom/stripe/android/model/StripeSourceTypeModel;", "GetGetSourceTypeModelHandler")] By add some code on file metadata.xml: ` <remove-node path="/api/package[@name='com.stripe.android.model']/class[@name='Source']/method[@name='getSourceTypeModel' and count(parameter)=0]" />

` I had tested and it worked. Hope it's useful for you!
tuyen-vuduc commented 6 years ago

@kyhosy do you try the latest one? Is it still required your fix?