Transaction.fromObject constructor

Transaction.fromObject(
  1. APIResponse apiResponse
)

Implementation

factory Transaction.fromObject(APIResponse apiResponse) {
  final transaction = Transaction();
  transaction.message =
      apiResponse.gatewayResponse ?? apiResponse.dataMessage ?? "";
  transaction.referenceNumber = apiResponse.reference;
  transaction.state = apiResponse.nextAction;
  return transaction;
}