IntentData.fromJson constructor

IntentData.fromJson(
  1. dynamic data
)

Implementation

factory IntentData.fromJson(dynamic data) {
  var json = DynamicJsonExtension.getJsonMap(data);
  return IntentData(
    amount:
        json['amount'] != null ? AmountData.fromJson(json['amount']) : null,
    secret: json['secret'],
    expirationDate: json['expiration_date'] ?? json['expirationDate'],
    isLive: json['is_live'] ?? json['isLive'],
    id: json['id'],
    status: json['status'] != null
        ? IntentStatusExtension.fromJson(json['status'])
        : null,
    fees: (json['fees'] as List<dynamic>?)
        ?.map((e) => FeeItem.fromJson(e))
        .toList(),
    totalDiscount: json['totalDiscount'] ?? json['total_discount'],
    subtotalAmount: json['subtotalAmount'] ?? json['subtotal_amount'],
  );
}