### HBCI4Java Status Callback Example Source: https://github.com/hbci4j/hbci4java/blob/master/src/main/java/org/kapott/hbci/callback/package.html Illustrates how to handle status updates within an HBCI dialog using a switch statement to evaluate status tags. This is a standard approach for tracking the progress of an HBCI dialog. ```java public void status(HBCIPassport passport,int statusTag,Object[] o) { switch (statusTag) { case STATUS_DIALOG_INIT: printStatusInfo("fuehre dialog-initialisierung aus"); break; case STATUS_DIALOG_INIT_DONE: printStatusInfo("dialog-init durchgeführt, dialogid ist "+o[0].toString()); break; // usw. usf. } } ``` -------------------------------- ### Liste noch anstehender terminierten Überweisungen abholen (Fetch List of Pending Scheduled Transfers) Source: https://github.com/hbci4j/hbci4java/blob/master/src/main/java/org/kapott/hbci/GV/package.html Retrieves a list of all pending scheduled transfers. The high-level name is 'TermUebList'. ```APIDOC ## TermUebList (Fetch List of Pending Scheduled Transfers) ### Description Fetches a list of all scheduled transfers that are still pending execution. ### HighLevel-Name `TermUebList` ### Parameters - **my** (Konto) - Optional - The customer's account for which to retrieve the list. If not specified, the first account from the UPD is used. - **startdate** (Date) - Optional - Only retrieve orders scheduled on or after this date. - **enddate** (Date) - Optional - Only retrieve orders scheduled on or before this date. ### Return Value Class [`GVRTermUebList`](../GV_Result/GVRTermUebList.html) ``` -------------------------------- ### HBCI Dialog Execution and Status Check Source: https://github.com/hbci4j/hbci4java/blob/master/src/main/java/org/kapott/hbci/status/package.html This snippet demonstrates how to add a business task, execute an HBCI dialog, and check the overall dialog status and individual job results. It shows how to retrieve error strings if the dialog or a specific job fails. ```Java // initialize HBCI-stuff here ... // add a business task HBCIJob jobSaldo=hbciHandle.newJob("SaldoReq"); jobSaldo.setParam("my",myAccount); hbciHandle.addJob(jobSaldo); // add more business tasks here ... // execute dialog HBCIDialogStatus dialogStatus=hbciHandler.execute(); // print information about complete dialog if (!dialogStatus.isOK()) { System.out.println("some error has occured during execution of the HBCI dialog:"); System.out.println(dialogStatus.getErrorString()); } // check each business task if (jobSaldo.getJobResult().isOK()) { System.out.println("saldo information for account "+myAccount); System.out.println(jobSaldo.getJobResult().toString()); } else { System.out.println("an error occured in task SaldoRequest"); System.out.println(jobSaldo.getJobResult().jobStatus.getErrorString()); } ... ``` -------------------------------- ### Generic Callback Handler in Java Source: https://github.com/hbci4j/hbci4java/blob/master/src/main/java/org/kapott/hbci/callback/package.html This Java code snippet demonstrates a generic `callback()` method that handles various callback scenarios based on the `datatype` and `retData` parameters. It includes logic for text, secret, and boolean inputs, as well as informational messages and actions. ```Java public void callback(HBCIPassport passport,int reason,String msg,int datatype,StringBuffer retData) { try { output(msg); if (datatype!=TYPE_NONE) { switch (datatype) { case TYPE_TEXT: case TYPE_SECRET: // dafuer muss nur die Eingabe durch Sternchen ("*") versteckt werden // Eingabe in Rückgabeobjekt schreiben output("current value: "+retData.toString()); retData.replace(0,retData.length(),readUserInput()); break; case TYPE_BOOLEAN: String input=readUserInput(); // Eingabe von "yes" für den einen Fall (TRUE), // jeder andere Text führt zu dem anderen Fall (FALSE) // siehe dazu Beschreibung von TYPE_BOOLEAN if (input.equals("yes")) retData.replace(0,retData.length(),""); else retData.replace(0,retData.length(),"error"); break; } } else { if (retData!=null) { // auf bestätigung warten waitForConfirmation(); } } } catch (Exception e) { throw new HBCI_Exception("error while handling callback",e); } } ``` -------------------------------- ### Auslandsüberweisung (International Transfer) Source: https://github.com/hbci4j/hbci4java/blob/master/src/main/java/org/kapott/hbci/GV/package.html Allows initiating a simple international transfer to most European countries for amounts not exceeding the legal reporting threshold (currently 12500 EUR). The high-level name is 'UebForeign'. ```APIDOC ## UebForeign (International Transfer) ### Description Enables the initiation of a simple international bank transfer, suitable for most European countries, provided the amount does not exceed the legal reporting threshold (currently 12500 EUR). ### HighLevel-Name `UebForeign` ### Parameters - **src** (Konto) - Mandatory - The customer's debit account. - **src.name** (String) - Mandatory - Name of the account holder. - **dst** (Konto) - Optional - The account where the amount should be credited. Either this parameter or `dst.iban` must be provided. - **dst.iban** (String) - Optional - The IBAN of the destination account. Must be provided if `dst` is not specified. - **dst.name** (String) - Mandatory - Name of the beneficiary. - **dst.kiname** (String) - Mandatory - Full name of the destination bank. - **btg** (Value) - Mandatory - The amount to be transferred. - **usage** (String) - Optional - Purpose of the transfer. ### Return Value Class [`HBCIJobResult`](../GV_Result/HBCIJobResult.html) ``` -------------------------------- ### Generic Status Callback Handler in Java Source: https://github.com/hbci4j/hbci4java/blob/master/src/main/java/org/kapott/hbci/callback/package.html A pragmatic solution for a generic status callback handler that dynamically identifies status constants by name. This approach avoids explicitly listing all possible STATUS_* constants. ```java public void status(HBCIPassport passport,int statusTag,Object[] o) { try { Class cl=this.getClass(); Field[] fields=cl.getFields(); for (int i=0;i