Skip to content

Commit c3348ef

Browse files
committed
버전 0.9.0 작업, 패키징 방식 변경
1 parent 9358ab6 commit c3348ef

File tree

9 files changed

+74
-435
lines changed

9 files changed

+74
-435
lines changed

.github/workflows/build.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ jobs:
2121
pip install -r requirements.txt
2222
- name: Run unit tests
2323
run: |
24-
python -m pytest --cov=iamport tests
24+
python -m pytest --cov=iamport
2525
- name: Run convention tests
2626
run: |
27-
python -m flake8 iamport tests --ignore E203,W503,W504
27+
python -m flake8 iamport tests
2828
- name: Run type check
2929
run: |
30-
python -m mypy iamport
30+
python -m mypy iamport tests
3131
- name: Run import sort check
3232
run: |
33-
python -m isort iamport tests --diff
33+
python -m isort iamport tests --diff

README.md

+20-21
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ python -m pip install git+https://github.com/iamport/iamport-rest-client-python.
5555

5656
사용 준비
5757
-------
58+
5859
```python
5960
from iamport import Iamport
6061

6162
# 아임포트 객체를 테스트용 키와 시크릿을 사용하여 생성합니다 (테스트시 지출된 금액은 매일 자정 이전 환불됩니다).
6263
iamport = Iamport(
63-
imp_key='imp_apikey',
64+
imp_key='imp_apikey',
6465
imp_secret=(
6566
'ekKoeW8RyKuT0zgaZsUtXXTLQ4AhPFW3ZGseDA6b'
6667
'kA5lamv9OqDMnxyeB9wqOsuO9W3Mx9YSJ4dTqJ3f'
@@ -102,20 +103,20 @@ iamport.is_paid(product_price, response=response)
102103

103104
```python
104105
# 상품 아이디로 취소
105-
response = iamport.cancel(u'취소하는 이유', merchant_uid='{상품 아이디}')
106+
response = iamport.cancel('취소하는 이유', merchant_uid='{상품 아이디}')
106107

107108
# I'mport; 아이디로 취소
108-
response = iamport.cancel(u'취소하는 이유', imp_uid='{IMP UID}')
109+
response = iamport.cancel('취소하는 이유', imp_uid='{IMP UID}')
109110

110111
# 취소시 오류 예외처리(이미 취소된 결제는 에러가 발생함)
111112
try:
112-
response = iamport.cancel(u'취소하는 이유', imp_uid='{IMP UID}')
113+
response = iamport.cancel('취소하는 이유', imp_uid='{IMP UID}')
113114
except Iamport.ResponseError as e:
114-
print e.code
115-
print e.message # 에러난 이유를 알 수 있음
115+
print(e.code)
116+
print(e.message) # 에러난 이유를 알 수 있음
116117
except Iamport.HttpError as http_error:
117-
print http_error.code
118-
print http_error.reason # HTTP not 200 에러난 이유를 알 수 있음
118+
print(http_error.code)
119+
print(http_error.reason) # HTTP not 200 에러난 이유를 알 수 있음
119120
```
120121

121122
1회성 비인증 결제를 진행합니다.
@@ -174,26 +175,24 @@ payload = {
174175
'schedules': [
175176
{
176177
'merchant_uid': 'test_merchant_01',
177-
# UNIX timestamp
178-
'schedule_at': 1478150985,
179-
'amount': 1004
178+
'schedule_at': 1478150985, # UNIX timestamp
179+
'amount': 1004
180180
},
181181
{
182182
'merhcant_uid': 'test_merchant_02',
183-
# UNIX timestamp
184-
'schedule_at': 1478150985,
185-
'amount': 5000,
186-
'name': '{주문명}',
187-
'buyer_name': '{주문자명}',
188-
'buyer_email': '{주문자 이메일}',
189-
'buyer_tel': '{주문자 전화번호}',
190-
'buyer_addr': '{주문자 주소}',
191-
'buyer_postcode': '{주문자 우편번호}',
183+
'schedule_at': 1478150985, # UNIX timestamp
184+
'amount': 5000,
185+
'name': '{주문명}',
186+
'buyer_name': '{주문자명}',
187+
'buyer_email': '{주문자 이메일}',
188+
'buyer_tel': '{주문자 전화번호}',
189+
'buyer_addr': '{주문자 주소}',
190+
'buyer_postcode': '{주문자 우편번호}',
192191
},
193192
]
194193
}
195194
try:
196-
reponse = iamport.pay_schedule(**payload)
195+
response = iamport.pay_schedule(**payload)
197196
except KeyError:
198197
# 필수 값이 없을때 에러 처리
199198
pass

0 commit comments

Comments
 (0)