Exemplo n.º 1
0
def gift_pay(request):
    p = option()
    user_game_id = int(p['gift_user_game_id'])
    pay_data = _pay(request, user_game_id)
    freegift = p['freegift']
    if freegift == '1':
        shipping_gift(pay_data['dpo'].number, True)
        url = reverse('thankyou') + '?number=' + pay_data['dpo'].number
        return HttpResponseRedirect(url)
    url = creat_payment_url(pay_data, request.META['HTTP_USER_AGENT'])
    return HttpResponseRedirect(url)
Exemplo n.º 2
0
def alipay_notify(request, user_game_id):
    p = option()
    logger = logging.getLogger(__name__)
    number = request.POST.get('out_trade_no')
    if notify_alipay_action(request):
        logger.info('Notify Success : {0}'.format(number))
        if int(user_game_id) == int(p['gift_user_game_id']):
            shipping_gift(number)
        else:
            shipping(number)
        return HttpResponse("success")
    else:
        logger.info('Notify Fail : {0}'.format(number))
        return HttpResponse("fail")