Skip to main content

A python implementation for wechatpay-apiv3

Project description

wechatpay-py

This is a python implementation of wechatpay apiv3. Implemented with aiohttp for now. The project is now at alpha state, some features are still missing, use at your own risk.

Install

pip install wechatpay-py

Usage

credential = WechatPayCredential(
    mch_id='123456',
    app_id='',
    mch_certificateSerialNumber='asdfasdfadfasdfasdfasdf',
    mch_priv_key_file='path to the key file'
)
validator = WechatPayValidator(
    *, **kwargs
)
client = AsyncWechatPayClient(
    credential,
    validator
)

# get certificates
client.get_certificates()

# create order
# create jsapi order
client.jsapi_prepay(
    description='description of the order',
    out_trade_NO='side'
    notify_url='url of the notification'
    amount=100,
    payer=xyz
)

# create native order
client.native_prepay(
    description='description of the order',
    out_trade_NO='side'
    notify_url='url of the notification'
    amount=100,
    payer=xyz
)

# querys
client.get_order_by_transaction_id(

)
client.get_order_by_out-trade-no(

)

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

wechatpay-py-0.0.1.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

wechatpay_py-0.0.1-py3-none-any.whl (6.8 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