Package: oveem
Veem-Python-SdkThe Veem Python SDK provides an interface to make it easier to callVeem Global Payments APIs.Version informationLatest SDK Version:3.0.0Latest supported API Endpoint Version:v1.1DocumentationVeem Global Payments APIsDeveloper DashboardSystem RequirementsThe SDK works onPython 2.7, Python 3.4 and beyond.AdeveloperaccountAnapplication with a customer accountand the associated client id and secret (Authorization flow / Client
Credentials flow)First Use Instructionspypi install with command:pip install veemImport the package to your pythonOrClone the GitHub repo to your computer.Run installation with commandpython setup.py installImport the package to your python scriptConfiguration YAMLVeem 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.comTesting the CodeTo test the code locally, follow the steps below:cd to the project directoryClient can either integrate with Authorization flow or Client Credential Flow;For Authorization flow, fill in theclientId,clientSecret,authorizationCode, andredirectUrl(optional) in your configuration yaml.For Client Credentials flow, fill in theclientId, 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 TokensIn order to get the access tokens from the Developer Portal;Sign In with Veem- Sign intodeveloper Portal.Create an Application- Create a new application by providing theName,OAuth2 Redirection URLsandPayment Status Webhooks.Create a Customer- Create a new customer by providingBusiness Name,CountryandPrimary EmailGet Credentials- Go the Application and select theCustomerand copy theAccess Token.In order to get theaccess tokenprogrammatically, 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 ExampleThe following example is to send invoice usingInvoice Clientfrom 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