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.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

yoco_python-0.1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yoco-python-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 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.0.tar.gz
Algorithm Hash digest
SHA256 03cc9a11ff1ac631013fbde7875b86853d3bec80be6f6cbcffba4888f0530b7d
MD5 eb6213f3f3fe6e84a3202213bc07f23e
BLAKE2b-256 57db9a599ae0db7c55ff7f024f2e4311c4e3952f637df4a0ec3aab5c69c073d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yoco_python-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 911fb5f4f6d8e00755cbb52d60580a7e3a786a117f1a4524ea4d332a7abfe64e
MD5 72786f870d7233c40f04464318d628b4
BLAKE2b-256 2e0873c4d441079509559a0ce44ab7b978058f948a37742aa14dedc6b1d6c567

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