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.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfc999caf96520d3de79e54c16e3d3230c04d4d3ce5f53dd818f790bc6f6b4a4 |
|
MD5 | 5d0b4fc7b681945d9098613fb3cf471c |
|
BLAKE2b-256 | 3dcd0e1d649d0fc1c131474565daab8fa7108e43f1b5f2a6c4b76d800a3c942c |
Close
Hashes for peachpayments_partner_marshmallow-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37936683beba78f8cbeaa75e73a31ee42b5edd306ef07cd39104cb02d90d7da0 |
|
MD5 | c9d4d42a9402be4b85b05f234763a23f |
|
BLAKE2b-256 | 6a14194b8151f81ea5740bb9519f37749115efc5e9598737a13c5ce500ca5337 |