jdpay

This is an unofficial python JingDong pay API.


License
BSD-3-Clause
Install
pip install jdpay==1.1.6

Documentation

JDPAY京东支付


Overview

This is a python JingDong Pay API, it contains 4 main classes:

  • PayAccount
  • PayRequest
  • RefundRequest
  • QueryRequest
  • Notification
  • DownloadBill

Installation

Install using pip:

pip install jdpay

or you can refer to https://github.com/hereischen/JDPAY/dist download the tar file.

API

PayAccount It allows switching between differnt payment account methods such as debit card only (DO) or debit and credit card (DC).

from jdpay import PayAccount

pay_account = PayAccount(DC)

pay acoount will be initialised to a serious settings that support both debit card and credit card.

PayRequest Post payment data

from jdpay import PayRequest

jd_pay = PayRequest(pay_account)
form_data = jd_pay.post(pay_params)

QueryRequest This class handles paymment queries.

from jdpay import QueryRequest

query_request = QueryRequest(pay_account)

RefundRequest This class handles refund requests.

from jdpay import RefundRequest

refund_request = RefundRequest(pay_account)

Notification This class handls notifications send from JingDong.

return_dict, trade_dict = Notification(notification_account).get_notification(resp)

DownloadBill

bill = DownloadBill().get_bill(bill_date='2015-07-08', suffix='_0430')

That's it!