Skip to main content

Python SDK for Yoco API

Project description

Yoco Python SDK

Installation

pip install yoco-python

Getting started

How to call the API using the Python SDK:

from yoco_python import YocoClient

# Instantiate the yoco client
yoco = YocoClient(
    secret_key='YOUR_SECRET_KEY', # Replace with your Yoco secret key
    charge_token='YOUR_CHARGE_TOKEN', # Replace with your token generated by the frontend API
    amount_in_cents=1000, # The amount in cents to charge the user
    currency='ZAR', # The currency of the amount
)

# Call the charge api
charge_response = yoco.charge()

# Call the refund api
if yoco.charge_success:
    refund_response = yoco.refund()

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

yoco-python-0.1.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

yoco_python-0.1.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file yoco-python-0.1.2.tar.gz.

File metadata

  • Download URL: yoco-python-0.1.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.2

File hashes

Hashes for yoco-python-0.1.2.tar.gz
Algorithm Hash digest
SHA256 19ef4b3678339917b0d1c938c194ad14f5158f92d42b7aad1281c73f9c4fe6e4
MD5 b26d34e675a93e5c687daba5c8ed43c4
BLAKE2b-256 3c5a9d6d0c9273b4c912a02f58bfe0ae11d75af5c9f7b53d3297f7ba6bc52f71

See more details on using hashes here.

File details

Details for the file yoco_python-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: yoco_python-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.2

File hashes

Hashes for yoco_python-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ca904ab5581b64bef07c8b80c9d537f5bd57d88ef47d3baa86cf5c3cf92bee00
MD5 0c65d735b5ce69660cf804b12d1a2ddd
BLAKE2b-256 2e4bd364e45e910fc7aeeaa1c183c106f6e437c3820af020eb87cd677a9c9e01

See more details on using hashes here.

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