ChargeOutcome.fromJson constructor
ChargeOutcome.fromJson(
- Object? json
Implementation
factory ChargeOutcome.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return ChargeOutcome(
networkStatus: map['network_status'] == null
? null
: (map['network_status'] as String),
reason: map['reason'] == null ? null : (map['reason'] as String),
riskLevel:
map['risk_level'] == null ? null : (map['risk_level'] as String),
riskScore:
map['risk_score'] == null ? null : (map['risk_score'] as num).toInt(),
rule: map['rule'] == null ? null : RuleOrId.fromJson(map['rule']),
sellerMessage: map['seller_message'] == null
? null
: (map['seller_message'] as String),
type: (map['type'] as String),
);
}