1 /***************************************************************************
2 begin : Mon Mar 01 2004
3 copyright : (C) 2019 by Martin Preuss
4 email : martin@libchipcard.de
5
6 ***************************************************************************
7 * Please see toplevel file COPYING for license details *
8 ***************************************************************************/
9
10 #ifdef HAVE_CONFIG_H
11 # include <config.h>
12 #endif
13
14
15 #include "r_download_l.h"
16
17 #include "aqebics/aqebics_l.h"
18 #include "aqebics/msg/msg.h"
19 #include "aqebics/msg/keys.h"
20 #include "aqebics/msg/zip.h"
21 #include "aqebics/msg/xml.h"
22 #include "aqebics/client/user_l.h"
23
24 #include <gwenhywfar/base64.h>
25 #include <gwenhywfar/gui.h>
26 #include <gwenhywfar/httpsession.h>
27
28
29
30
EBC_Provider_XchgDownloadRequest(AB_PROVIDER * pro,GWEN_HTTP_SESSION * sess,AB_USER * u,const char * requestType,GWEN_BUFFER * targetBuffer,int withReceipt,const GWEN_DATE * fromDate,const GWEN_DATE * toDate)31 int EBC_Provider_XchgDownloadRequest(AB_PROVIDER *pro,
32 GWEN_HTTP_SESSION *sess,
33 AB_USER *u,
34 const char *requestType,
35 GWEN_BUFFER *targetBuffer,
36 int withReceipt,
37 const GWEN_DATE *fromDate,
38 const GWEN_DATE *toDate)
39 {
40 const char *s;
41
42 s=EBC_User_GetProtoVersion(u);
43 if (!(s && *s))
44 s="H002";
45 if (strcasecmp(s, "H002")==0)
46 return EBC_Provider_XchgDownloadRequest_H002(pro, sess, u, requestType, targetBuffer,
47 withReceipt,
48 fromDate, toDate);
49 else if (strcasecmp(s, "H003")==0)
50 return EBC_Provider_XchgDownloadRequest_H003(pro, sess, u, requestType, targetBuffer,
51 withReceipt,
52 fromDate, toDate);
53 else {
54 DBG_ERROR(AQEBICS_LOGDOMAIN, "Proto version [%s] not supported", s);
55 return GWEN_ERROR_INTERNAL;
56 }
57 }
58
59
60
61
62
63
64