PayInvoiceResponse.deserialize constructor

PayInvoiceResponse.deserialize(
  1. 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['fees_paid'] as int,
  );
}