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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fd5de15eb6fdc5f796aa1fa8e65a43d4f88ab0407d96209222dc3d170714c29 |
|
MD5 | deb408921c847981927d1291acdcee89 |
|
BLAKE2b-256 | 58969800e41be2234e30da9a95ef320e726d85c7f899fb089d029003f40c610c |
Close
Hashes for peachpayments_partner_marshmallow-0.2.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63cee9f61acd197af91f3db438395bf981f809c7919324c4cd7a31ea12a7dff6 |
|
MD5 | 1dd9b6392585f3c3c2de8ecd4afa51eb |
|
BLAKE2b-256 | 2494f2b8d3ab8ace5707e649a55be4e116c3fbe739ae73650c63112ab10a926b |