feat: 도매상 API 통합 및 스키마 업데이트
- wholesale 패키지 연동 (SooinSession, GeoYoungSession) - Flask Blueprint 분리 (sooin_api.py, geoyoung_api.py) - order_context 스키마 확장 (wholesaler_id, internal_code 등) - 수인약품 개별 취소 기능 (cancel_item, restore_item) - 문서 추가: WHOLESALE_API_INTEGRATION.md - 테스트 스크립트들
This commit is contained in:
33
backend/test_del_pc.py
Normal file
33
backend/test_del_pc.py
Normal file
@@ -0,0 +1,33 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""pc 파라미터로 삭제 테스트"""
|
||||
from sooin_api import SooinSession
|
||||
|
||||
session = SooinSession()
|
||||
session.login()
|
||||
|
||||
# 장바구니 확인
|
||||
resp = session.session.get('http://sooinpharm.co.kr/Service/Order/Bag.asp?currVenCd=50911')
|
||||
|
||||
# hidden input들 확인
|
||||
import re
|
||||
hiddens = re.findall(r'name="(pc_\d+|idx_\d+|bagIdx_\d+)"[^>]*value="([^"]*)"', resp.text)
|
||||
print('Hidden fields:')
|
||||
for name, val in hiddens[:10]:
|
||||
print(f' {name}: {val}')
|
||||
|
||||
# 장바구니 iframe의 실제 삭제 로직 찾기
|
||||
# del + pc 조합 시도
|
||||
print('\ndel with pc 시도...')
|
||||
resp = session.session.get(
|
||||
'http://sooinpharm.co.kr/Service/Order/BagOrder.asp',
|
||||
params={
|
||||
'kind': 'delOne',
|
||||
'idx': '0',
|
||||
'pc': '31840', # 스틸녹스 코드
|
||||
'currVenCd': '50911'
|
||||
}
|
||||
)
|
||||
|
||||
# 결과
|
||||
cart = session.get_cart()
|
||||
print(f'삭제 후: {cart.get("total_items", 0)}개')
|
||||
Reference in New Issue
Block a user