PeachPayments Partner Marshmallow library contains Marshmallow schemas to help integrate PeachPayments with their partners.
Project description
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file peachpayments_partner_marshmallow-1.2.0.tar.gz
.
File metadata
- Download URL: peachpayments_partner_marshmallow-1.2.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.9.17 Linux/5.4.0-1078-aws
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5bea658a583947b103c9d98c5438035232d67f0bb14fc8b5db77e131eda70f4 |
|
MD5 | de84d8d686538a32a48fab962220cb0c |
|
BLAKE2b-256 | dc53b73133a25ad1a9f70e810d1f1778034f53b4ebcd47c02b70e81156f0fae3 |
File details
Details for the file peachpayments_partner_marshmallow-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: peachpayments_partner_marshmallow-1.2.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.9.17 Linux/5.4.0-1078-aws
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 873da53302fc19572252ef3c787da84e76bf264b034e8b9c0108843c4a57e923 |
|
MD5 | 29e1b54ca47cd041fc21e25f8345ae72 |
|
BLAKE2b-256 | b2a0bb6034b1522af22127e99cc984e9486205d7fa794de3587072bf141991df |