Skip to main content

A package for initiating payments via the Stitch API

Project description

stitch-money-api

A Python package for processing digitial wallets payments via the Stitch API. For the complete integration guide, visit docs.stitch.money.

Installation

$ pip3 install stitch-money-api

Usage

import json
import os
from stitch.payins import Wallets
from stitch.utils.types import Wallet, Currency
import uuid
from dotenv import load_dotenv

load_dotenv()

client_id = os.getenv("STITCH_CLIENT_ID")
client_secret = os.getenv("STITCH_CLIENT_SECRET")

# Initialise SDK
stitch_sdk = Wallets(client_id, client_secret, 'merchant.energy.bigbag')

# Payment Verification (Web Only)
session = stitch_sdk.verify(
    Wallet.APPLE_PAY, 1, Currency.ZAR, 'https://apple-pay-gateway.apple.com/paymentservices/startSession', 'TAL', 'bigbag.money')
print(session)

# Payment Creation
transaction = stitch_sdk.create(
    Wallet.GOOGLE_PAY, json.dumps({"data": "sample"}), 1, Currency.ZAR, 'PythonSDK', str(uuid.uuid4()))
print(transaction)

License

The stitch-money-api package is open source and available under the MIT license. See the LICENSE file for more information.

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

stitch_money_api-1.0.0.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

stitch_money_api-1.0.0-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

Supported by

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