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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b1d064bc448d60e49b3e8b6a8de7faf551143a3d77286af08dad6f79f59cc62 |
|
MD5 | 91677f83a01ee61da750a598ab6b7e48 |
|
BLAKE2b-256 | 9159b33ea0e65913f3bd2966ae644832cc98ee1be3833129e517fafa09dcb94f |
Close
Hashes for peachpayments_partner_marshmallow-0.2.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62da4b3e5ebc7b6fe9a1ab006a0d7ae89d08d1c4e9888bcdd22cd2ab5a15c98d |
|
MD5 | fed7a11683af1124d49a273f1d5c39c1 |
|
BLAKE2b-256 | 0e408e218166ad2cf449dfc4b13b0527bfba1ee7c487b27f3f70ed350aceac11 |