示例#1
0
def pay(request, user_game_id):
    pay_data = _pay(request, user_game_id)
    p = option()
    freepay = p['freepay'].split(',')
    if str(request.user.id) in freepay:
        shipping(pay_data['dpo'].number, True)
        return HttpResponseRedirect(reverse('account:order'))
    url = creat_payment_url(pay_data, request.META['HTTP_USER_AGENT'])
    return HttpResponseRedirect(url)
示例#2
0
def donate_pay(request):
    p = option()
    user_game_id = int(p['donate_user_game_id'])
    pay_data = _pay(request, user_game_id)
    freedonate = p['freedonate']
    if freedonate == '1':
        shipping(pay_data['dpo'].number, True)
        return HttpResponseRedirect(reverse('account:order'))
    url = creat_payment_url(pay_data, request.META['HTTP_USER_AGENT'])
    return HttpResponseRedirect(url)
示例#3
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)