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:

  1. Make sure your organization is a Ping Payment registered customer.
  2. Get access to your tenant ID.

Create a project 🔨

  1. Create a python project in your chosen IDE.

  2. Open the terminal and locate the project.

  3. Install the python SDK with pip:

pip install ping-sdk
  1. 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

  1. 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'
)
  1. 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()
  1. 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

  1. 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'
)
  1. 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()
  1. 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)