Skip to main content

Veem Python SDK provides an interface to call Veem Global Payments APIs (https://www.veem.com).

Project description

Veem-Python-Sdk

The Veem Python SDK provides an interface to make it easier to call Veem Global Payments APIs.

Version information

  • Latest SDK Version: 3.0.0
  • Latest supported API Endpoint Version: v1.1

Documentation

System Requirements

  1. The SDK works on Python 2.7, Python 3.4 and beyond.
  2. A developer account
  3. An application with a customer account and the associated client id and secret (Authorization flow / Client Credentials flow)

First Use Instructions

  1. pypi install with command: pip install veem
  2. Import the package to your python

Or

  1. Clone the GitHub repo to your computer.
  2. Run installation with command python setup.py install
  3. Import the package to your python script

Configuration YAML

Veem Python SDK utilize configuration YAML file to manage your SDK credential. Here is the sample content:

client_id: VeemTester-1234abcd
client_secret: 8djduf8e-d798-3534-afe3-123sdc3r4fe
url: https://sandbox-api.veem.com/
authorizationCode: VeemAbckeieifh
redirectUrl: http://your-veem-redirct.yourbusiness.com

Testing the Code

To test the code locally, follow the steps below:

  1. cd to the project directory
  2. Client can either integrate with Authorization flow or Client Credential Flow;
  3. For Authorization flow, fill in the clientId, clientSecret, authorizationCode, and redirectUrl(optional) in your configuration yaml.
  4. For Client Credentials flow, fill in the clientId, and clientSecret in your configuration yaml.
  5. To exercise all Veem Global Payment APIs, fill access_token received from either step 3 or 4 to your configuration yaml.
  6. Save the configuration yaml to a readable location or passing the content of yaml file as a yaml loadable string.

Getting the OAuth Tokens

In order to get the access tokens from the Developer Portal;

Sign In with Veem - Sign into developer Portal .

Create an Application- Create a new application by providing the Name, OAuth2 Redirection URLs and Payment Status Webhooks.

Create a Customer- Create a new customer by providing Business Name, Country and Primary Email

Get Credentials- Go the Application and select the Customer and copy the Access Token.

In order to get the access token programmatically, get the client id, client secrets (Optional redirect url for Authorization flow).

from veem.configuration import ConfigLoader
from veem.client.authentication import AuthenticationClient

# loading SDK configuration from your yaml file
config = ConfigLoader(yaml_file='/path/to/your/configuration.yaml')
# login to Veem server with client credentials
tokenResponse= AuthenticationClient(config).getTokenFromClientCredentials()

Invoice Client Example

The following example is to send invoice using Invoice Client


from veem.client.veem import VeemClient
from veem.client.requests.invoice import InvoiceRequest

# define a VeemClient Context Manager with yaml+file and auto login.
with VeemClient(yaml_file='/path/to/your/configuration.yaml',
                useClientCredentials=True) as veem:
    # define an InvoiceRequest
    invoice = InvoiceRequest(payer=dict(type='Business',
                                        email='username@yourbusiness.com',
                                        firstName='Joe',
                                        lastName='Doe',
                                        businessName='Your Business Inc.',
                                        countryCode='US',
                                        phoneCountryCode='1',
                                        phone='02222222222'),
         amount=dict(number=50, currency='USD'))
    # create an invoice
    sentInvoice = veem.inoviceClient.create(invoice)

More Examples can be found under examples folder

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

oveem-2.0.8.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

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

oveem-2.0.8-py3-none-any.whl (37.7 kB view details)

Uploaded Python 3

File details

Details for the file oveem-2.0.8.tar.gz.

File metadata

  • Download URL: oveem-2.0.8.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.10

File hashes

Hashes for oveem-2.0.8.tar.gz
Algorithm Hash digest
SHA256 ae4f845d6b4302930e689d817c433c840cec383dc7eb5c6012417558d22b844a
MD5 e1d6dec1b496edc8f912f55bcfd6f85a
BLAKE2b-256 903314b0d3a75835b16d466c162e014977dec6c4e7c1f991c60c9d9f94a154fa

See more details on using hashes here.

File details

Details for the file oveem-2.0.8-py3-none-any.whl.

File metadata

  • Download URL: oveem-2.0.8-py3-none-any.whl
  • Upload date:
  • Size: 37.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.10

File hashes

Hashes for oveem-2.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 5e2eceb88e9af62983c36d5c3b1415823bc305003a4897a81f52cd4758989c0a
MD5 a215f90304fde0c12852c9f7b1fbd165
BLAKE2b-256 89a8b14eee8aa17603d896672c56b9a4c574f0c17ff9f32292cc7313ee4129b4

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