PaymentIntent.fromJson constructor

PaymentIntent.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory PaymentIntent.fromJson(Map<String, dynamic> json) {
  if (json['object'] != 'payment_intent') {
    throw InvalidResourceException(
        'The resource object should be "payment_intent": $json ');
  }

  /// Ugly workaround to handle Stripe list objects.
  json['charges'] = json['charges']['data'];
  return _$PaymentIntentFromJson(json);
}