[Kmymoney-devel] libOFX question (relates to recent OFX failures with Chase credit card downloads)

Thomas Baumgart thb at net-bembel.de
Fri Dec 11 18:44:21 UTC 2015


Hi Jeff,

in general this looks very promising. Since this (partially) has to go into 
libofx, we need to check at compile time if we have the required libofx 
version available before we use this feature. A few more notes inline.

On Friday 11 December 2015 13:53:07 jeffjl.kde at outlook.com wrote:

> > 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);

Maybe this is only needed for Windows. Have not checked under Linux.

> 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");

When loading the edit field in the dialog from m_fiSettings, and this value is 
empty/not present, then preset it with the data returned by

MyMoneyFile::instance()-
>storageId().remove(QLatin1String("{")).remove(QLatin1String("}"));

which should return the unique ID of the file without the curly braces.

-- 

Regards

Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
Embedded Linux: because you can't do control-alt-delete on a pacemaker.
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 225 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20151211/71124d58/attachment.sig>


More information about the KMyMoney-devel mailing list