コード例 #1
0
import settings
import flask
import threading
from yandex_money import api

# import logging
# log = logging.getLogger('werkzeug')
# log.setLevel(logging.ERROR)

users_menu = {}
tb = telebot.TeleBot(settings.telegram_token, threaded=True)
bot_info = tb.get_me()
repost_message = None
answ = functions.AnswFunctions(tb=tb, db=db_api)
helpers = functions.helpers()
wallet = api.Wallet(access_token=settings.ya_token)

to_replace = {
    '%all_users%':
    lambda: db_api.count.users(),
    '%users_today%':
    lambda: db_api.count.activity(date=time.strftime("%d/%m/%Y")),
    '%posts_count%':
    lambda: db_api.count.channels(active=1),
    '%money_for_views%':
    lambda: list(db_api.sumof.transactions(row='count', type='view_pay'))[0][
        'sum(count)'],
    '%money_out%':
    lambda: list(db_api.sumof.transactions(row='count', type='pay_out'))[0][
        'sum(count)']
}
コード例 #2
0
ファイル: tost.py プロジェクト: YuliaBachische/Python2
from yandex_money import api

print(api.Wallet.build_obtain_token_url(
    client_id='11488C85A286C555F038E5BEEB40D7145D33895ED6E68ECC68C07DBEDFA920B7', redirect_uri='https://194.87.237.18:8443/ya_pay',
    scope=['account-info', 'operation-history', 'operation-details']) + '&response_type=code')

# Empty webserver index, return nothing, just http 200


wallet = api.Wallet(
    access_token='410015691952648.F2885C5DE257C9EF71296C9044C800E93B85C798A462249A32D1E75FA9C8B9B4E46CCC6F580F5095BEB87B2707E891CA954C86384DD3501954DD8AB86EE70C7E6FBF6611C9F507D46AFAE2F4E283CB514FCEAE9D63843DE4629D63158F408DADE73EA1C192EA850F2E4E12BEF50FED38F672D3023B722AFEC11EE7188A0A5215')
print(wallet.account_info())
print(wallet.operation_details(operation_id=410015691952648))
print(wallet.operation_history({'type': 'deposition', 'details': 'true'}))

コード例 #3
0
ファイル: tost.py プロジェクト: cz303/LifeCoders.ga
from yandex_money import api

print(api.Wallet.build_obtain_token_url(client_id='103703A821D04244A16FA4554553725282C76EF2E5491E3690FAC425D7665EB4',redirect_uri='https://104.155.124.29:8443/ya_pay',scope=['account-info', 'operation-history','operation-details'])+'&response_type=code')

# Empty webserver index, return nothing, just http 200


wallet = api.Wallet(access_token='410011460693944.8EA33E1F4681E30270A8FF1668BEA0025CC75F5FFA72100BC082F0FE5319F9E06EB4696A4C874D4C07233D557EED7B08033597302898119624A433FF2BE4925D2C0E176AB06BE1DDE2B97EB6DB9258222C032C7CC3741F5ABF91A7B24AC8839B832FD968C1B76CBCCDA7849904B01602F3786253C1923D2903C18A4A124C487E')
print(wallet.operation_details(operation_id=512742676385025004))
print(wallet.operation_history({'type':'deposition','details':'true'}))

# app.run(host=settings.WEBHOOK_LISTEN,
#         port=settings.WEBHOOK_PORT,
#         ssl_context=(settings.WEBHOOK_SSL_CERT, settings.WEBHOOK_SSL_PRIV),debug=False)
コード例 #4
0
from yandex_money import api

print(
    api.Wallet.build_obtain_token_url(
        client_id=
        '103703A821D04244A16FA4554553725282C76EF2E5491E3690FAC425D7665EB4',
        redirect_uri='https://37.60.177.245:8443/ya_pay',
        scope=['account-info', 'operation-history', 'operation-details']) +
    '&response_type=code')

# Empty webserver index, return nothing, just http 200

wallet = api.Wallet(
    access_token=
    '410014484849976.70AF4E00D24F1B514B293E3D49E7B06F90E717BD0576AC40279EDB0EB0C9B3962F2DC031F24449D30E7423AF48041DDFE1B4E154EDA5B442F1406DFBA0B85804C246581D66E7F8ADF39B159322846317A18B643EE950FC5FA739676AAB7D763B077AE2437464BD4D171AE04CAF9852470E31FF36F2745518663E2986B953BE4B'
)
print(wallet.operation_details(operation_id=512742676385025004))
print(wallet.operation_history({'type': 'deposition', 'details': 'true'}))

# app.run(host=settings.WEBHOOK_LISTEN,
#         port=settings.WEBHOOK_PORT,
#         ssl_context=(settings.WEBHOOK_SSL_CERT, settings.WEBHOOK_SSL_PRIV),debug=False)