bkeating / python-payflowpro

A simple Python client for PayPal's Payflow Pro API (HTTPS Interface).
https://www.paypal.com/us/webapps/mpp/payflow-payment-gateway
Apache License 2.0
47 stars 22 forks source link

KeyError for Old Transactions in Recurring Profiles #12

Open scoopseven opened 10 years ago

scoopseven commented 10 years ago

When querying recurring profiles that have old transactions the parse_parameters def (line 354) throws a KeyError, as not all data is returned. Below is an example of unconsumed data returned while providing "payment_history_only=True" to the PayPal client. p_transtate and p_amt are missing from transactions prior to 2013.

I can patch this if necessary, let me know.

Mark

unconsumed_data: { 'p_transtate4': '8', 'p_transtime4': '25-Jan-13 06:13 AM', 'p_result4': '0', 'p_tender4': 'C', 'p_amt4': '39.00' 'p_pnref4': 'VU...',

'p_result1': '0', 'p_transtime1': '25-Jan-10 05:44 AM', 'p_tender1': 'C', 'p_pnref1': 'VU...',

'p_transtime2': '25-Jan-11 06:06 AM', 'p_result2': '0', 'p_tender2': 'C', 'p_pnref2': 'VP...',

'p_transtime3': '25-Jan-12 06:39 AM', 'p_result3': '0', 'p_tender3': 'C', 'p_pnref3': 'VD...', }

bkeating commented 10 years ago

Thanks for taking the time to report this. I haven't had time this week to look into it myself, but wanted to give a holler that it's on my list.