paypal python包不能正常工作,所有测试都返回错误代码-1

时间:2012-12-28 04:35:22

标签: python paypal paypal-sandbox

以下是我的工作,paypal-python git repo是https://github.com/duointeractive/paypal-python

创建虚拟环境 pip安装paypal pip安装鼻子

在site-packages / paypal目录中,将tests目录复制到其中。

cp api_details_blank.py api_details.py

填写我的api_user_name,密码,签名和客户的信用帐户信息

nosetests tests /

在这之后,我得到的只是

...EEE.E...
======================================================================
ERROR: test_abbreviated_sale (paypal.tests.test_direct_payment.TestDirectPayment)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/binleixue/Envs/tradeplatform/lib/python2.7/site-packages/paypal/tests/test_direct_payment.py", line 51, in test_abbreviated_sale
    sale = interface.do_direct_payment(**self.credit_card)
  File "/Users/binleixue/Envs/tradeplatform/lib/python2.7/site-packages/paypal/interface.py", line 270, in do_direct_payment
    return self._call('DoDirectPayment', **kwargs)
  File "/Users/binleixue/Envs/tradeplatform/lib/python2.7/site-packages/paypal/interface.py", line 125, in _call
    raise PayPalAPIResponseError(response)
PayPalAPIResponseError: None (Error Code: -1)


ERROR: test_authorize_and_delayed_capture (paypal.tests.test_direct_payment.TestDirectPayment)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/binleixue/Envs/tradeplatform/lib/python2.7/site-packages/paypal/tests/test_direct_payment.py", line 61, in test_authorize_and_delayed_capture
    auth = interface.do_direct_payment('Authorization', **self.credit_card)
  File "/Users/binleixue/Envs/tradeplatform/lib/python2.7/site-packages/paypal/interface.py", line 270, in do_direct_payment
    return self._call('DoDirectPayment', **kwargs)
  File "/Users/binleixue/Envs/tradeplatform/lib/python2.7/site-packages/paypal/interface.py", line 125, in _call
    raise PayPalAPIResponseError(response)
PayPalAPIResponseError: None (Error Code: -1)

======================================================================
ERROR: test_authorize_and_void (paypal.tests.test_direct_payment.TestDirectPayment)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/binleixue/Envs/tradeplatform/lib/python2.7/site-packages/paypal/tests/test_direct_payment.py", line 74, in test_authorize_and_void
    auth = interface.do_direct_payment('Authorization', **self.credit_card)
  File "/Users/binleixue/Envs/tradeplatform/lib/python2.7/site-packages/paypal/interface.py", line 270, in do_direct_payment
    return self._call('DoDirectPayment', **kwargs)
  File "/Users/binleixue/Envs/tradeplatform/lib/python2.7/site-packages/paypal/interface.py", line 125, in _call
    raise PayPalAPIResponseError(response)
PayPalAPIResponseError: None (Error Code: -1)

======================================================================
ERROR: test_sale (paypal.tests.test_direct_payment.TestDirectPayment)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/binleixue/Envs/tradeplatform/lib/python2.7/site-packages/paypal/tests/test_direct_payment.py", line 30, in test_sale
    sale = interface.do_direct_payment('Sale', **self.credit_card)
  File "/Users/binleixue/Envs/tradeplatform/lib/python2.7/site-packages/paypal/interface.py", line 270, in do_direct_payment
    return self._call('DoDirectPayment', **kwargs)
  File "/Users/binleixue/Envs/tradeplatform/lib/python2.7/site-packages/paypal/interface.py", line 125, in _call
    raise PayPalAPIResponseError(response)
PayPalAPIResponseError: None (Error Code: -1)

----------------------------------------------------------------------
Ran 11 tests in 23.885s

FAILED (errors=4)

有人知道如何处理吗?

1 个答案:

答案 0 :(得分:0)

如果您仍然卡住,我创建PayLib作为PayPal Express Checkout上方的简单抽象,用于定期付款。自述文件中的示例代码也在PyPI上。