인증결제창 요청 비인증 결제창 요청 비인증 API 방식
Copy IMP.request_pay({
pg : 'html5_inicis.{PG상점아이디}', //테스트 시 html5_inicis.INIpayTest 기재
pay_method : 'card',
merchant_uid: "order_no_0001", //상점에서 생성한 고유 주문번호
name : '주문명:결제테스트',
amount : 1004,
buyer_email : 'test@portone.io',
buyer_name : '구매자이름',
buyer_tel : '010-1234-5678', //필수 파라미터 입니다.
buyer_addr : '서울특별시 강남구 삼성동',
buyer_postcode : '123-456',
m_redirect_url : '{모바일에서 결제 완료 후 리디렉션 될 URL}',
escrow : true, //에스크로 결제인 경우 설정
vbank_due : 'YYYYMMDD'
bypass : {
acceptmethod : "noeasypay" // 간편결제 버튼을 통합결제창에서 제외(PC)
P_RESERVED: "noeasypay=Y" // 간편결제 버튼을 통합결제창에서 제외(모바일)
acceptmethod: 'cardpoint' // 카드포인트 사용시 설정(PC)
P_RESERVED : 'cp_yn=Y' // 카드포인트 사용시 설정(모바일)
},
period : {
from : "20200101", //YYYYMMDD
to : "20201231" //YYYYMMDD
}
}, function(rsp) { // callback 로직
//* ...중략... *//
});
주요 파라미터 설명
pg
* string
PG사 구분코드
html5_inicis.
{
PG상점아이디}
PG상점아이디는 KG 이니시스와 계약 후 발급받을 수 있습니다.
pay_method
* string
결제수단 구분코드
merchant_uid
* string
주문번호
매번 고유하게 채번되어야 합니다.
amount
* integer
결제금액
string 이 아닌점에 유의하세요
buyer_tel
* string
주문자연락처
필수 파라미터 입니다.
vbank_due
string
가상계좌 입금마감일시를 지정할수 있습니다.(미 지정시 Default 30일)
period
array
인증 결제창 제공기간을 표현할수 있습니다.
PG사 결제창으로 카드정보를 입력받고 빌링키를 발급할수 있습니다.
인증결제창 호출 파라미터에서 customer_uid 값을 추가하면 비 인증 결제창을 호출할 수 있습니다.
비 인증 결제창에서 빌링키를 발급받은 후 해당 빌링키로 결제를 요청합니다.
amount 파라미터에 금액을 설정하여도 실제 승인은 이루어지지 않습니다.
Copy IMP.request_pay({
pg : 'html5_inicis.{PG상점아이디}', // 실제 계약 후에는 실제 상점아이디로 변경
pay_method : 'card', // 'card'만 지원됩니다.
merchant_uid: "order_monthly_0001", // 상점에서 관리하는 주문 번호
name : '최초인증결제',
amount : 0, // 결제창에 표시될 금액. 실제 승인이 이뤄지지는 않습니다.
customer_uid : 'your-customer-unique-id', // 필수 입력.
buyer_email : 'test@portone.io',
buyer_name : '포트원',
buyer_tel : '02-1234-1234',
m_redirect_url : '{모바일에서 결제 완료 후 리디렉션 될 URL}'
}, function(rsp) {
if ( rsp.success ) {
alert('빌링키 발급 성공');
} else {
alert('빌링키 발급 실패');
}
});
주요 파라미터 설명
pg
* string
PG사 구분코드
**html5_inicis
**로 설정
KG이니시스에서 발급받은 상점아이디가 여러개(각각 일반 및 정기)인 경우에는 html5_inicis.{상점아이디} 또는 inicis.{상점아이디}(for ActiveX)로 지정합니다.
customer_uid
* string
카드 빌링키
비 인증 결제창에서 고객이 입력한 카드정보와 1:1로 매칭될 빌링키를 지정합니다.
amount
* Integer
결제금액
결제창에 표시될 금액으로 실제 승인은 이루어지지 않습니다. (실 결제를 발생시키기 위해서는 customer_uid 로 REST API 를 이용하여 결제요청 을 해주셔야 합니다.)
빌링키(customer_uid)로 결제 요청하기
Copy curl -H "Content-Type: application/json" \
-X POST -d '{"customer_uid":"your-customer-unique-id", "merchant_uid":"order_id_8237352", "amount":3000}' \
https://api.iamport.kr/subscribe/payments/again
API 방식으로 빌링키 발급,결제요청,예약결제를 구현할수 있습니다.
일회성 결제 요청하기
Copy curl -H "Content-Type: application/json" \
-X POST -d '{"merchant_uid":"order_id_8237352", "card_number":"1234-1234-1234-1234", "expiry":"2019-01", "birth":"123456", "amount":3000}' \
https://api.iamport.kr/subscribe/payments/onetime
빌링키 발급 요청하기
Copy curl -H "Content-Type: application/json" \
-X POST -d '{"card_number":"1234-1234-1234-1234", "expiry":"2025-12", "birth":"820213", "pwd_2digit":"00"}' \
https://api.iamport.kr/subscribe/customers/your-customer-unique-id
빌링키 발급 및 최초 결제 요청하기
customer_uid
: 빌링키 등록을 위해서 지정해야 합니다.
amount
: 0원 이상 설정시 빌링키 발급과 동시에 실결제가 발생됩니다.
Copy curl -H "Content-Type: application/json" \
-X POST -d '{"customer_uid":"your-customer-unique-id", "merchant_uid":"order_id_8237352", "card_number":"1234-1234-1234-1234", "expiry":"2019-01", "birth":"123456", "amount":3000}' \
https://api.iamport.kr/subscribe/payments/onetime
빌링키로 결제 요청하기
Copy curl -H "Content-Type: application/json" \
-X POST -d '{"customer_uid":"your-customer-unique-id", "merchant_uid":"order_id_8237352", "amount":3000}' \
https://api.iamport.kr/subscribe/payments/again
자세한 가이드는 아래 링크를 참조하세요
할부개월수 조정 카드사 모듈 바로 호출 카드사 노출 조작 영세율 상점부담무이자할부 설정
Copy display: {
card_quota: [6] // 할부개월 6개월만 활성화
}
파라미터 설명
card_quota : 지정한 숫자에 해당하는 할부개월수만 표기
2,3,4,5,6
: 일시불을 포함한 2, 3, 4, 5, 6 할부개월 선택 가능\
Copy card: {
direct: {
code: "367",
quota: 3
}
}
파라미터 설명
quota : 할부 개월 수. 일시불일 시 0 으로 지정. (integer )
Copy card : {
detail : [
{card_code:"*", enabled:false}, //모든 카드사 비활성화
{card_code:'366', enabled:true} //특정 카드만 활성화
]
}
파라미터 설명
enabled : 해당카드 활성화 여부 (boolean)
Copy // 영세율의 경우
amount: 1000,
tax_free: 0,
vat_amount: 0
파라미터 설명
vat_amount : 상점아이디(MID)에 영세율 설정된 경우 부가세(vat_amount) 및 면세금액(tax_free)를 0원으로 지정하여 영세율 결제 가능
주의사항
취소 시 요청된 값 그대로 이니시스에서 취소 가 되므로, 취소할 금액, 부가세, 면세금액을 정확하게 전달해 주셔야 부가세, 면세금액이 설정되어 정상적으로 취소가 된다는 점 주의해주시기 바랍니다.
실시간 계좌이체 및 가상계좌의 경우 현금영수증 발급하지 않으면 매출전표에 부가세가 나눠서 표시 되지 않습니다
이니시스 설정이 완료되었으면 아래와 같이 파라미터 설정하시면 됩니다.
Copy card : {
interest_free : 7, //모든 카드 7개월까지 상점분담무이자
}