
import 'dart:convert';

class StripePaymentMethod {
  int id;
  String customerId;
  String paymentMethodId;
  String paymentMethodType;
  String cardBrand;
  String cardCountry;
  int cardExpMonth;
  int cardExpYear;
  String cardFunding;
  String cardLast4;

  StripePaymentMethod.fromJson(Map<String, dynamic> json) :
        id = json['id'],
        customerId = json['customer_id'],
        paymentMethodId = json['payment_method_id'],
        paymentMethodType = json['payment_method_type'],
        cardBrand = json['card_brand'],
        cardCountry = json['card_country'],
        cardExpMonth = json['card_exp_month'],
        cardExpYear = json['card_exp_year'],
        cardFunding = json['card_funding'],
        cardLast4 = json['card_last4'];

  Map<String, dynamic> toJson() => {
    'id': id,
    'customer_id': customerId,
    'payment_method_id': paymentMethodId,
    'payment_method_type': paymentMethodType,
    'card_brand': cardBrand,
    'card_country': cardCountry,
    'card_exp_month': cardExpMonth,
    'card_exp_year': cardExpYear,
    'card_funding': cardFunding,
    'card_last4': cardLast4,
  };

  @override
  String toString() {
    return json.encode(this);
  }

}