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

@fanqiuwen
Copy link
Contributor

@fanqiuwen fanqiuwen 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
Copy link
Contributor

@jantman jantman 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.

Loading

@albaguirre
Copy link

@albaguirre albaguirre commented Mar 16, 2017

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

Loading

@fanqiuwen
Copy link
Contributor Author

@fanqiuwen fanqiuwen 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.

Loading

@albaguirre
Copy link

@albaguirre albaguirre commented Mar 17, 2017

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

Loading

@captin411 captin411 merged commit 7829515 into captin411:master Apr 21, 2017
1 check passed
Loading
@jantman
Copy link
Contributor

@jantman jantman commented Apr 22, 2017

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

Loading

@captin411
Copy link
Owner

@captin411 captin411 commented Apr 22, 2017

Loading

jantman added a commit to jantman/biweeklybudget that referenced this issue May 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants