PeachPayments Partner Marshmallow Library
Overview
PeachPayments Partner Marshmallow Library is a platform-agnostic Python package to help Payment Service Providers in integrating with PeachPayments. This library provides functionality to validate request and response data using Marshmallow Python library.
Source Code: https://gitlab.com/peachpayments/peach-partner-marshmallow/
Key terms
| Term | Definition |
|---|---|
| Partner API | A service provided by Peach Payments to enable Payment Service Providers to become available on the Peach Platform |
| Payment Service Provider | A payment service provider who integrates with the Partner API |
| Outbound API call | API calls sent from Partner API to the Payment Service Provider |
| Inbound API call | API calls sent from Payment Service Provider to Partner API |
Usage
Package requires Python 3.9+
Installation
# pip
$ pip3 install peachpayments-partner-marshmallow
# poetry
$ poetry add peachpayments-partner-marshmallow
Field validation
Payment Service Provider receives a debit request from PeachPayments.
# ... imports
from peachpayments_partner_marshmallow.validator import validate_debit_request, validate_debit_response
def debit(db: Session, data: dict):
request_validation = validate_debit_request(data)
if not request_validation["valid"]:
raise HttpJSONError(request_validation["response"])
# Store a transaction in a database
# Prepare the response to PeachPayments in the `response_fields` dictionary
response_validation = validate_debit_response(response_fields)
if not response_validation["valid"]:
raise Exception("Badly formatted response fields")
return HttpResponse(response_fields)
Release files for peachpayments-partner-marshmallow 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| peachpayments_partner_marshmallow-1.3.0.tar.gz | 10.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| peachpayments_partner_marshmallow-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.0 kB
Release files / peachpayments_partner_marshmallow-1.3.0.tar.gz
| Download URL | peachpayments_partner_marshmallow-1.3.0.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b82e24e114d70b01706a41ce56f23e1c7472cb898d2e7a5bce60edc7d251451
|
|
BLAKE2b-256 checksum How to use checksums |
7bf6ae5af4fc070465a887066a3e3eb12ff89bbdcc661c99084326af56a6f48c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.9.25 Linux/6.8.0-1033-aws
|
Release files / peachpayments_partner_marshmallow-1.3.0-py3-none-any.whl
| Download URL | peachpayments_partner_marshmallow-1.3.0-py3-none-any.whl |
|---|---|
| Size | 11.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4f429b1119b5e6b4bad9ec68b5b48784b42dcc2a763da0b68c9cc09b64c53f61
|
|
BLAKE2b-256 checksum How to use checksums |
e5e7e43d35476ac9a3f53457ca731d88c3d620b5fa8f15313b0024fb080d5d45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.9.25 Linux/6.8.0-1033-aws
|