Skip to main content

README.md

PayPal Easy

A simplified, developer-friendly wrapper around PayPal's Python Server SDK.

Why PayPal Easy?

PayPal's official Python SDK can be challenging to work with due to:

  • Missing or inconsistent class imports
  • Complex parameter structures
  • Inconsistent documentation
  • Verbose API calls

PayPal Easy solves these problems by providing:

  • ✅ Clean, consistent API
  • ✅ Proper error handling
  • ✅ Type hints and IDE support
  • ✅ Simplified method signatures
  • ✅ Django integration helpers

Demo

Here is a sample Django project that implements paypal-easy

https://github.com/doculearn/paypal-easy-demo

Video Walkthrough

Watch on Youtube

Installation

pip install paypal-easy

Quick Start

from paypal_easy import PayPalEasyClient, Environment, Currency
from decimal import Decimal

# Initialize client
client = PayPalEasyClient(
    client_id="your_client_id",
    client_secret="your_client_secret",
    environment=Environment.SANDBOX
)

# Create an order
result = client.create_order(
    amount=Decimal("29.99"),
    currency=Currency.USD,
    description="Premium subscription",
    return_url="https://yoursite.com/success",
    cancel_url="https://yoursite.com/cancel"
)

if hasattr(result, 'id'):  # Success
    print(f"Order created: {result.id}")
    print(f"Approval URL: {result.approval_url}")
else:  # Error
    print(f"Error: {result.message}")

Django Integration

# views.py
from paypal_easy.django_integration import PayPalEasyDjangoMixin
from django.views import View

class CreatePaymentView(PayPalEasyDjangoMixin, View):
    def post(self, request):
        client = self.get_paypal_client()
        
        result = client.create_order(
            amount=request.POST.get('amount'),
            description="Order payment"
        )
        
        if hasattr(result, 'id'):
            return self.paypal_success_response(result)
        else:
            return self.paypal_error_response(result)

Features

  • Simple Order Creation: Create orders with minimal code
  • Automatic URL Handling: Easy approval flow setup
  • Error Handling: Consistent error responses
  • Django Integration: Ready-to-use Django mixins
  • Type Safety: Full type hints for better IDE support
  • Logging: Built-in logging for debugging

Comparison

Before (Official SDK)

from paypalserversdk.paypal_serversdk_client import PaypalServersdkClient
from paypalserversdk.configuration import Environment
from paypalserversdk.http.auth.o_auth_2 import ClientCredentialsAuthCredentials
from paypalserversdk.models.order_request import OrderRequest

credentials = ClientCredentialsAuthCredentials(
    o_auth_client_id=client_id,
    o_auth_client_secret=client_secret
)

client = PaypalServersdkClient(
    environment=Environment.SANDBOX,
    client_credentials_auth_credentials=credentials
)

order_request = OrderRequest({
    "intent": "CAPTURE",
    "purchase_units": [{
        "amount": {
            "currency_code": "USD", 
            "value": "29.99"
        }
    }]
})

response = client.orders.create_order({'body': order_request})

After (PayPal Easy)

from paypal_easy import PayPalEasyClient, Environment, Currency

client = PayPalEasyClient(client_id, client_secret, Environment.SANDBOX)
result = client.create_order(amount="29.99", currency=Currency.USD)

Contributing

Contributions welcome! Please feel free to submit issues and enhancement requests.

Donations

Would you like to support the work we do?

Click Here to Donate - Donate Link

License

MIT License - see LICENSE file for details.

Maintainers

William Mabotja - Portfolio Site

Metadata

Release files for paypal-easy 0.1.8

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

Source distribution (sdist)

Source distribution for paypal-easy 0.1.8
File Size Uploaded
paypal_easy-0.1.8.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for paypal-easy 0.1.8
File Interpreter ABI Platform
paypal_easy-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 18.8 kB

Release files / paypal_easy-0.1.8.tar.gz

Download URL paypal_easy-0.1.8.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
af075eb2fc02da802eb5c438587984698d48da85022619045b320fa1222c1ee4
BLAKE2b-256 checksum
How to use checksums
ee31d17f6441d9507a217ac2fc276ba07db9bf811601be4aaaa23ed4887fd831
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / paypal_easy-0.1.8-py3-none-any.whl

Download URL paypal_easy-0.1.8-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d84d5efd7393f0da132a0487ba84779490cfdd0b899263f783133c7cf4cc039f
BLAKE2b-256 checksum
How to use checksums
5b130dac435e56662ab5a9b14cb6be3f6be7b967f1f2f1914bed2d6a0b198bb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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