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
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!
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]" />