Socket
Socket
Sign inDemoInstall

ping-sdk

Package Overview
Dependencies
4
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

ping-sdk

Use this Python library to manage Ping Payments API regarding merchants, payment orders, payments and payouts

    4.1.0

Maintainers
1

Readme

Ping Payments Python SDK

Tests PyPI version License: MIT

The Ping Payments Python SDK manages the Ping Payments API and Ping Payment Links API.

Table of contents

Requirements

The Ping Payments Python SDK supports the following versions of Python:

  • Python 3, versions 3.7 and later

Installation

Install the latest Ping Payments Python SDK using pip:

pip install ping-sdk

Documentation

The Ping Payments Python SDK documentation contains complete information to be able to work with the SDK. Go to Python SDK documentation for the full documentation.

Ping Payments API

The Ping Payments API is implemented as the PaymentsApi class contains a number of endpoints.

Ping Payments API Endpoints

The Ping Payments API is implemented as the PaymentLinksApi contains a number of endpoints.

Ping Payment Links API Endpoints

Usage

Get a tenant ID

Ping Payments provides you with a tenant ID and are used for resource permissions.

Important: Make sure you store and access the tenant ID securely.

Instructions
  1. Import the PaymentsApi class from the Ping module:
from ping.payments_api import PaymentsApi
  1. Instantiate a PaymentsApi object and initialize it with the tenant ID and the environment that you want to use.

Initialize the PaymentsApi in production mode:

payments_api = PaymentsApi(
		tenant_id = '55555555-5555-5555-5555-555555555555'
)

Initialize the PaymentsApi in sandbox mode, for testing:

payments_api = PaymentsApi(
		tenant_id = '55555555-5555-5555-5555-555555555555',
		environment = 'sandbox'
)
Make calls

Work with the API by by choosing a Endpoint and calling it´s methods. For example, you can choose the endpoint merchants and call the method list() to a list of all merchants connected to a tenant:

result = payments_api.merchant.list()
Handle the response

Calls to the Ping Payments API endpoint methods returns an ApiResponse object. Properties of the ApiResponse object contains information regarding request (headers and request) and the response (status_code, reason_phrase, text, errors, body, and cursor).

Using the response:

Check whether the response succeeded or failed. Two helper methods is_success()and is_error() in the ApiResponse object determine the success or failure of a call:

if result.is_success():
	# Display the successful response as text
	print(result.text)
elif result.is_error():
	# Display the error response
	print(f"Errors: {result.errors}")

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc