Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Discover Card 403 by manually ordering HTTP headers #37

Merged
merged 2 commits into from Apr 21, 2017

Conversation

Projects
None yet
4 participants
@fanqiuwen
Copy link
Contributor

commented Mar 5, 2017

Since mid February Discover Card has been giving 403 Permission Denied for OFX requests that previously worked. It was discovered on OFX Home Forum that Discover now requires a particular set of HTTP headers ordered in a particular way. This PR implements the fix.

@jantman

This comment has been minimized.

Copy link
Contributor

commented Mar 7, 2017

I can confirm that this fix works for me, though I'm still hitting #15 unless I add a sleep to cli.py.

@albaguirre

This comment has been minimized.

Copy link

commented Mar 16, 2017

Umm this didn't work for me. Still getting 403s.

@fanqiuwen

This comment has been minimized.

Copy link
Contributor Author

commented Mar 17, 2017

@albaguirre The fix is still working for me.

I'm using ofxclient as a Python library, not a cli tool. For reference, here's a minimal version of my script that downloads Discover transactions successfully, given the changes in this PR.

from ofxclient import Institution, CreditCardAccount
discover_args = {
    'id': '7101',
    'org': 'Discover Financial Services',
    'url': 'https://ofx.discovercard.com',
    'username': 'SECRET',
    'password': 'SECRET',
    'client_args': {
        'app_id': 'QWIN',
        'app_version': '2200',
        'ofx_version': '102'
        }
    }
discover = CreditCardAccount(institution=Institution(**discover_args),
                             number='SECRET')
for tran in discover.transactions():
    print(tran.payee, tran.amount)

If this works for you and the cli doesn't, then it would be a separate issue.

@albaguirre

This comment has been minimized.

Copy link

commented Mar 17, 2017

@fanqiuwen Huh that snippet does indeed work. But CLI doesn't ... interesting.

@captin411 captin411 merged commit 7829515 into captin411:master Apr 21, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jantman

This comment has been minimized.

Copy link
Contributor

commented Apr 22, 2017

Cool, thank you so much for merging! Any chance we could get a release uploaded to PyPI?

@captin411

This comment has been minimized.

Copy link
Owner

commented Apr 22, 2017

jantman added a commit to jantman/biweeklybudget that referenced this pull request May 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.