Skip to content

Commit

Permalink
πŸ”§ Fix, πŸ“ Docs : 결제 μ·¨μ†Œ κ°œμ„  및 yml 파일 μˆ˜μ •
Browse files Browse the repository at this point in the history
πŸ”§ Fix, πŸ“ Docs : 결제 μ·¨μ†Œ κ°œμ„  및 yml 파일 μˆ˜μ •
  • Loading branch information
eunjju2 authored Dec 8, 2024
2 parents 39f30a7 + 10f1484 commit 9ca93a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: |
touch .env
echo VITE_KAKAOMAP_APP_KEY=${{ secrets.VITE_KAKAOMAP_APP_KEY }} >> .env
echo VITE_APP_SERVER_URL=${{ secrets.VITE_APP_SERVER_URL }} >> .env
echo VITE_APP_SERVER_URL=https://recode.bumblebeestudy.shop >> .env
echo VITE_APP_TOSS_CLIENT_KEY=${{ secrets.VITE_APP_TOSS_CLIENT_KEY }} >> .env
cat .env
Expand Down
6 changes: 6 additions & 0 deletions src/pages/PaymentPage/components/PaymentButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { postPaymentsToss, postReservation } from '@apis/reservation';
import useSearchStore from '@store/searchStore';
import { PostPaymentsData } from '@typings/types';
import { toast } from 'react-toastify';
import { useNavigate } from 'react-router-dom';
import type {
ReservationFormData,
ErrorMessageType,
Expand Down Expand Up @@ -75,6 +76,8 @@ const PaymentButton = (props: PaymentButtonProps) => {
const customerKey = uuidv4();
const orderId = uuidv4();

const navigate = useNavigate();

const handlePayment = async (response: PostPaymentsData): Promise<void> => {
const tossPayments = await loadTossPayments(clientKey);
const payment = tossPayments.payment({ customerKey });
Expand Down Expand Up @@ -103,6 +106,9 @@ const PaymentButton = (props: PaymentButtonProps) => {
.catch((error) => {
if (error.code === 'USER_CANCEL') {
toast.error('μœ μ €κ°€ 결제λ₯Ό μ·¨μ†Œν–ˆμŠ΅λ‹ˆλ‹€');
navigate(
`/payment-fail?orderId=${response.orderId}&message=${error.message}&code=${error.code}`,
);
} else {
toast.error(error.message);
}
Expand Down

0 comments on commit 9ca93a4

Please sign in to comment.