Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peachpayments_partner_marshmallow-1.3.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file peachpayments_partner_marshmallow-1.3.0.tar.gz.

File metadata

File hashes

Hashes for peachpayments_partner_marshmallow-1.3.0.tar.gz
Algorithm Hash digest
SHA256 3b82e24e114d70b01706a41ce56f23e1c7472cb898d2e7a5bce60edc7d251451
MD5 5a44376a6e6968deef5661e871e47486
BLAKE2b-256 7bf6ae5af4fc070465a887066a3e3eb12ff89bbdcc661c99084326af56a6f48c

See more details on using hashes here.

File details

Details for the file peachpayments_partner_marshmallow-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for peachpayments_partner_marshmallow-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f429b1119b5e6b4bad9ec68b5b48784b42dcc2a763da0b68c9cc09b64c53f61
MD5 55445f2f4bb1a2c9a2fc0aad0599a4f1
BLAKE2b-256 e5e7e43d35476ac9a3f53457ca731d88c3d620b5fa8f15313b0024fb080d5d45

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page