SettlementPaymentMethod.fromJson constructor
SettlementPaymentMethod.fromJson(
- Object? json
Implementation
factory SettlementPaymentMethod.fromJson(Object? json) {
final value = (json as Map).cast<String, Object?>();
return switch (value["type"]) {
"mobile_money" => SettlementMobileMoneyPaymentMethod.fromJson(value),
"bank_account" => SettlementBankAccountPaymentMethod.fromJson(value),
_ => throw const FormatException(
"Unsupported refund settlement payment-method type",
),
};
}