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
Close
Hashes for peachpayments-partner-marshmallow-0.2.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6de074e5a6e95b5287db96ad2eef859ea1373e15dc35ce53a7f11c4ccf365300 |
|
MD5 | 505c47e16a126946fe7a4a9d441ff790 |
|
BLAKE2b-256 | 89b90ccc06b2f82dec72a088f98e1e98c29d3ea5ab38229416828bd05edbf33f |
Close
Hashes for peachpayments_partner_marshmallow-0.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e24cde02dc7c2c62b88da3dbe5ceebe2b9f46a95bf50a79e4fd89286a67a2929 |
|
MD5 | 5b01a9c795b3b51c917a85c6a4b1347e |
|
BLAKE2b-256 | 12b4edbef6c8cdff7bf9d79e779a20f38095de3228d19a2d6d508624ea6f9d55 |