Quickstart
You need the following for the Quickstart
Before you begin with the Quickstart you need a Tenant ID, for resource permissions. This ID is given to you (or your organization) upon registration. Do the following:
- Make sure your organization is a Ping Payment registered customer.
- Get access to your tenant ID.
Create a project 🔨
-
Create a python project in your chosen IDE.
-
Open the terminal and locate the project.
-
Install the python SDK with pip:
pip install ping-sdk
- Import packages:
Import only one if only one is needed
from ping.payments_api import PaymentsApi
from ping.payment_link_api import PaymentLinksApi
Write code
Payments Api
- Configure the client with environment and the given Tenant Id:
from ping.payments_api import PaymentsApi
payments_api = PaymentsApi(
tenant_id = 'input given tenant_id',
environment = 'sandbox'
)
- Make calls to the Api:
from ping.payments_api import PaymentsApi
payments_api = PaymentsApi(
tenant_id = 'input given tenant_id',
environment = 'sandbox'
)
response = payments_api.ping.ping_the_api()
- Handle response:
from ping.payments_api import PaymentsApi
payments_api = PaymentsApi(
tenant_id = 'input given tenant_id',
environment = 'sandbox'
)
response = payments_api.ping.ping_the_api()
if response.is_success():
print(response.body)
elif response.is_error():
print(response.errors)
Payment Links Api
- Configure the client with environment and the given Tenant Id:
from ping.payment_links_api import PaymentLinksApi
payment_links_api = PaymentLinksApi(
tenant_id = 'input given tenant_id',
environment = 'sandbox'
)
- Make calls to the Api:
from ping.payment_links_api import PaymentLinksApi
payment_links_api = PaymentLinksApi(
tenant_id = 'input given tenant_id',
environment = 'sandbox'
)
response = payment_links_api.ping.ping_the_api()
- Handle response:
from ping.payment_links_api import PaymentLinksApi
payment_links_api = PaymentLinksApi(
tenant_id = 'input given tenant_id',
environment = 'sandbox'
)
response = payment_links_api.ping.ping_the_api()
if response.is_success():
print(response.body)
elif response.is_error():
print(response.errors)
Updated over 1 year ago