Opinionated asyncio Paypal server-side integration SDK
Project description
paypal2
Opinionated asyncio Python server-side integration SDK for PayPal.
Status
WIP
Testing
Complete testing requires deploying the repository on a server behind an SSL reverse-proxy, so the web-hook notifications can be used in sandbox.
-
Installing repo revision in a virtualenv example ("d$" denotes shell on the dev host "r$" is the remote-server host)
d$ git archive -o paypal2.tgz HEAD d$ scp paypal2.tgz remote: r$ python3.10 -m venv .paypal2-venv r$ source .paypal2-venv/bin/activate r$ mkdir paypal2 && cd paypal2 && tar -xf ../paypal2.tgz r$ pip install wheel r$ pip install -r requirements/test.txt r$ pip install --no-deps -e .
-
Setting up a temporary endpoint on an existing domain for testing using nginx. Add the following location snippet to a suitable server. The path prefix may need adjustment, and basic HTTP authentication can be added for safety, although no secret shall be revealed by the dev-api and it may only interface with the sandbox environment. Check the config and reload your nginx as you like.
location ~ ^/paypal2-dbg/(.*) { proxy_set_header X-Real-IP $remote_addr; proxy_pass http://127.0.0.1:8001/$1; proxy_read_timeout 120s; # ensure no caching for dev expires -1; add_header Cache-Control no-store; }
-
Run the dev server with the following script. Some values need adjustment, and you may want to do this in a screen session for convenience.
source .paypal2-venv/bin/activate cd paypal2 export ALLOW_TESTS_IMPORT=1 export PAYPAL2_TESTING_SERVER_RUN=1 export PAYPAL2_TESTING_SERVER_ROOT_PATH=/paypal2-dbg export PAYPAL2_TESTING_WEBHOOK_PROCESSOR=ABSTRACT export PAYPAL2_TESTING_CLIENT_ID=<YOUR-SANDBOX-APP-ID> export PAYPAL2_TESTING_CLIENT_SECRET=<YOUR-SANDBOX-APP-SECRET> export PAYPAL2_TESTING_WEBHOOK_ID=<YOUR-SANDBOX-WEBHOOK-ID> python -m pytest -vv -s -x -k test_run > ./run.log 2>&1
-
If everything is set up correctly, visiting https:///paypal2-dbg/ will display the dev index where basic order and subscription functionality can be tested along with the relevant webhook notifications if that is configured as well.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file paypal2-0.2.2.tar.gz
.
File metadata
- Download URL: paypal2-0.2.2.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8e538bfbcb79cc73eda67c041baf4216e5863d00f10051b755de790406bd7b5 |
|
MD5 | 694606862dd623c281b14612f287264b |
|
BLAKE2b-256 | 83ffd40a73df31e4ded3fb16ef9e9532f020678dff9759959fa532f82a583852 |