Exemple #1
0
def vivo_recharge_remote(product_id, fee, order_id, is_online, player):
    logger.debug('vivo_recharge_remote:%s-fee:%s-order:%s', product_id, fee,
                 order_id)
    if player.base_info.one_dollar_flowid == order_id:
        player.base_info.one_dollar_flowid = 'done'
        logger.debug('one dollar is ok! %s', product_id)

    recharge_item = game_configs.recharge_config.get('android').get(product_id)
    if recharge_item is None:
        logger.error('not in rechargeconfig:%s', product_id)
        return False

    if float(fee) / 100 != recharge_item.get('currence'):
        logger.error('recharge fee is wrong:%s-%s', fee,
                     recharge_item.get('currence'))
        return False

    response = apple_pb2.AppleConsumeVerifyResponse()
    response.res.result = True
    player.recharge.recharge_gain(recharge_item, response, 10)  # 发送奖励邮件

    remote_gate.push_object_remote(12005, response.SerializeToString(),
                                   [player.dynamic_id])
    logger.debug('hauwei response:%s', response)
    return True
Exemple #2
0
def xiaomi_recharge_remote(subject, fee, cpOrderId, is_online, player):
    logger.debug('xiaomi_recharge_remote:%s', subject)

    # if str(cpOrderId) != str(player.base_info.flowid):
    # logger.error("cpOrderId %s %s" % (cpOrderId, player.base_info.flowid))
    # return 1506
    # else:
    player.base_info.flowid = 0
    player.base_info.save_data()

    recharge_item = game_configs.recharge_config.get('android').get(subject)
    if recharge_item is None:
        logger.error('not in rechargeconfig:%s', subject)
        return 1525
    if float(fee) != recharge_item.get('currence'):
        logger.error('recharge fee is wrong:%s-%s', fee,
                     recharge_item.get('currence'))
        # return 1525
    response = apple_pb2.AppleConsumeVerifyResponse()
    response.res.result = True
    player.recharge.recharge_gain(recharge_item, response, 6)  # 发送奖励邮件

    remote_gate.push_object_remote(13001, response.SerializeToString(),
                                   [player.dynamic_id])
    logger.debug('xiaomi response:%s', response)
    return 200
Exemple #3
0
def kuaiyong_recharge_remote(product_id, fee, is_online, player):
    logger.debug('kuaiyong_recharge_remote:%s', product_id)

    recharge_item = game_configs.recharge_config.get('ios').get(product_id)
    if recharge_item is None:
        logger.error('not in rechargeconfig:%s', product_id)
        return False
    if float(fee) != recharge_item.get('currence'):
        logger.error('recharge fee is wrong:%s-%s', fee,
                     recharge_item.get('currence'))
        return False

    response = apple_pb2.AppleConsumeVerifyResponse()
    response.res.result = True
    player.recharge.recharge_gain(recharge_item, response, 4)  # 发送奖励邮件

    remote_gate.push_object_remote(12001, response.SerializeToString(),
                                   [player.dynamic_id])
    logger.debug('kuaiyong response:%s', response)
    return True