handleManualPayment method

void handleManualPayment(
  1. AppModel app,
  2. BuildContext theContext,
  3. AssignmentModel? theAssignmentModel,
  4. String paymentReference,
  5. String paymentName,
  6. bool success,
)

Implementation

void handleManualPayment(
    AppModel app,
    BuildContext theContext,
    AssignmentModel? theAssignmentModel,
    String paymentReference,
    String paymentName,
    bool success) {
  if (success) {
    // now store in results status.reference;
    finishTask(
        app,
        theContext,
        theAssignmentModel!,
        ExecutionResults(ExecutionStatus.success, results: [
          AssignmentResultModel(
              documentID: newRandomKey(),
              key: payTaskFieldPaymentType,
              value: 'Manual Payment'),
          AssignmentResultModel(
              documentID: newRandomKey(),
              key: payTaskFieldPaymentReference,
              value: paymentReference),
          AssignmentResultModel(
              documentID: newRandomKey(),
              key: payTaskFieldName,
              value: paymentName)
        ]),
        null);
  } else {
    finishTask(app, theContext, theAssignmentModel!,
        ExecutionResults(ExecutionStatus.delay), null);
  }
}