Skip to main content

Xendit REST API Client for Python

Project description

Python Xendit Clinet API

Xendit REST API Client for Python

Documentation

Install

Install xenditclient with pip by the following command:

pip install xenditclient

Usage

Configure the XenditClient with the secret key that you can obtained on your Xendit Dashboard Account.

from xenditclient import XenditClient

client = XenditClient(api_key='<your-secret-key>')

EWallets

Create Payment

params = {
  'ewallet_type':'OVO',
  'external_id':'21345',
  'amount':10000,
  'phone':'081234567890'
}

res_dict, _ = client.ewallet.create(params)
print(res_dict)
# {
#   "business_id": "12345678",
#   "external_id": "21345",
#   "amount": "10000",
#   "phone": "081234567890",
#   "ewallet_type": "OVO",
#   "status": "PENDING",
#   "created": "2020-04-04T00:00:00.000Z",
# }

Get Payment Status

res_dict, _ = client.ewallet.get_payment_status(external_id='21345', payment_method='OVO')
print(res_dict)
# {
#   "amount": "10000",
#   "business_id": "12345678",
#   "ewallet_type": "OVO",
#   "external_id": "21345",
#   "status": "COMPLETED",
#   "transaction_date": "2020-04-04T11:48:47.903Z"
# }

Legal

Disclaimer: This library is not affliated with Xendit. This is an independent and unofficial Library.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xenditclient-0.0.2.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

xenditclient-0.0.2-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page