jonasbark / flutter_stripe_payment

[DISCONTINUED] A flutter plugin with stripe payment plugin integration
MIT License
309 stars 244 forks source link

CreditCard.fromJson() uses camel case instead of snake case #264

Closed OMGloom closed 3 years ago

OMGloom commented 3 years ago

Card object per stripe API: https://stripe.com/docs/api/cards/object uses snake case in field names. CreditCard object tries to deserialize referencing fields in camel case https://github.com/jonasbark/flutter_stripe_payment/blob/eaa2961d248e27fa94036591d3fa3904c4286244/lib/src/token.dart#L126-L146

This results in CreditCard object missing most of its fields when loaded from Stripe API. Same applies to toJson() method

jonasbark commented 3 years ago

The API isn't used directly: https://github.com/jonasbark/flutter_stripe_payment/blob/master/android/src/main/java/com/gettipsi/stripe/util/Converters.java#L95