2004-02-14 Christian Stimming <stimming@tuhh.de>

* configure.in: Require the correct openhbci2 version. Add verbose
	error message for the currently unavailable mt940 support.

	* src/import-export/hbci/hbci-druid-initial.c, gnc-hbci-utils.c:
	Finally finish openhbci2 support, phew. Requires
	openhbci2-1.9beta7 from http://sourceforge.net/projects/openhbci


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9838 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldfeatures/cashutil
Christian Stimming 23 years ago
parent 1a55efe30e
commit c4bc741ceb

@ -1,3 +1,12 @@
2004-02-14 Christian Stimming <stimming@tuhh.de>
* configure.in: Require the correct openhbci2 version. Add verbose
error message for the currently unavailable mt940 support.
* src/import-export/hbci/hbci-druid-initial.c, gnc-hbci-utils.c:
Finally finish openhbci2 support, phew. Requires
openhbci2-1.9beta7 from http://sourceforge.net/projects/openhbci
2004-02-04 Derek Atkins <derek@ihtfp.com>
* src/business/business-core/gncJob.c: Linas checked the wrong

@ -568,6 +568,7 @@ AC_ARG_ENABLE( mt940,
fi)
if test x${MT940_DIR} = xmt940 ;
then
AC_MSG_ERROR([Sorry, MT940 support is currently broken since it depends on the hbci module with the old openhbci 0.9.x library. But the hbci module now has been ported to the new openhbci2 library. The MT940 importer needs to be ported to openhbci2 as well before this can be enabled again.])
AM_PATH_OPENHBCI(0.9.13.2)
# Note: HBCI_LIBS is changed again below in the --enable-hbci
# section. So check for mt940 first and *not* the other way round!
@ -589,7 +590,7 @@ AC_ARG_ENABLE( hbci,
fi)
if test x${HBCI_DIR} = xhbci ;
then
AM_PATH_OPENHBCI2(1.9.0.1)
AM_PATH_OPENHBCI2(1.9.0.8)
#all_libraries="$all_libraries $OPENHBCI_LIBS"
#all_includes="$all_includes $OPENHBCI_CXXFLAGS"
#AM_PATH_OPENHBCI(0.9.13)

@ -1102,18 +1102,78 @@ on_accountinfo_next (GnomeDruidPage *gnomedruidpage,
{
HBCI_OutboxJob *job;
/* FIXME: Only do this sync job if this is a rdh medium. */
/* Execute a Synchronize job, then a GetAccounts job. */
/*job = HBCI_OutboxJob_new("JobSync",
(HBCI_Customer *)info->newcustomer, "");
HBCI_Outbox_addJob (info->outbox, job);*/
job = HBCI_OutboxJob_new("JobSync",
(HBCI_Customer *)info->newcustomer, "");
HBCI_Outbox_addJob (info->outbox, job);
{
HBCI_Job *jjob = HBCI_OutboxJob_Job(job);
HBCI_Job_setIntProperty
(jjob, "open/ident/country",
HBCI_Bank_country(HBCI_User_bank
(HBCI_Customer_user(info->newcustomer))));
HBCI_Job_setProperty
(jjob, "open/ident/bankcode",
HBCI_Bank_bankCode(HBCI_User_bank
(HBCI_Customer_user(info->newcustomer))));
HBCI_Job_setProperty
(jjob, "open/ident/customerid", HBCI_Customer_custId(info->newcustomer));
/* for getting a system id */
HBCI_Job_setIntProperty(jjob, "open/sync/mode",0);
HBCI_Job_setProperty(jjob, "open/ident/systemid", "0");
}
/* Execute Outbox. */
/*if (!gnc_hbci_api_execute (info->window, info->api, info->outbox,
job, info->interactor)) {*/
/* HBCI_API_executeOutbox failed. */
/*return FALSE;*/
/* -- it seems to be no problem if this fails ?! */
/*}*/
if (!gnc_hbci_api_execute (info->window, info->api, info->outbox,
job, info->interactor)) {
/* HBCI_API_executeOutbox failed. */
GWEN_DB_NODE *rsp = HBCI_Outbox_response(info->outbox);
printf("on_accountinfo_next: oops, executeOutbox of JobSync failed.\n");
printf("on_accountinfo_next: Complete HBCI_Outbox response:\n");
GWEN_DB_Dump(rsp, stdout, 1);
GWEN_DB_Group_free(rsp);
rsp = HBCI_Job_responseData(HBCI_OutboxJob_Job(job));
printf("on_accountinfo_next: Complete HBCI_Job response:\n");
if (rsp)
GWEN_DB_Dump(rsp, stderr, 1);
/*return FALSE;*/
/* -- it seems to be no problem if this fails ?! */
}
/* Now process the response of the JobSync */
{
const char *sysid =
HBCI_Job_getProperty(HBCI_OutboxJob_Job(job),
"response/syncresponse/systemid", "");
g_assert(sysid);
if (strlen(sysid) > 0) {
HBCI_User_setSystemId((HBCI_User*) HBCI_Customer_user(info->newcustomer), sysid);
printf("on_accountinfo_next: Ok. Got sysid '%s'.\n", sysid);
}
else {
/* Got no sysid. */
GWEN_DB_NODE *rsp = HBCI_Outbox_response(info->outbox);
printf("on_accountinfo_next: oops, got no sysid.\n");
printf("on_accountinfo_next: Complete HBCI_Outbox response:\n");
GWEN_DB_Dump(rsp, stdout, 1);
GWEN_DB_Group_free(rsp);
rsp = HBCI_Job_responseData(HBCI_OutboxJob_Job(job));
printf("on_accountinfo_next: Complete HBCI_Job response:\n");
if (rsp)
GWEN_DB_Dump(rsp, stderr, 1);
return FALSE;
}
}
/* Now the GetAccounts job. */
job = HBCI_OutboxJob_new("JobGetAccounts",
@ -1121,6 +1181,7 @@ on_accountinfo_next (GnomeDruidPage *gnomedruidpage,
HBCI_Outbox_addJob (info->outbox, job);
{
char *mediumid;
HBCI_Job *jjob = HBCI_OutboxJob_Job(job);
HBCI_Job_setIntProperty
(jjob, "open/ident/country",
@ -1133,6 +1194,15 @@ on_accountinfo_next (GnomeDruidPage *gnomedruidpage,
HBCI_Job_setProperty
(jjob, "open/ident/customerid", HBCI_Customer_custId(info->newcustomer));
HBCI_Job_setIntProperty(jjob, "open/prepare/updversion",0);
/* FIXME: Only set this for RDH medium */
mediumid = HBCI_Medium_mediumId((HBCI_Medium *)HBCI_User_medium(HBCI_Customer_user(info->newcustomer)));
g_assert(mediumid);
if (strlen(mediumid)==0)
HBCI_Job_setProperty(jjob, "open/ident/systemId", "0");
else
HBCI_Job_setProperty(jjob, "open/ident/systemId", mediumid);
free(mediumid);
}
@ -1140,7 +1210,20 @@ on_accountinfo_next (GnomeDruidPage *gnomedruidpage,
if (!gnc_hbci_api_execute (info->window, info->api, info->outbox,
job, info->interactor)) {
/* HBCI_API_executeOutbox failed. */
printf("on_accountinfo_next: oops, executeOutbox failed.\n");
GWEN_DB_NODE *rsp = HBCI_Outbox_response(info->outbox);
printf("on_accountinfo_next: oops, executeOutbox of JobGetAccounts failed.\n");
printf("on_accountinfo_next: Complete HBCI_Outbox response:\n");
GWEN_DB_Dump(rsp, stdout, 1);
GWEN_DB_Group_free(rsp);
rsp = HBCI_Job_responseData(HBCI_OutboxJob_Job(job));
printf("on_accountinfo_next: Complete HBCI_Job response:\n");
if (rsp)
GWEN_DB_Dump(rsp, stderr, 1);
/* And clean everything up */
HBCI_Outbox_removeByStatus (info->outbox, HBCI_JOB_STATUS_NONE);
return FALSE;
}
@ -1299,6 +1382,20 @@ on_iniletter_info_next (GnomeDruidPage *gnomedruidpage,
if (!gnc_hbci_api_execute (info->window, info->api, info->outbox,
job, info->interactor)) {
/* HBCI_API_executeOutbox failed. */
GWEN_DB_NODE *rsp = HBCI_Outbox_response(info->outbox);
printf("on_iniletter_info_next: oops, executeOutbox failed.\n");
printf("Complete HBCI_Outbox response:\n");
GWEN_DB_Dump(rsp, stdout, 1);
GWEN_DB_Group_free(rsp);
rsp = HBCI_Job_responseData(HBCI_OutboxJob_Job(job));
printf("Complete HBCI_Job response:\n");
if (rsp)
GWEN_DB_Dump(rsp, stderr, 1);
/* And clean everything up */
HBCI_Outbox_removeByStatus (info->outbox, HBCI_JOB_STATUS_NONE);
return FALSE;
}
@ -1314,6 +1411,9 @@ on_iniletter_info_next (GnomeDruidPage *gnomedruidpage,
}
else if (info->gotkeysforCustomer != info->newcustomer) {
printf("on_iniletter_info_next: Oops, already got keys for another customer. Not yet implemented.\n");
/* And clean everything up */
HBCI_Outbox_removeByStatus (info->outbox, HBCI_JOB_STATUS_NONE);
return TRUE;
}
@ -1482,8 +1582,34 @@ on_iniletter_userinfo_next (GnomeDruidPage *gnomedruidpage,
if (!gnc_hbci_api_execute (info->window, info->api, info->outbox,
job, info->interactor)) {
/* HBCI_API_executeOutbox failed. */
GWEN_DB_NODE *rsp = HBCI_Outbox_response(info->outbox);
printf("on_iniletter_userinfo_next: Oops, api_execute failed.\n");
printf("on_iniletter_userinfo_next: Complete HBCI_Outbox response:\n");
GWEN_DB_Dump(rsp, stdout, 1);
GWEN_DB_Group_free(rsp);
rsp = HBCI_Job_responseData(HBCI_OutboxJob_Job(job));
printf("on_iniletter_userinfo_next: Complete HBCI_Job response:\n");
if (rsp)
GWEN_DB_Dump(rsp, stderr, 1);
/* And clean everything up */
HBCI_Outbox_removeByStatus (info->outbox, HBCI_JOB_STATUS_NONE);
return FALSE;
}
{
GWEN_DB_NODE *rsp = HBCI_Outbox_response(info->outbox);
printf("on_iniletter_userinfo_next: Complete HBCI_Outbox response:\n");
GWEN_DB_Dump(rsp, stdout, 1);
GWEN_DB_Group_free(rsp);
rsp = HBCI_Job_responseData(HBCI_OutboxJob_Job(job));
printf("on_iniletter_userinfo_next: Complete HBCI_Job response:\n");
if (rsp)
GWEN_DB_Dump(rsp, stderr, 1);
}
HBCI_Outbox_removeByStatus (info->outbox, HBCI_JOB_STATUS_NONE);
}

@ -1404,7 +1404,8 @@ before this whole druid has finished.</label>
<widget>
<class>GtkLabel</class>
<name>label8477411</name>
<label>Do these values match the values on your paper Ini-Letter?</label>
<label>Do these values match the values on your paper Ini-Letter?
(If you cannot see anything, press the 'Print' button.)</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
@ -1576,7 +1577,8 @@ connection in the HBCI connection window.</label>
<widget>
<class>GtkLabel</class>
<name>label8477345</name>
<label>This is the Ini-Letter of you, the user. Please print out a paper copy
<label>This is the Ini-Letter of you, the user. (If you cannot see anything, please
press the 'Print' button.) Please print out a paper copy
by pressing 'Print'. Then press 'Next'.</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>

@ -455,6 +455,57 @@ gnc_hbci_error_retry (GtkWidget *parent, HBCI_Error *error,
}
/* Prints all results that can be found in the outbox into the interactor */
static void gnc_hbci_printresult(HBCI_Outbox *outbox, GNCInteractor *inter)
{
/* Got no sysid. */
GWEN_DB_NODE *rsp, *n;
g_assert(outbox);
if (!inter)
return;
rsp = HBCI_Outbox_response(outbox);
n = GWEN_DB_GetFirstGroup(rsp);
while(n) {
if (strcasecmp(GWEN_DB_GroupName(n), "msgresult")==0) {
GWEN_DB_NODE *r = GWEN_DB_GetFirstGroup(n);
while (r) {
if (strcasecmp(GWEN_DB_GroupName(r), "result") == 0) {
gchar *logtext;
int resultcode;
const char *text, *elementref, *param;
resultcode = GWEN_DB_GetIntValue(r, "resultcode", 0, 0);
text = GWEN_DB_GetCharValue(r, "text", 0, "Response without text");
elementref = GWEN_DB_GetCharValue(r, "elementref", 0, "");
param = GWEN_DB_GetCharValue(r, "param", 0, "");
if (strlen(elementref)>0 || strlen(param) > 0)
logtext = g_strdup_printf("%s (%d; Elementref %s; Param %s)", text,
resultcode, elementref, param);
else
logtext = g_strdup_printf("%s (%d)", text, resultcode);
GNCInteractor_add_log_text(inter, logtext);
g_free(logtext);
}
r = GWEN_DB_GetNextGroup(r);
}
}
else if (strcasecmp(GWEN_DB_GroupName(n), "segresult")==0) {
GWEN_DB_NODE *r = GWEN_DB_GetFirstGroup(n);
while (r) {
if (strcasecmp(GWEN_DB_GroupName(r), "result") == 0) {
}
r = GWEN_DB_GetNextGroup(r);
}
}
n=GWEN_DB_GetNextGroup(n);
} // while
GWEN_DB_Group_free(rsp);
}
gboolean
gnc_hbci_api_execute (GtkWidget *parent, HBCI_API *api,
HBCI_Outbox *queue,
@ -479,6 +530,10 @@ gnc_hbci_api_execute (GtkWidget *parent, HBCI_API *api,
GNCInteractor_show_nodelete (inter);
err = HBCI_API_executeQueue (api, queue);
g_assert (err);
/* Print result codes to interactor */
gnc_hbci_printresult(queue, inter);
} while (gnc_hbci_error_retry (parent, err, inter));
resultcode = gnc_hbci_debug_outboxjob (job, FALSE);

@ -470,7 +470,7 @@ static int msgInsertCorrectMediumOrAbort(const HBCI_User *user,
GNCInteractor *data = user_data;
g_assert(data);
add_log_text (data, msg);
GNCInteractor_add_log_text (data, msg);
while (g_main_iteration (FALSE));
}*/
@ -689,13 +689,13 @@ static void logMsg (const char *msg, void *user_data)
g_assert(data);
printf("logMsg: Logging msg: %s\n", msg);
add_log_text (data, msg);
GNCInteractor_add_log_text (data, msg);
/* Let the widgets be redrawn */
while (g_main_iteration (FALSE));
}
void add_log_text (GNCInteractor *data, const char *msg)
void GNCInteractor_add_log_text (GNCInteractor *data, const char *msg)
{
int pos;
g_assert(data);

@ -40,6 +40,7 @@ void GNCInteractor_erasePIN(GNCInteractor *i);
void GNCInteractor_reparent (GNCInteractor *i, GtkWidget *new_parent);
void GNCInteractor_set_cache_valid(GNCInteractor *i, gboolean value);
GtkWidget *GNCInteractor_parent(GNCInteractor *i);
void GNCInteractor_add_log_text (GNCInteractor *i, const char *msg);
#endif

@ -85,8 +85,4 @@ void delete_GNCInteractor (GNCInteractor *data);
HBCI_Interactor *
gnc_hbci_new_interactor(GNCInteractor *data);
void add_log_text (GNCInteractor *data, const char *msg);
#endif

Loading…
Cancel
Save