stripe / stripe-dotnet

Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class library for stripe.com.
Apache License 2.0
1.36k stars 569 forks source link

Is this JSON key correct for Multibanco? #1604

Closed Andrewangeta closed 5 years ago

Andrewangeta commented 5 years ago

I'm just browsing the library and noticed that the Json property of the multibanco is uppercased is this a typo? https://github.com/stripe/stripe-dotnet/blob/b1c7480ae5ecfb91910e7819ab1140f1b6c9f683/src/Stripe.net/Entities/Sources/SourceMultibanco.cs#L10

Andrewangeta commented 5 years ago

Same with P24 https://github.com/stripe/stripe-dotnet/blob/b1c7480ae5ecfb91910e7819ab1140f1b6c9f683/src/Stripe.net/Entities/Sources/SourceP24.cs#L7

remi-stripe commented 5 years ago

@Andrewangeta Thanks for the report, this is definitely not correct. I'll work on fixing those later today but I'll wait a bit in case you find any other!

Andrewangeta commented 5 years ago

Also for EPS https://github.com/stripe/stripe-dotnet/blob/b1c7480ae5ecfb91910e7819ab1140f1b6c9f683/src/Stripe.net/Entities/Sources/SourceEps.cs#L7

This has at least one property mentioned here

Andrewangeta commented 5 years ago

@remi-stripe I'm seeing a pattern where the payment method details are looking a lot like sources. but they're mismatched with some having properties and some missing. And some might be outdated according to the details of hashes returned on this page. It's confusing to say the least lol.

remi-stripe commented 5 years ago

That part is a bit different. The Source object is separate from what is put on payment_method_details today.

Sources are being replaced by PaymentMethods which will make maintaining this a lot easier so for now we are not directly added all fields to the type-specific sub-classes.

I opened a PR to fix the properties names: https://github.com/stripe/stripe-dotnet/pull/1605

Andrewangeta commented 5 years ago

@remi-stripe Ah nice! I'm building a Swift NIO based library and just making sure to get most of it right. But thanks for the heads up on sources being replaced in the future.

remi-stripe commented 5 years ago

@Andrewangeta Oh wow that's neat. I would recommend relying on stripe-mock for the test suite like we do!

Andrewangeta commented 5 years ago

that sounds good! Before I was only making sure the models would encode/decode correctly. But I'll try to base my new test suite on .Nets testing pattern using mock.