Example #1
0
def purchase_confirm(request):
    req = request._proto
    char_id = request._char_id

    platform = req.platform

    if platform == '91':
        p = PurchaseAction91(char_id)
        response = p.check_confirm()
    elif platform == 'aiyingyong':
        p = PurchaseActioinAiyingyong(char_id)
        response = p.check_confirm()
    elif platform == 'jodo' or platform == 'jodoplay':
        p = PurchaseActionJodoplay(char_id)
        response = p.check_confirm()
    else:
        raise SanguoException(
            errormsg.BAD_MESSAGE,
            char_id,
            "Purchase Confirm",
            "Unknown platform: {0}".format(platform)
        )

    return pack_msg(response)