getAuthView method
Implementation
Future<ResponseDto<GetAuthViewResponseDto>> getAuthView(String paymentNumber,
String? firstName,
String? lastName,
int? expirationMonth,
int? expirationYear,
String authToken) async {
final GetAuthViewRequestDto getAuthViewRequestDto = GetAuthViewRequestDto(
paymentNumber: paymentNumber,
firstName: firstName,
lastName: lastName,
expirationMonth: expirationMonth,
expirationYear: expirationYear);
final RequestDto<GetAuthViewRequestDto> requestDto = RequestDto<
GetAuthViewRequestDto>(body: getAuthViewRequestDto);
final String requestJson = json.encode(requestDto.toJson());
final String requestHash = HttpUtils.computeHash(
requestJson, _requestHashKey);
final Map<String, dynamic> response = await AcceptanceApiClient(_stage)
.postAndParseJson(
_getAuthViewPath, requestJson, _apiKey,
authToken: authToken,
requestHash: requestHash);
final ResponseDto<GetAuthViewResponseDto> responseDto = ResponseDto<
GetAuthViewResponseDto>
.fromJson(response, GetAuthViewResponseDto.fromJson);
responseDto.throwApiExceptionIfError();
return responseDto;
}