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/peachpayments-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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07753841a5ef925b14109332bdad6c9aeae41d1a18ea5f0c58c9f096819b25dd |
|
MD5 | 829fd59a5b3940d400d78ea1b944bdd7 |
|
BLAKE2b-256 | a5c423fac45e442f1640190210fa38d959074f4acb64e5e9749d228745ef1909 |
Close
Hashes for peachpayments_partner_marshmallow-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2320d8fa87a0aae5f219b2e30dbd3297ca2913ae4f2c6b1768f5cdae6128105e |
|
MD5 | 1e2031129a7bfa9b4df163d33d156bcd |
|
BLAKE2b-256 | 4a0256489d6c13938916f846472519ead6f70414ccd595413d7a329b4103bcb3 |