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)
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)
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)