PayInvoiceResponse.deserialize constructor
PayInvoiceResponse.deserialize(
- Map<String, dynamic> input
)
Implementation
factory PayInvoiceResponse.deserialize(Map<String, dynamic> input) {
if (!input.containsKey('result')) {
throw Exception('Invalid input');
}
Map<String, dynamic> result = input['result'] as Map<String, dynamic>;
return PayInvoiceResponse(
preimage: result['preimage'] as String?,
resultType: input['result_type'] as String,
feesPaid:
result.containsKey('fees_paid') ? result['fees_paid'] as int : 0,
);
}