Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: payments 수정 #191

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions jwtauth/views.py
Original file line number Diff line number Diff line change
@@ -61,15 +61,9 @@ def post(self, request):
)
return response
else:
return Response(
{"error": "회원 가입하세요"}, status=status.HTTP_401_UNAUTHORIZED
)
return redirect(settings.SIGNUP_REDIRECT_URL)
else:
return Response(
serializer.errors,
status=status.HTTP_400_BAD_REQUEST,
redirect_uri="http://localhost:3000",
)
return redirect(settings.SIGNUP_REDIRECT_URL)


class LogoutView(GenericAPIView):
8 changes: 4 additions & 4 deletions payments/services.py
Original file line number Diff line number Diff line change
@@ -21,11 +21,11 @@ def request_payment(self, order):
"partner_user_id": str(order.user.id),
"item_name": f"Order #{order.id}",
"quantity": order.get_total_items(),
"total_amount": order.get_total_price(),
"total_amount": int(order.get_total_price()),
"tax_free_amount": 0,
"approval_url": f"{base_url}/api/payments/{order.id}/?result=success",
"cancel_url": f"{base_url}/api/payments/{order.id}/?result=cancel",
"fail_url": f"{base_url}/api/payments/{order.id}/?result=fail",
"approval_url": f"{base_url}payments/?result=success",
"cancel_url": f"{base_url}api/payments/{order.id}/?result=cancel",
"fail_url": f"{base_url}api/payments/{order.id}/?result=fail",
}

response = requests.post(url, json=payment_request, headers=headers)
1 change: 1 addition & 0 deletions weaverse/settings.py
Original file line number Diff line number Diff line change
@@ -211,6 +211,7 @@

REDIRECT_URL = "https://www.weaverse.site"
LOGIN_REDIRECT_URL = os.getenv("LOGIN_REDIRECT_URL", "/")
SIGNUP_REDIRECT_URL = os.getenv("SIGNUP_REDIRECT_URL", "/")
LOGOUT_REDIRECT_URL = "/"

MEDIA_URL = f"https://{AWS_S3_CUSTOM_DOMAIN}/"
Loading