0

这是我所做的,paypal-python git repo 是https://github.com/duointeractive/paypal-python

创建一个虚拟环境 pip install paypal pip install nose

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

cp api_details_blank.py api_details.py

填写我的 api_user_name、密码、签名和客户的信用账户信息

鼻子测试测试/

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

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

有人知道如何处理吗?

4

1 回答 1

0

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

于 2013-01-06T23:46:32.900 回答