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

Cannot perform $0 Authorization (aka; ZDA, AVS-only) #3

Closed bkeating closed 13 years ago

bkeating commented 13 years ago

NOTE: Please note that your merchant bank may not support $0 Authorizations (such as Paypal). In this case you would need to perform a void transaction type against the authorizations PNREF.

As the title says. I believe this is due to Python t reating 0 as Null but upon further inspection of the code, it doesn't appear to cite the proper

>>> responses, unconsumed_data = client.authorization(credit_card, Amount(amt=0.1, currency="USD"))
>>> print responses[0]
Response: {'authcode': '111111', 'respmsg': 'Approved', 'pnref': 'E34P0BCA60CE', 'result': '0', 'correlationid': '2c9706997458s'}
>>> responses, unconsumed_data = client.authorization(credit_card, Amount(amt=0, currency="USD"))
>>> print responses[0]
Response: {'respmsg': 'Invalid amount', 'pnref': 'E35P0BCA60D4', 'result': '4'}

When I give a value of "0" and print the Amount variable I get:

>>> responses, unconsumed_data = client.authorization(credit_card, Amount(amt=0, currency="USD"))
Amount: {'currency': 'USD'}

So the amount "0" isn't even reaching the authorization class(is it a class or function?)

This has some helpful info https://www.x.com/docs/DOC-1561 Also helpful: Starting on Page 32 of https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_PayflowPro_Guide.pdf

jmurty commented 13 years ago

I have created a pull request with a fix, see issue #4.