toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['`object`'] = object;
  data['amount'] = amount;
  data['amount_capturable'] = amountCapturable;
  data['amount_received'] = amountReceived;
  data['application'] = application;
  data['application_fee_amount'] = applicationFeeAmount;
  data['canceled_at'] = canceledAt;
  data['cancellation_reason'] = cancellationReason;
  data['capture_method'] = captureMethod;
  data['client_secret'] = clientSecret;
  data['confirmation_method'] = confirmationMethod;
  data['created'] = created;
  data['currency'] = currency;
  data['customer'] = customer;
  data['description'] = description;
  data['id'] = id;
  data['invoice'] = invoice;
  data['last_payment_error'] = lastPaymentError;
  data['livemode'] = livemode;
  data['next_action'] = nextAction;
  data['on_behalf_of'] = onBehalfOf;
  data['payment_method'] = paymentMethod;
  data['receipt_email'] = receiptEmail;
  data['review'] = review;
  data['setup_future_usage'] = setupFutureUsage;
  data['shipping'] = shipping;
  data['source'] = source;
  data['statement_descriptor'] = statementDescriptor;
  data['statement_descriptor_suffix'] = statementDescriptorSuffix;
  data['status'] = status;
  data['transfer_data'] = transferData;
  data['transfer_group'] = transferGroup;
  if (charges != null) {
    data['charges'] = charges!.toJson();
  }
  if (paymentMethodOptions != null) {
    data['payment_method_options'] = paymentMethodOptions!.toJson();
  }
  if (paymentMethodTypes != null) {
    data['payment_method_types'] = paymentMethodTypes;
  }
  return data;
}