Skip to content

Commit

Permalink
Merge pull request #70 from URECA-PODONG/feat/#6
Browse files Browse the repository at this point in the history
오류 및 결제 수정
  • Loading branch information
Suh-code authored Nov 5, 2024
2 parents c1913fa + 39d0290 commit 5134150
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/Router.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ function Router() {
<Route path="payCancelReq" element={<PayCancelReq />} />
<Route path="paymentEnd" element={<PaymentEnd />} />
<Route path="paymentHistory" element={<PaymentHistory />} />
<Route path="paymentlist" element={<PaymentHistory />} />
<Route path="paymentCancelDone" element={<PaymentCancelDone />} />

<Route path="mainpage/:userId" element={<MainPage />} />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MainPage/MainPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -375,4 +375,4 @@ const PageButton = styled.button`
&:hover {
color: #ff6e00;
}
`;
`;
2 changes: 1 addition & 1 deletion src/pages/MainPage/ShoppingDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ShoppingDetail = () => {
};

axios
.post('/api/carts', cartItem)
.post('/carts', cartItem)
.then(response => {
alert(response.data);
setCartModalOpen(false); // 장바구니에 담기 성공 후 팝업창 닫기
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PaymentPage/PayCancelReq.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function PayCancelReq() {
</RefundInfo>
<CancelButton onClick={handleCancel}>결제 취소</CancelButton>

{isCancelRequested && <CancelPay userId={1} />}
{isCancelRequested && <CancelPay userId />}
</OrderCancellationWrapper>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PaymentPage/Payment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const Payment = () => {
pg: 'html5_inicis', // PG사명
pay_method: 'card', // 결제수단
merchant_uid: `mid_${new Date().getTime()}`, // 주문번호 (중복되지 않도록 생성)
name: cartData.productTitle, // 결제명
name: cartData[0].productTitle, // 결제명
amount: orderItems.reduce((total, item) => total + item.productLprice * item.quantity, 0).toLocaleString(), // 결제 금액
buyer_email: userData.accountEmail, // 구매자 이메일
buyer_name: userData.nickname, // 구매자 이름
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PaymentPage/PaymentHistory.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const CardItem = styled.div`
`;

const PaymentHistory = () => {
const userId = 1;
const userId = localStorage.getItem('userId');
const [payments, setPayments] = useState([]);
const [tabCounts, setTabCounts] = useState({ total: 0, completed: 0, cancelled: 0, failed: 0 });

Expand Down
2 changes: 1 addition & 1 deletion src/pages/ShoppingCart/ShoppingCart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const ShoppingCart = () => {
const [selectedItems, setSelectedItems] = useState([]);
const [totalProductPrice, setTotalProductPrice] = useState(0);
const navigate = useNavigate();
const userId = 2;

const userId = localStorage.getItem('userId');
// 장바구니 로드 시 가격 계산
useEffect(() => {
loadCart(userId);
Expand Down

0 comments on commit 5134150

Please sign in to comment.