PaymentModel.fromJson constructor

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

PaymentModel.fromJson is a method that converts a JSON object into a PaymentModel object.

Implementation

PaymentModel.fromJson(Map<String, dynamic> json) {
  transactionId = json['id'];
  status = json['status'] ?? '';
  amount = json['amount'] ?? 0;
  fee = json['fee'] ?? 0;
  currency = json['currency'] ?? '';
  refunded = json['refunded'] ?? 0;
  refundedAt = json['refunded_at'] ?? '';
  captured = json['captured'] ?? 0;
  capturedAt = json['captured_at'] ?? '';
  voidedAt = json['voided_at'] ?? '';
  description = json['description'] ?? '';
  amountFormat = json['amount_format'] ?? '';
  feeFormat = json['fee_format'] ?? '';
  refundedFormat = json['refunded_format'] ?? '';
  capturedFormat = json['captured_format'] ?? '';
  invoiceId = json['invoice_id'] ?? '';
  ip = json['ip'] ?? '';
  callbackUrl = json['callback_url'] ?? '';
  createdAt = json['created_at'] ?? '';
  updatedAt = json['updated_at'] ?? '';
}