encryptCard method

Future<ApiResponse<GenericResponse?>> encryptCard(
  1. EncryptCardRequest encryptCard
)

Implementation

Future<ApiResponse<GenericResponse?>> encryptCard(
  EncryptCardRequest encryptCard,
) async {
  final result = await sharedApiService.callApi(
    encryptUrl,
    body: encryptCard.toJson(),
    ApiMethod.post,
    token: '',
  );

  if (result.statusCode == 200) {
    return ApiResponse(
      statusCode: result.statusCode,
      data:
          result.data != null
              ? GenericResponse.fromJson(result.data as Map<String, dynamic>)
              : null,
    );
  } else {
    return ApiResponse(statusCode: result.statusCode, error: result.error);
  }
}