@portone/browser-sdk
Version:
PortOne SDK for browser
199 lines (198 loc) • 6.5 kB
TypeScript
import { PaymentUIType } from '../entity/PaymentUIType.js';
import type { StoreId } from '../entity/StoreId.js';
import type { PaymentOrderName } from '../entity/PaymentOrderName.js';
import type { PaymentTotalAmount } from '../entity/PaymentTotalAmount.js';
import type { ChannelKey } from '../entity/ChannelKey.js';
import type { TaxFreeAmount } from '../entity/TaxFreeAmount.js';
import type { VatAmount } from '../entity/VatAmount.js';
import type { Customer } from '../entity/Customer.js';
import type { RedirectUrl } from '../entity/RedirectUrl.js';
import type { Product } from '../entity/Product.js';
import { Currency } from '../entity/Currency.js';
import { Locale } from '../entity/Locale.js';
import type { OfferPeriod } from '../entity/OfferPeriod.js';
import { ProductType } from '../entity/ProductType.js';
import type { StoreDetails } from '../entity/StoreDetails.js';
import type { LoadPaymentUIBypass } from '../entity/bypass/LoadPaymentUIBypass.js';
import { Country } from '../entity/Country.js';
import type { Address } from '../entity/Address.js';
export type LoadPaymentUIRequest = {
uiType: PaymentUIType;
/**
* **상점 아이디**
*
* 포트원 계정에 생성된 상점을 식별하는 고유한 값으로 [관리자 콘솔 > 연동 정보](https://admin.portone.io/integration-v2/manage/channel) 우측 상단에서 확인할 수 있습니다.
*/
storeId: StoreId;
/**
* **결제 ID**
*
* 고객사에서 임의로 ID를 정합니다.
*
* 이미 결제 완료된 `paymentId`로 결제를 요청하는 경우 실패합니다.
*/
paymentId: string;
/**
* **주문명**
*/
orderName: PaymentOrderName;
/**
* **결제 금액**
*
* 결제 금액을 정수로 나타냅니다.
*
* 해외 통화의 경우 통화의 최소 단위(minor unit)를 기준으로 합니다. 예를 들어, USD의 최소 단위는 센트(0.01 USD)이므로, 6 USD의 경우 100배하여 600으로 입력합니다.
*
* 최소 단위는 [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html)에 표준화된 것을 기준으로 합니다.
*
* - KRW: 1배
* - USD: 100배
* - JPY: 1배
*/
totalAmount: PaymentTotalAmount;
/**
* **채널 키**
*
* 포트원에 등록된 결제 채널 중 하나를 지정합니다.
*
* [관리자 콘솔 > 연동 정보](https://admin.portone.io/integration-v2/manage/channel)에서 채널 연동 후 채널 키를 확인할 수 있습니다.
*
* 채널 키와 채널 그룹 ID 중 하나를 지정해야 합니다.
*/
channelKey: ChannelKey;
/**
* **면세 금액**
*
* 미입력 시 0으로 취급됩니다.
*/
taxFreeAmount?: TaxFreeAmount | undefined;
/**
* **부가세 금액**
*
* 미입력 시 과세 금액의 1/11로 자동 계산됩니다.
*/
vatAmount?: VatAmount | undefined;
customer?: Customer | undefined;
/**
* **리디렉션 방식에서 결제 완료 후 이동할 URL**
*
* 결제사 페이지로 이동하여 진행하는 리디렉션 방식의 경우 필수로 설정해야 합니다. 대부분의 모바일 환경이 리디렉션 방식에 해당됩니다.
*/
redirectUrl?: RedirectUrl | undefined;
/**
* 웹훅 URL
*/
noticeUrls?: string[] | undefined;
/**
* Confirm URL
*/
confirmUrl?: string | undefined;
/**
* 앱 URL Scheme
*/
appScheme?: string | undefined;
/**
* 에스크로 결제 여부
*/
isEscrow?: boolean | undefined;
/**
* 구매 상품 정보
*/
products?: Product[] | undefined;
/**
* 문화비 지출 여부
*/
isCulturalExpense?: boolean | undefined;
/**
* **화폐**
*
* [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 화폐 코드
*
* 대한민국 원, 일본 엔이 아닌 화폐를 사용할 때에는 금액을 minor unit 단위로 입력해야 함에 유의하세요.
*/
currency: Currency;
/**
* **UI 언어**
*
* KG이니시스, 스마트로, KSNET, 웰컴페이먼츠 (PC), 한국결제네트웍스, 엑심베이에서 설정 가능하며, PG마다 지원하는 언어 목록은 차이가 있습니다.
*/
locale?: Locale | undefined;
/**
* **결제 정보와 함께 관리하고 싶은 고객사 커스텀 JSON 데이터**
*/
customData?: Record<string, any> | undefined;
/**
* **서비스 제공 기간**
*
* range와 interval 중 하나를 입력해주세요.
*
* - range: 제공 기간 범위
* - interval: 제공 기간 주기
*
* 예1) 2023년 1월 1일 00시 00분 00초(KST) ~
*
* ```js
* range: {
* from: '2023-01-01T00:00:00+09:00'
* }
* ```
*
* 예2) ~ 2023년 1월 1일 00시 00분 00초(KST)
*
* ```js
* range: {
* to: '2023-01-01T00:00:00+09:00'
* }
* ```
*
* 예3) 2023년 1월 1일 00시 00분 00초(KST) ~ 2023년 12월 31일 23시 59분 59초(KST)
*
* ```js
* range: {
* from: '2023-12-31T23:59:59+09:00'
* to: '2023-01-01T00:00:00+09:00'
* }
* ```
*
* 예4) 30일 주기
* `interval: '30d'`
*
* 예5) 6개월 주기
* `interval: '6m'`
*
* 예6) 1년 주기
* `interval: '1y'`
*/
offerPeriod?: OfferPeriod | undefined;
/**
* **상품 유형**
*/
productType?: ProductType | undefined;
/**
* **상점 정보**
*
* - KSNET 카카오페이의 경우 필수 입력
* - 나이스페이먼츠의 경우 매출 전표에 표기 할 용도로 선택 입력
* - KG이니시스 일본결제의 경우 JPPG(gmoPayment) 결제의 상점정보로 사용되거나 편의점 결제 시 영수증 표시 정보로 사용됨.
*/
storeDetails?: StoreDetails | undefined;
bypass?: LoadPaymentUIBypass | undefined;
/**
* **국가**
*
* [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) 코드입니다.
*/
country?: Country | undefined;
/**
* 배송지 주소
*/
shippingAddress?: Address | undefined;
/**
* 프로모션 그룹 ID
*/
promotionGroupId?: string | undefined;
/**
* 프로모션 ID 목록
*/
promotionIds?: string[] | undefined;
};