{"id":25363797,"url":"https://github.com/dinoperovic/django-salesman-paypal","last_synced_at":"2025-06-15T12:35:31.076Z","repository":{"id":50705018,"uuid":"473628830","full_name":"dinoperovic/django-salesman-paypal","owner":"dinoperovic","description":"PayPal payment integration for Salesman.","archived":false,"fork":false,"pushed_at":"2023-02-23T16:23:40.000Z","size":69,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-21T02:20:05.682Z","etag":null,"topics":["django","e-commerce","paypal","paypal-rest-api","salesman","shop","wagtail"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dinoperovic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-24T13:57:04.000Z","updated_at":"2025-04-17T08:36:14.000Z","dependencies_parsed_at":"2025-02-14T22:38:59.397Z","dependency_job_id":"54015ac0-c728-4f41-bd3f-6f8d4d552391","html_url":"https://github.com/dinoperovic/django-salesman-paypal","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/dinoperovic/django-salesman-paypal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinoperovic%2Fdjango-salesman-paypal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinoperovic%2Fdjango-salesman-paypal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinoperovic%2Fdjango-salesman-paypal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinoperovic%2Fdjango-salesman-paypal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dinoperovic","download_url":"https://codeload.github.com/dinoperovic/django-salesman-paypal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinoperovic%2Fdjango-salesman-paypal/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259977447,"owners_count":22941112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","e-commerce","paypal","paypal-rest-api","salesman","shop","wagtail"],"created_at":"2025-02-14T22:38:49.335Z","updated_at":"2025-06-15T12:35:31.023Z","avatar_url":"https://github.com/dinoperovic.png","language":"Python","funding_links":["https://www.paypal.com/","https://developer.paypal.com/demo/checkout/","https://developer.paypal.com/docs/reports/reference/paypal-supported-currencies/","https://developer.paypal.com/api/orders/v2/"],"categories":[],"sub_categories":[],"readme":"# Salesman PayPal\n\n[![PyPI](https://img.shields.io/pypi/v/django-salesman-paypal)](https://pypi.org/project/django-salesman-paypal/)\n[![Test](https://github.com/dinoperovic/django-salesman-paypal/actions/workflows/test.yml/badge.svg)](https://github.com/dinoperovic/django-salesman-paypal/actions/workflows/test.yml)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-salesman-paypal)](https://pypi.org/project/django-salesman-paypal/)\n[![PyPI - Django Version](https://img.shields.io/pypi/djversions/django-salesman-paypal)](https://pypi.org/project/django-salesman-paypal/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n[PayPal](https://www.paypal.com/) payment integration for [Salesman](https://github.com/dinoperovic/django-salesman).\n\n## Installation\n\nInstall the package using pip:\n\n```bash\npip install django-salesman-paypal\n```\n\nAdd to your setting file:\n\n```python\nINSTALLED_APPS = ['salesman_paypal']\nSALESMAN_PAYMENT_METHODS = ['salesman_paypal.payment.PayPalPayment']\nSALESMAN_PAYPAL_CLIENT_ID = '\u003cpaypal-client-id\u003e'\nSALESMAN_PAYPAL_CLIENT_SECRET = '\u003cpaypal-client-secret\u003e'\nSALESMAN_PAYPAL_SANDBOX_MODE = True  # Disable in production\n```\n\n### Usage guide\n\nTo use this payment on your website, checkout the official PayPal server [integration guide](https://developer.paypal.com/demo/checkout/#/pattern/server).\n\nSee `example` directory in this repository for integration example using JavaScript.\n\n### Additional settings\n\nOptional additional settings that you can override:\n\n```python\n# Payment method label used when displayed in the basket.\nSALESMAN_PAYPAL_PAYMENT_LABEL = 'Pay with PayPal'\n\n# Default PayPal currency used for payments (https://developer.paypal.com/docs/reports/reference/paypal-supported-currencies/)\nSALESMAN_PAYPAL_DEFAULT_CURRENCY = 'USD'\n\n# URL to redirect to when PayPal payment is approved.\nSALESMAN_PAYPAL_RETURN_URL = '/paypal/return/'\n\n# URL to redirect to when PayPal payment is cancelled.\nSALESMAN_PAYPAL_CANCEL_URL = '/paypal/cancel/'\n\n# Default paid status for fullfiled orders.\nSALESMAN_PAYPAL_PAID_STATUS = 'PROCESSING'\n```\n\n## Advanced usage\n\nTo gain more control feel free to extend the `PayPalPayment` class with your custom functionality:\n\n```python\n# shop/payment.py\nfrom salesman_paypal.payment import PayPalPayment\nfrom salesman_paypal.conf import app_settings\n\nclass MyPayPalPayment(StripePayment):\n    def get_paypal_payer_data(self, obj, request):\n        # https://developer.paypal.com/api/orders/v2/#definition-payer\n        data = super().get_paypal_payer_data(obj, request)\n        if obj.user and obj.user.birth_date:\n            data['birth_date'] = obj.user.birth_date.strftime('%Y-%m-%d')\n        return data\n\n    def get_currency(self, request):\n        currency = request.GET.get('currency', None)\n        # Check currency is valid for PayPal...\n        return currency or app_settings.SALESMAN_PAYPAL_DEFAULT_CURRENCY\n```\n\nMake sure to use your payment method in `settings.py`:\n\n```python\nSALESMAN_PAYMENT_METHODS = ['shop.payment.MyPayPalPayment']\n```\n\nThe `PayPalPayment` class is setup with extending in mind, feel free to explore other methods.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinoperovic%2Fdjango-salesman-paypal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinoperovic%2Fdjango-salesman-paypal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinoperovic%2Fdjango-salesman-paypal/lists"}