0

Following the official Paymentwall documentation testing the API, I tried the code below to import the library (exactly the same code as in the doc example):

from paymentwall import *
Paymentwall.set_api_type(Paymentwall.API_GOODS)
......

But it throws the following import error:

Traceback (most recent call last):
  File "/Users/username/project/app/paymentwall.py", line 1, in <module>
    from paymentwall import *
  File "/Users/username/project/app/paymentwall.py", line 4, in <module>
    Paymentwall.set_api_type(Paymentwall.API_GOODS)
NameError: name 'Paymentwall' is not defined

I have paymentwall-python 1.0.7 and Python 3.5.4 in the same conda virtual environment.

Any ideas? They tech support is incredibly slow.

Zilong Li
  • 889
  • 10
  • 23

1 Answers1

0

This seems to work:

>>> from paymentwall.base import *
>>> Paymentwall.set_api_type(Paymentwall.API_GOODS)

perhaps the project's structure has changed, but the docs haven't been kept up to date.

snakecharmerb
  • 47,570
  • 11
  • 100
  • 153