Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A simple django app to manage Satispay payments following the Web-button flow.
A simple django app to manage Satispay payments following the Web-button flow.
satispaython
>= 0.2You can install this package with pip: pip install django-satispaython
.
In order to use django-satispaython you need to generate a RSA private key and then get a key-id. Django-satispaython is based on satispaython so you can import it, create a key and obtain a key-id.
Once you created a RSA key and got a key-id add django-satispaython to your INSTALLED_APPS:
INSTALLED_APPS = (
#...
'django_satispaython.apps.DjangoSatispaythonConfig',
#...
)
Then add the followings to you django settings:
SATISPAYTHON_PRIVATE_KEY_PATH = '/path/to/my/key.pem'
SATISPAYTHON_KEY_ID_PATH = '/path/to/my/key-id.txt'
SATISPAYTHON_STAGING = True
SATISPAYTHON_PRIVATE_KEY_PATH
: the path of your PEM file containing the RSA private key used to get your key-id.SATISPAYTHON_KEY_ID_PATH
: the path of the file containing the key-id coupled with the private-key.SATISPAYTHON_STAGING
: if True
django-satispaython will use the Sandbox endpoints.In order to use the Satispay API import django-satispaython.api:
from django_satispaython import api as satispay
Then you can:
satispay.create_payment(amount_unit, currency, callback_url, expiration_date=None, external_code=None, metadata=None, idempotency_key=None)
You may use satispaython utility function format_datetime
to get a correctly formatted expiration_date
to supply to the request.
satisapy.get_payment_details(payment_id)
In order to render the Satispay button just load the tag and use it in the template:
{% load django_satispaython %}
...
{% satispay_button payment_id=<your_payment_id> %}
Note that the button will automatically point at the endpoint (production or sandbox) specified in the project settings
.
Django-satispaython comes with a SatispayPayment model which contains every info associated to a payment and is automatically showed in the admin page.
:information_source: All the Satispay API functions return an instance of the SatispayPayment model without actually storing it by default.
If you want to store a newly created payment in the database or update an already existing one with the informations provided by the response, set the update
parameter to True
.
satispay.create_payment(amount_unit, currency, callback_url, expiration_date=None, external_code=None, metadata=None, idempotency_key=None, update=True)
satisapy.get_payment_details(payment_id, update=True)
In this case an output similar to django's update_or_create
will be returned.
FAQs
A simple django app to manage Satispay payments following the Web-button flow.
We found that django-satispaython demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.