Closed dolphinsd closed 7 years ago
This library is written in c#, not visual basic. It's not intended for use with VB.net.
If you have some kind of converter from c# to VB, you can always fork the method and remove the version of generate
with a lowercase G. This was a mistake originally, but we can't remove it without breaking backwards compatibility.
So the code is not CLS compliant? You do understand that the tradeoff here is completely breaking all vb.net apps using the library, not just a backward compatibility issue? Our application is completely broken with no work around other than downloading and recompiling our own CLS compliant dll therefore not allowing us to do NuGet updates. I think the reasonable trade off is to fix it. Make it industry standard quality and when C# folks do an update they change the little g to a bit G. Not a big deal. Please reconsider.
It is , as you pointed out, a mistake after all.
The next major version will drop the generate
method. But until then, we will not remove it, as other people who integrated with generate
before Generate
was added will be broken if they do automatic updates.
This SDK does not officially support VB.net.
As I said, you can fork the repo and make the change yourself if you need to.
What was the last version update before this change. We're just going to revert it and wait it out for the next update. Much easier. Thanks
3.8.0
Ok. Thanks!
I just raised the same issue in #65. Didn't see this one! Sorry!
Just in case it helps someone, there is a workaround using reflection. The call:
Dim token As String = gateway.ClientToken.Generate(New ClientTokenRequest())
can be replaced with:
Dim token As String = String.Empty
Dim param(0) As Object
param(0) = New ClientTokenRequest()
token = PaymentGateway.ClientToken.GetType().InvokeMember(
"Generate",
Reflection.BindingFlags.InvokeMethod,
Nothing,
PaymentGateway.ClientToken,
param)
ClientTokenRequest has 2 generate methods with same signature.
Using in VB.NET is causes error as its not case sensitive
error BC31429: 'Generate' is ambiguous because multiple kinds of members with this name exist in interface 'IClientTokenGateway'.