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
- The SDK works on Python 2.7, Python 3.4 and beyond.
- A developer account
- An application with a customer account and the associated client id and secret (Authorization flow / Client Credentials flow)
First Use Instructions
- pypi install with command:
pip install veem - Import the package to your python
Or
- Clone the GitHub repo to your computer.
- Run installation with command
python setup.py install - 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:
- cd to the project directory
- Client can either integrate with Authorization flow or Client Credential Flow;
- For Authorization flow, fill in the
clientId,clientSecret,authorizationCode, andredirectUrl(optional) in your configuration yaml. - For Client Credentials flow, fill in the
clientId, andclientSecretin your configuration yaml. - To exercise all Veem Global Payment APIs, fill access_token received from either step 3 or 4 to your configuration yaml.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file veem-3.0.0.tar.gz.
File metadata
- Download URL: veem-3.0.0.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c79a7802f4b84afbc1ca4642b397e456b187626125d9f1294fe1d38906f40ecf
|
|
| MD5 |
f47aa1a6f70c06dc805603e721ea3e18
|
|
| BLAKE2b-256 |
e7a5cff703e676d3895dbcbaee0e403087a32a0da96e44030c827dfc80d87383
|
File details
Details for the file veem-3.0.0-py3-none-any.whl.
File metadata
- Download URL: veem-3.0.0-py3-none-any.whl
- Upload date:
- Size: 37.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8de8b3265f4b34407a638340ec3d86acad9f6131666bd2a25f8bbeec3c2631d6
|
|
| MD5 |
e564f121191ca6188758e646ceeb99a8
|
|
| BLAKE2b-256 |
6522436a34a491f30943367afdb46b32f23689dc7be2fc0c6cf2d11a9ec126cd
|
File details
Details for the file veem-3.0.0-py2-none-any.whl.
File metadata
- Download URL: veem-3.0.0-py2-none-any.whl
- Upload date:
- Size: 37.6 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bff58260091d78745e420c74833a13b6355922d7d67e11b3cb636b6e60a55bf
|
|
| MD5 |
206199978ec0bab4ee232c475404b5d3
|
|
| BLAKE2b-256 |
fbd75c5c69aea31f55f462a65fc4dc297a8142b72af15a9b0a78ea048ca3fa88
|