[Kmymoney-devel] libOFX question (relates to recent OFX failures with Chase credit card downloads)
jeffjl.kde at outlook.com
jeffjl.kde at outlook.com
Fri Dec 11 13:53:07 UTC 2015
> against which version of libOFX did you apply the patch?
"http://downloads.sourceforge.net/project/libofx/libofx/0.9.10/libofx-0.9.10.tar.gz"
Just changed time.tm_isdst as follows:
--- libofx-0.9.10.orig\lib\ofx_utilities.cpp 2015-11-07 10:06:17.446846600 -0600
+++ libofx-0.9.10\lib\ofx_utilities.cpp 2015-11-07 16:58:40.645096200 -0600
@@ -116,7 +116,7 @@
string ofxdate_whole;
time_t temptime;
- time.tm_isdst = daylight; // initialize dst setting
+ time.tm_isdst = -1; //mktime will figure out daylight savings based on locale
std::time(&temptime);
local_offset = difftime(mktime(localtime(&temptime)), mktime(gmtime(&temptime))) + (3600 * daylight);
I am building on Windows 8.1 with mingw, gcc version 4.8.2. The handling of tm_isdst by mktime apparently has a checkered past, so I only know that this fixed my problem on Windows when DST was not in effect.
While I'm at it, here's the <CLIENTUID> change:
--- libofx-0.9.10.orig\lib\ofx_request.cpp 2015-11-29 11:30:54.119081400 -0600
+++ libofx-0.9.10\lib\ofx_request.cpp 2015-11-29 11:28:46.128634400 -0600
@@ -103,6 +103,9 @@
else
sonrqTag.Add( "APPVER", "1400");
+ if ( strlen(m_login.clientuid) > 0 )
+ sonrqTag.Add( "CLIENTUID", m_login.clientuid);
+
OfxAggregate signonmsgTag("SIGNONMSGSRQV1");
signonmsgTag.Add( sonrqTag );
where m_login.clientuid needs to be added to libofx.h. My libofx.h currently has a bunch of other changes so my patch line numbers won't match, but the changes there are:
@@ -90,6 +90,7 @@
#define OFX_APPID_LENGTH (32)
#define OFX_APPVER_LENGTH (32)
#define OFX_HEADERVERSION_LENGTH (32)
+#define OFX_CLIENTUID_LENGTH (36 + 1)
@@ -811,6 +937,7 @@
char header_version[OFX_HEADERVERSION_LENGTH];
char appid[OFX_APPID_LENGTH];
char appver[OFX_APPVER_LENGTH];
+ char clientuid[OFX_CLIENTUID_LENGTH];
};
Then I have KMM set the OfxFiLogin.clientuid. Snippet (not a diff) from mymoneyofxconnector.cpp:
void MyMoneyOfxConnector::initRequest(OfxFiLogin* fi) const
{
memset(fi, 0, sizeof(OfxFiLogin));
strncpy(fi->fid, fiid().toLatin1(), OFX_FID_LENGTH - 1);
strncpy(fi->org, fiorg().toLatin1(), OFX_ORG_LENGTH - 1);
strncpy(fi->clientuid, clientUid().toLatin1(), OFX_CLIENTUID_LENGTH - 1);
strncpy(fi->userid, username().toLatin1(), OFX_USERID_LENGTH - 1);
strncpy(fi->userpass, password().toLatin1(), OFX_USERPASS_LENGTH - 1);
where the clientUid comes from the new edit box I added in the OFX Details dialog and stored as m_fiSettings.value("clientUid");
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20151211/e888d244/attachment.html>
More information about the KMyMoney-devel
mailing list