Skip to content

Commit

Permalink
Merge pull request #17 from TransbankDevelopers/fix/check-loadkeys-re…
Browse files Browse the repository at this point in the history
…sponse

fix: check the response (function code) for load_keys example
  • Loading branch information
Leonel Muñoz authored May 9, 2019
2 parents 2fd5955 + e154f13 commit 9470392
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions examples/load_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ int main()

BaseResponse response = load_keys();

// TODO(lm): Check if response is correct :/
printf("Function: %i\n", response.function);
printf("Response Code: %i\n", response.responseCode);
printf("Commerce Code: %llu\n", response.commerceCode);
printf("Terminal ID: %i\n", response.terminalId);
puts("Keys loaded successfully.\n=================\n");
if (response.function == 810)
{
printf("Function: %i\n", response.function);
printf("Response Code: %i\n", response.responseCode);
printf("Commerce Code: %llu\n", response.commerceCode);
printf("Terminal ID: %i\n", response.terminalId);
puts("Keys loaded successfully.\n=================\n");
}
else
{
puts("Unable load keys on selected port.\n");
}

//Close Port
retval = close_port();
Expand Down

0 comments on commit 9470392

Please sign in to comment.