异步/aiohttp的moip api包装
async-moip的Python项目详细描述
异步MOIP
基于提供异步请求的moip的asyncio/aiohttp(python3.5+)moip api包装器。
用法
importasync_moipimportaiohttpimportasyncioasyncdefmain():moip=async_moip.Moip(environment='<production or sandbox',key='<key>',token='<token>')order=awaitmoip.get_order('ORD-W121212121')print(order)loop=asyncio.get_event_loop()loop.run_until_complete(main())
功能
post_customer(params)# create new customer get_customer(parameters)# get customer datapost_creditcard(customer_id,parameters)# add new credit card to customer accountdelete_creditcard(creditcard_id)# delete credit cardpost_order(parameters)# create a new orderget_order(order_id)# get order by idpost_payment(order_id,parameters)# create a paymentget_payment(payment_id)# get payment data by idcapture_payment(payment_id)# capture of a preauthorized paymentvoid_payment(payment_id)# cancel the capture of a preauthorized paymentaccount_exists(account_id)# check if account exists