Skip to content

Commit 9890bba

Browse files
committed
payment-key 생성 추가
1 parent c11d835 commit 9890bba

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

payment/logic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
def generate_payment_key(user: User, ticket_type: TicketType):
1515
new_payment = Payment(
1616
payment_key=shortuuid.uuid(),
17-
user_id=user,
18-
# ticket_type=ticket_type, # TODO
17+
user=user,
18+
ticket_type=ticket_type,
1919
money=ticket_type.price,
2020
status=PaymentStatus.BEFORE_PAYMENT.value
2121
)

payment/urls.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from django.contrib import admin
22
from django.urls import include, path
33

4-
from payment.views import PortoneWebhookApi
4+
from payment.views import PortoneWebhookApi, get__generate_payment_key
55

66

77
urlpatterns = [
8-
path("portone/webhook", PortoneWebhookApi.as_view(), name="portone-webhook"),
8+
path("portone/webhook/", PortoneWebhookApi.as_view(), name="portone-webhook"),
9+
path("key/", get__generate_payment_key, name="get-payment-key"),
910
]

payment/views.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def get__generate_payment_key(request):
3939

4040
response_data = {
4141
"msg": "ok",
42-
"payment_key": payment_key
42+
"payment_key": payment_key,
43+
"price": request_ticket_type.price
4344
}
4445

45-
return Response()
46+
return Response(response_data)

0 commit comments

Comments
 (0)