PayPal Python软件包不起作用,所有测试都返回错误代码-1



这是我要做的,而PayPal-Python Git Repo是https://github.com/duoointeractive/paypal-python

创建一个虚拟envPIP安装PayPalPIP安装鼻子

在网站包装/贝宝目录中,将测试目录复制到其中。

cp api_details_blank.py api_details.py

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

nosetests测试/

这样做之后,我得到的就是

...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)

有人知道如何处理吗?

如果您仍然卡住,我将Paylib创建为PayPal Express Checkout上方的简单抽象,以进行重复付款。读书中的示例代码,它也在PYPI上。

相关内容

  • 没有找到相关文章

最新更新