Skip to main content

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.

  1. 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 .
    
  2. 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;
     }
    
  3. 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
    
  4. 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.

Metadata

Release files for paypal2 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for paypal2 0.5.0
File Size Uploaded
paypal2-0.5.0.tar.gz 22.2 kB Details

Release files / paypal2-0.5.0.tar.gz

Download URL paypal2-0.5.0.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
521a90fe1080edec231a095815ccc45f7b3e47749c214085710103c5f95556b9
BLAKE2b-256 checksum
How to use checksums
14ec5be901a1bae1347c65c71681bcf2b5382ca67551cc857d255f68b33d1886
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.5.0 This release

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page