callHandler static method

Future callHandler({
  1. required MethodCall call,
  2. required IStoneHandler iStoneHandler,
  3. IStoneSmartHandler? stoneSmartHandler,
})

Implementation

static Future<dynamic> callHandler({
  required MethodCall call,
  required IStoneHandler iStoneHandler,
  IStoneSmartHandler? stoneSmartHandler,
}) async {
  switch (call.method.handler) {
    case PaymentTypeHandler.onTransactionSuccess:
      {
        iStoneHandler.onTransactionSuccess();
        _stSmartHandler(
            message: call.arguments, iStoneSmartHandler: stoneSmartHandler);
      }
      break;
    case PaymentTypeHandler.onError:
      {
        iStoneHandler.onError(call.arguments);
        _stSmartHandler(
            message: call.arguments, iStoneSmartHandler: stoneSmartHandler);
      }
      break;
    case PaymentTypeHandler.onMessage:
      {
        iStoneHandler.onMessage(call.arguments);
        _stSmartHandler(
            message: call.arguments, iStoneSmartHandler: stoneSmartHandler);
      }
      break;
    case PaymentTypeHandler.onFinishedResponse:
      {
        iStoneHandler.onFinishedResponse(call.arguments);
        _stSmartHandler(
            message: call.arguments, iStoneSmartHandler: stoneSmartHandler);
      }
      break;
    case PaymentTypeHandler.onChanged:
      {
        iStoneHandler.onChanged(call.arguments);
        _stSmartHandler(
            message: call.arguments, iStoneSmartHandler: stoneSmartHandler);
      }
      break;
    case PaymentTypeHandler.onLoading:
      {
        iStoneHandler.onLoading(call.arguments);
        _stSmartHandler(
            message: call.arguments, iStoneSmartHandler: stoneSmartHandler);
      }
      break;
    case PaymentTypeHandler.onAuthProgress:
      {
        iStoneHandler.onAuthProgress(call.arguments);
        _stSmartHandler(
            message: call.arguments, iStoneSmartHandler: stoneSmartHandler);
      }
      break;
    default:
      throw "METHOD NOT IMPLEMENTED";
  }
  return true;
}