@bootpay/backend-js
Advanced tools
+12
-1
@@ -0,3 +1,14 @@ | ||
| ### 2.1.4 | ||
| * 날짜 타입을 string -> Date 로 명시적으로 수정 | ||
| ### 2.1.3 | ||
| * 정기결제요청시 feedback_url, metadata, content_type 파라미터 정의 추가 | ||
| ### 2.1.2 | ||
| * 버전 재배포 | ||
| ### 2.1.1 | ||
| * 정기결제 예약시 order_id 파라미터 정의 추가 | ||
| ### 2.1.0 | ||
| * 결제취소 요청시 refund optional 로 수정 | ||
@@ -4,0 +15,0 @@ |
+56
-2
| import { BootpayBackendNodejsResource } from './lib/resource'; | ||
| import { AccessTokenResponseParameters, CancelPaymentParameters, CertificateResponseParameters, DestroySubscribeResponseParameters, ReceiptResponseParameters, SubscriptionBillingRequestParameters, SubscriptionBillingResponseParameters, SubscriptionCardPaymentRequestParameters, UserTokenRequestParameters, UserTokenResponseParameters, SubscribePaymentReserveParameters, SubscribePaymentReserveResponse, CancelSubscribeReserveResponse, ShippingRequestParameters } from './lib/response'; | ||
| import { AccessTokenResponseParameters, CancelPaymentParameters, CertificateResponseParameters, DestroySubscribeResponseParameters, ReceiptResponseParameters, SubscriptionBillingRequestParameters, SubscriptionBillingResponseParameters, SubscriptionCardPaymentRequestParameters, UserTokenRequestParameters, UserTokenResponseParameters, SubscribePaymentReserveParameters, SubscribePaymentReserveResponse, CancelSubscribeReserveResponse, ShippingRequestParameters, CashReceiptPublishOnReceiptParameters, CashReceiptCancelOnReceiptParameters, RequestCashReceiptParameters, CancelCashReceiptParameters, RequestAuthenticateParameters, SubscribePaymentLookupResponse } from './lib/response'; | ||
| declare class BootpayBackendNodejs extends BootpayBackendNodejsResource { | ||
@@ -15,4 +15,5 @@ constructor(); | ||
| * @param receiptId: string | ||
| * @param lookupUserData: boolean | ||
| */ | ||
| receiptPayment(receiptId: string): Promise<ReceiptResponseParameters>; | ||
| receiptPayment(receiptId: string, lookupUserData?: boolean): Promise<ReceiptResponseParameters>; | ||
| /** | ||
@@ -82,2 +83,10 @@ * Cancel Payment | ||
| /** | ||
| * SubscribeReserve Lookup | ||
| * Comment by GOSOMI | ||
| * @date: 2023-03-07 | ||
| * @param reserveId: string | ||
| * @returns Promise<SubscribeLookupResponse> | ||
| */ | ||
| subscribePaymentReserveLookup(reserveId: string): Promise<SubscribePaymentLookupResponse>; | ||
| /** | ||
| * cancelSubscribeReserve | ||
@@ -95,4 +104,49 @@ * Comment by GOSOMI | ||
| shippingStart(shippingRequest: ShippingRequestParameters): Promise<ReceiptResponseParameters | any>; | ||
| /** | ||
| * 기존결제 현금영수증 발행 API | ||
| * Comment by GOSOMI | ||
| * @date: 2022-07-28 | ||
| */ | ||
| cashReceiptPublishOnReceipt(cashReceiptPublishRequest: CashReceiptPublishOnReceiptParameters): Promise<ReceiptResponseParameters>; | ||
| /** | ||
| * 기존 결제 현금영수증 발행 취소 API | ||
| * Comment by GOSOMI | ||
| * @date: 2022-08-09 | ||
| */ | ||
| cashReceiptCancelOnReceipt(cashReceiptCancelRequest: CashReceiptCancelOnReceiptParameters): Promise<null>; | ||
| /** | ||
| * 별건 현금영수증 발행하기 | ||
| * Comment by GOSOMI | ||
| * @date: 2022-08-09 | ||
| */ | ||
| requestCashReceipt(cashReceiptRequest: RequestCashReceiptParameters): Promise<ReceiptResponseParameters>; | ||
| /** | ||
| * 별건 현금영수증 취소하기 | ||
| * Comment by GOSOMI | ||
| * @date: 2022-08-09 | ||
| */ | ||
| cancelCashReceipt(cancelCashReceiptRequest: CancelCashReceiptParameters): Promise<ReceiptResponseParameters>; | ||
| /** | ||
| * 본인인증 REST API 요청 | ||
| * Comment by GOSOMI | ||
| * @date: 2022-11-07 | ||
| */ | ||
| requestAuthentication(authenticateRequest: RequestAuthenticateParameters): Promise<CertificateResponseParameters>; | ||
| /** | ||
| * 본인인증 승인하기 | ||
| * Comment by GOSOMI | ||
| * @date: 2022-11-07 | ||
| */ | ||
| confirmAuthentication(receipt_id: string, otp?: null | string): Promise<CertificateResponseParameters>; | ||
| /** | ||
| * 본인인증 SMS 재전송 | ||
| * Comment by GOSOMI | ||
| * @date: 2022-11-07 | ||
| */ | ||
| realarmAuthentication(receipt_id: string): Promise<CertificateResponseParameters>; | ||
| } | ||
| declare const Bootpay: BootpayBackendNodejs; | ||
| export { Bootpay }; | ||
| export default Bootpay; | ||
| export * from './lib/response'; | ||
| export * from './lib/resource'; |
+262
-146
| "use strict"; | ||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
| }); | ||
| var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| var desc = Object.getOwnPropertyDescriptor(m, k); | ||
| if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
| desc = { enumerable: true, get: function() { return m[k]; } }; | ||
| } | ||
| Object.defineProperty(o, k2, desc); | ||
| }) : (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| o[k2] = m[k]; | ||
| })); | ||
| var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
| for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
| }; | ||
@@ -23,18 +28,16 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
| */ | ||
| getAccessToken() { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const { application_id, private_key } = this.bootpayConfiguration; | ||
| const response = yield this.post('request/token', { | ||
| application_id, | ||
| private_key | ||
| }); | ||
| // set Token | ||
| this.setToken(response.access_token); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async getAccessToken() { | ||
| try { | ||
| const { application_id, private_key } = this.bootpayConfiguration; | ||
| const response = await this.post('request/token', { | ||
| application_id, | ||
| private_key | ||
| }); | ||
| // set Token | ||
| this.setToken(response.access_token); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
@@ -45,13 +48,12 @@ /** | ||
| * @param receiptId: string | ||
| * @param lookupUserData: boolean | ||
| */ | ||
| receiptPayment(receiptId) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.get(`receipt/${receiptId}`); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async receiptPayment(receiptId, lookupUserData = false) { | ||
| try { | ||
| const response = await this.get(`receipt/${receiptId}?lookup_user_data=${lookupUserData ? 'true' : 'false'}`); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
@@ -64,12 +66,12 @@ /** | ||
| */ | ||
| cancelPayment(cancelPayment) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.post('cancel', Object.assign({}, cancelPayment)); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async cancelPayment(cancelPayment) { | ||
| try { | ||
| const response = await this.post('cancel', { | ||
| ...cancelPayment | ||
| }); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
@@ -82,12 +84,10 @@ /** | ||
| */ | ||
| certificate(receiptId) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.get(`certificate/${receiptId}`); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async certificate(receiptId) { | ||
| try { | ||
| const response = await this.get(`certificate/${receiptId}`); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
@@ -100,14 +100,12 @@ /** | ||
| */ | ||
| confirmPayment(receiptId) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.post('confirm', { | ||
| receipt_id: receiptId | ||
| }); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async confirmPayment(receiptId) { | ||
| try { | ||
| const response = await this.post('confirm', { | ||
| receipt_id: receiptId | ||
| }); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
@@ -120,12 +118,10 @@ /** | ||
| */ | ||
| lookupSubscribeBillingKey(receiptId) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.get(`subscribe/billing_key/${receiptId}`); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async lookupSubscribeBillingKey(receiptId) { | ||
| try { | ||
| const response = await this.get(`subscribe/billing_key/${receiptId}`); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
@@ -138,12 +134,12 @@ /** | ||
| */ | ||
| requestSubscribeBillingKey(subscriptionBillingRequest) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.post('request/subscribe', Object.assign({}, subscriptionBillingRequest)); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async requestSubscribeBillingKey(subscriptionBillingRequest) { | ||
| try { | ||
| const response = await this.post('request/subscribe', { | ||
| ...subscriptionBillingRequest | ||
| }); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
@@ -156,12 +152,12 @@ /** | ||
| */ | ||
| requestSubscribeCardPayment(subscriptionCardRequest) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.post('subscribe/payment', Object.assign({}, subscriptionCardRequest)); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async requestSubscribeCardPayment(subscriptionCardRequest) { | ||
| try { | ||
| const response = await this.post('subscribe/payment', { | ||
| ...subscriptionCardRequest | ||
| }); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
@@ -174,12 +170,10 @@ /** | ||
| */ | ||
| destroyBillingKey(billingKey) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.delete(`subscribe/billing_key/${billingKey}`); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async destroyBillingKey(billingKey) { | ||
| try { | ||
| const response = await this.delete(`subscribe/billing_key/${billingKey}`); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
@@ -192,12 +186,12 @@ /** | ||
| */ | ||
| requestUserToken(userTokenRequest) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.post('request/user/token', Object.assign({}, userTokenRequest)); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async requestUserToken(userTokenRequest) { | ||
| try { | ||
| const response = await this.post('request/user/token', { | ||
| ...userTokenRequest | ||
| }); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
@@ -210,14 +204,30 @@ /** | ||
| */ | ||
| subscribePaymentReserve(subscribePaymentReserveRequest) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.post('subscribe/payment/reserve', Object.assign({}, subscribePaymentReserveRequest)); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async subscribePaymentReserve(subscribePaymentReserveRequest) { | ||
| try { | ||
| const response = await this.post('subscribe/payment/reserve', { | ||
| ...subscribePaymentReserveRequest | ||
| }); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
| /** | ||
| * SubscribeReserve Lookup | ||
| * Comment by GOSOMI | ||
| * @date: 2023-03-07 | ||
| * @param reserveId: string | ||
| * @returns Promise<SubscribeLookupResponse> | ||
| */ | ||
| async subscribePaymentReserveLookup(reserveId) { | ||
| try { | ||
| const response = await this.get(`subscribe/payment/reserve/${reserveId}`); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
| /** | ||
| * cancelSubscribeReserve | ||
@@ -228,12 +238,10 @@ * Comment by GOSOMI | ||
| */ | ||
| cancelSubscribeReserve(reserveId) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.delete(`subscribe/payment/reserve/${reserveId}`); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async cancelSubscribeReserve(reserveId) { | ||
| try { | ||
| const response = await this.delete(`subscribe/payment/reserve/${reserveId}`); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
@@ -245,15 +253,123 @@ /** | ||
| */ | ||
| shippingStart(shippingRequest) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.put(`escrow/shipping/start/${shippingRequest.receipt_id}`, shippingRequest); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async shippingStart(shippingRequest) { | ||
| try { | ||
| const response = await this.put(`escrow/shipping/start/${shippingRequest.receipt_id}`, shippingRequest); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
| /** | ||
| * 기존결제 현금영수증 발행 API | ||
| * Comment by GOSOMI | ||
| * @date: 2022-07-28 | ||
| */ | ||
| async cashReceiptPublishOnReceipt(cashReceiptPublishRequest) { | ||
| try { | ||
| const response = await this.post('request/receipt/cash/publish', cashReceiptPublishRequest); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
| /** | ||
| * 기존 결제 현금영수증 발행 취소 API | ||
| * Comment by GOSOMI | ||
| * @date: 2022-08-09 | ||
| */ | ||
| async cashReceiptCancelOnReceipt(cashReceiptCancelRequest) { | ||
| try { | ||
| const response = await this.delete(`request/receipt/cash/cancel/${cashReceiptCancelRequest.receipt_id}`, { | ||
| params: cashReceiptCancelRequest | ||
| }); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
| /** | ||
| * 별건 현금영수증 발행하기 | ||
| * Comment by GOSOMI | ||
| * @date: 2022-08-09 | ||
| */ | ||
| async requestCashReceipt(cashReceiptRequest) { | ||
| try { | ||
| const response = await this.post('request/cash/receipt', cashReceiptRequest); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
| /** | ||
| * 별건 현금영수증 취소하기 | ||
| * Comment by GOSOMI | ||
| * @date: 2022-08-09 | ||
| */ | ||
| async cancelCashReceipt(cancelCashReceiptRequest) { | ||
| try { | ||
| const response = await this.delete(`request/cash/receipt/${cancelCashReceiptRequest.receipt_id}`, { | ||
| params: cancelCashReceiptRequest | ||
| }); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
| /** | ||
| * 본인인증 REST API 요청 | ||
| * Comment by GOSOMI | ||
| * @date: 2022-11-07 | ||
| */ | ||
| async requestAuthentication(authenticateRequest) { | ||
| try { | ||
| const response = await this.post('request/authentication', authenticateRequest); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
| /** | ||
| * 본인인증 승인하기 | ||
| * Comment by GOSOMI | ||
| * @date: 2022-11-07 | ||
| */ | ||
| async confirmAuthentication(receipt_id, otp = null) { | ||
| try { | ||
| const response = await this.post('authenticate/confirm', { | ||
| receipt_id, | ||
| otp | ||
| }); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
| /** | ||
| * 본인인증 SMS 재전송 | ||
| * Comment by GOSOMI | ||
| * @date: 2022-11-07 | ||
| */ | ||
| async realarmAuthentication(receipt_id) { | ||
| try { | ||
| const response = await this.post('authenticate/realarm', { | ||
| receipt_id | ||
| }); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
| } | ||
| const Bootpay = new BootpayBackendNodejs(); | ||
| exports.Bootpay = Bootpay; | ||
| exports.default = Bootpay; | ||
| __exportStar(require("./lib/response"), exports); | ||
| __exportStar(require("./lib/resource"), exports); |
@@ -15,3 +15,3 @@ import { AxiosInstance, AxiosRequestConfig } from 'axios'; | ||
| private_key: string; | ||
| mode: 'development' | 'production' | 'stage'; | ||
| mode?: 'development' | 'production' | 'stage'; | ||
| } | ||
@@ -21,5 +21,7 @@ export declare class BootpayBackendNodejsResource { | ||
| $token?: string; | ||
| mode: string; | ||
| mode: 'development' | 'production' | 'stage'; | ||
| bootpayConfiguration: BootpayConfiguration; | ||
| API_ENTRYPOINTS: BootpayEntrypoints; | ||
| apiVersion: string; | ||
| sdkVersion: string; | ||
| constructor(); | ||
@@ -35,2 +37,8 @@ /** | ||
| /** | ||
| * SET API Version | ||
| * Comment by GOSOMI | ||
| * @date: 2022-07-29 | ||
| */ | ||
| setApiVersion(version: string): void; | ||
| /** | ||
| * Set Access Token | ||
@@ -37,0 +45,0 @@ * Comment by GOSOMI |
+56
-50
| "use strict"; | ||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
| }); | ||
| var __importDefault = (this && this.__importDefault) || function (mod) { | ||
| return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.BootpayBackendNodejsResource = void 0; | ||
| const axios_1 = require("axios"); | ||
| // @ts-expect-error | ||
| const axios_1 = __importDefault(require("axios")); | ||
| class BootpayBackendNodejsResource { | ||
| $http; | ||
| $token; | ||
| mode; | ||
| bootpayConfiguration; | ||
| API_ENTRYPOINTS; | ||
| apiVersion = '4.3.4'; | ||
| sdkVersion = '2.2.10'; | ||
| constructor() { | ||
@@ -50,2 +52,3 @@ this.mode = 'production'; | ||
| }); | ||
| // @ts-expect-error | ||
| this.$http.interceptors.request.use((config) => { | ||
@@ -58,2 +61,5 @@ if (config.headers !== undefined) { | ||
| config.headers['Accept'] = 'application/json'; | ||
| config.headers['BOOTPAY-SDK-VERSION'] = this.sdkVersion; | ||
| config.headers['BOOTPAY-API-VERSION'] = this.apiVersion; | ||
| config.headers['BOOTPAY-SDK-TYPE'] = 301; | ||
| } | ||
@@ -79,2 +85,10 @@ return config; | ||
| /** | ||
| * SET API Version | ||
| * Comment by GOSOMI | ||
| * @date: 2022-07-29 | ||
| */ | ||
| setApiVersion(version) { | ||
| this.apiVersion = version; | ||
| } | ||
| /** | ||
| * Set Access Token | ||
@@ -88,49 +102,41 @@ * Comment by GOSOMI | ||
| entrypoints(url) { | ||
| return [this.API_ENTRYPOINTS[this.bootpayConfiguration.mode], url].join('/'); | ||
| return [this.API_ENTRYPOINTS[this.bootpayConfiguration.mode === undefined ? 'production' : this.bootpayConfiguration.mode], url].join('/'); | ||
| } | ||
| get(url, config) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.$http.get(this.entrypoints(url), config); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async get(url, config) { | ||
| try { | ||
| const response = await this.$http.get(this.entrypoints(url), config); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
| post(url, data, config) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.$http.post(this.entrypoints(url), data, config); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async post(url, data, config) { | ||
| try { | ||
| const response = await this.$http.post(this.entrypoints(url), data, config); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
| put(url, data, config) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.$http.put(this.entrypoints(url), data, config); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async put(url, data, config) { | ||
| try { | ||
| const response = await this.$http.put(this.entrypoints(url), data, config); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
| delete(url, config) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| try { | ||
| const response = yield this.$http.delete(this.entrypoints(url), config); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| }); | ||
| async delete(url, config) { | ||
| try { | ||
| const response = await this.$http.delete(this.entrypoints(url), config); | ||
| return Promise.resolve(response); | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| } | ||
| } | ||
| exports.BootpayBackendNodejsResource = BootpayBackendNodejsResource; |
+124
-13
@@ -26,2 +26,4 @@ export interface AccessTokenResponseParameters { | ||
| status: number; | ||
| status_locale: string; | ||
| receipt_url?: string; | ||
| card_data?: CardData; | ||
@@ -32,2 +34,7 @@ phone_data?: PhoneData; | ||
| escrow_data?: EscrowData; | ||
| cash_receipt_data?: CashReceiptData; | ||
| naver_point_data?: NaverPointData; | ||
| kakao_moneny_data?: KakaoMoneyData; | ||
| payco_point_data?: PaycoPointData; | ||
| toss_point_data?: TossPointData; | ||
| } | ||
@@ -60,4 +67,5 @@ export interface ExtraModel { | ||
| card_company_code: string; | ||
| card_type: string; | ||
| card_type: number; | ||
| card_hash?: string; | ||
| rtn_key_info?: string; | ||
| } | ||
@@ -72,3 +80,3 @@ export interface CardData { | ||
| card_interest: string; | ||
| receipt_url: string; | ||
| receipt_url?: string; | ||
| card_type?: string; | ||
@@ -82,2 +90,3 @@ card_owner_type?: string; | ||
| phone?: string; | ||
| receipt_url?: string; | ||
| } | ||
@@ -95,2 +104,3 @@ export interface BankData { | ||
| cash_receipt_no?: string; | ||
| receipt_url?: string; | ||
| } | ||
@@ -103,2 +113,20 @@ export interface EscrowData { | ||
| } | ||
| export interface CashReceiptData { | ||
| tid?: string; | ||
| cash_receipt_type?: number; | ||
| cash_receipt_no?: string; | ||
| receipt_url?: string; | ||
| } | ||
| export interface KakaoMoneyData { | ||
| tid?: string; | ||
| } | ||
| export interface NaverPointData { | ||
| tid?: string; | ||
| } | ||
| export interface PaycoPointData { | ||
| tid?: string; | ||
| } | ||
| export interface TossPointData { | ||
| tid?: string; | ||
| } | ||
| export interface CancelPaymentParameters { | ||
@@ -111,3 +139,3 @@ receipt_id: string; | ||
| cancel_message?: string; | ||
| refund: Refund; | ||
| refund?: Refund; | ||
| } | ||
@@ -122,13 +150,21 @@ export interface Refund { | ||
| authenticate_id: string; | ||
| pg: string; | ||
| method: string; | ||
| method_origin: string; | ||
| method_origin_symbol: string; | ||
| authenticated_at: Date; | ||
| requested_at: Date; | ||
| status: number; | ||
| status_locale: string; | ||
| authenticate_data: AuthenticateData; | ||
| } | ||
| export interface AuthenticateData { | ||
| name?: string; | ||
| phone?: string; | ||
| unique: string; | ||
| birth: Date; | ||
| gender: number; | ||
| unique?: string; | ||
| birth?: Date; | ||
| gender?: number; | ||
| foreigner?: number; | ||
| carrier?: string; | ||
| number_of_realarms?: number; | ||
| tid: string; | ||
@@ -146,7 +182,7 @@ } | ||
| card_expire_month: string; | ||
| price: number; | ||
| tax_free: number; | ||
| price?: number; | ||
| tax_free?: number; | ||
| extra: ExtraModel; | ||
| user: UserModel; | ||
| metadata: object; | ||
| metadata?: object; | ||
| } | ||
@@ -158,9 +194,14 @@ export interface SubscriptionBillingResponseParameters { | ||
| subscription_id: string; | ||
| gateway_url?: string; | ||
| metadata: object; | ||
| pg: string; | ||
| method: string; | ||
| method_origin?: string; | ||
| method_symbol?: string; | ||
| published_at: Date; | ||
| requested_at: Date; | ||
| receipt_Data: ReceiptResponseParameters; | ||
| receipt_data: ReceiptResponseParameters; | ||
| billing_expire_at: Date; | ||
| status: number; | ||
| status_locale?: string; | ||
| } | ||
@@ -171,3 +212,3 @@ export interface SubscriptionCardPaymentRequestParameters { | ||
| price: number; | ||
| tax_free: number; | ||
| tax_free?: number; | ||
| card_quota?: string; | ||
@@ -200,5 +241,9 @@ card_interest?: string; | ||
| tax_free?: number; | ||
| order_id: string; | ||
| reserve_execute_at: Date; | ||
| user?: UserModel; | ||
| items?: ItemModel; | ||
| reserve_execute_at: string; | ||
| metadata?: any; | ||
| feedback_url?: string; | ||
| content_type?: 'application/json' | 'application/x-www-form-urlencoded'; | ||
| } | ||
@@ -216,3 +261,3 @@ export interface ShippingRequestParameters { | ||
| reserve_id: string; | ||
| reserve_execute_at: string; | ||
| reserve_execute_at: Date; | ||
| } | ||
@@ -223,1 +268,67 @@ export interface CancelSubscribeReserveResponse { | ||
| } | ||
| export interface CashReceiptPublishOnReceiptParameters { | ||
| receipt_id: string; | ||
| username?: string; | ||
| email?: string; | ||
| phone?: string; | ||
| identity_no: string; | ||
| cash_receipt_type: '소득공제' | '지출증빙'; | ||
| currency?: string; | ||
| } | ||
| export interface CashReceiptCancelOnReceiptParameters { | ||
| receipt_id: string; | ||
| cancel_username?: string; | ||
| cancel_message?: string; | ||
| } | ||
| export interface RequestCashReceiptParameters { | ||
| pg: string; | ||
| price: number; | ||
| tax_free?: number; | ||
| order_name: string; | ||
| cash_receipt_type: '소득공제' | '지출증빙'; | ||
| identity_no: string; | ||
| purchased_at?: Date; | ||
| order_id: string; | ||
| user?: UserModel; | ||
| extra?: ExtraModel; | ||
| } | ||
| export interface CancelCashReceiptParameters { | ||
| receipt_id: string; | ||
| cancel_username?: string; | ||
| cancel_message?: string; | ||
| } | ||
| export interface RequestAuthenticateParameters { | ||
| authentication_id: string; | ||
| pg: string; | ||
| method: string; | ||
| username: string; | ||
| identity_no: string; | ||
| carrier: string; | ||
| phone: string; | ||
| site_url?: string; | ||
| authenticate_type?: 'sms' | 'pass'; | ||
| order_name: string; | ||
| extra?: ExtraModel; | ||
| user?: UserModel; | ||
| metadata?: object; | ||
| } | ||
| export interface SubscribePaymentLookupResponse { | ||
| reserve_id: string; | ||
| receipt_id?: string; | ||
| order_id: string; | ||
| price: number; | ||
| tax_free: number; | ||
| order_name: string; | ||
| user: UserModel; | ||
| feedback_url: string; | ||
| metadata?: any; | ||
| content_type: 'application/json' | 'application/x-www-form-urlencoded'; | ||
| version: number; | ||
| extra: ExtraModel; | ||
| reserve_requested_at: string; | ||
| reserve_execute_at: string; | ||
| reserve_started_at: string; | ||
| reserve_finished_at: string; | ||
| reserve_revoked_at: string; | ||
| status: number; | ||
| } |
+265
-193
@@ -1,2 +0,2 @@ | ||
| # Bootpay Server Side Package for Node.js [](https://www.npmjs.com/package/bootpay-backend-nodejs) | ||
| # Bootpay Server Side Package for Node.js [](https://www.npmjs.com/package/@bootpay/backend-js) | ||
@@ -29,3 +29,3 @@ ## Bootpay Node.js Server Side Library | ||
| 4-6. 해당 결제건의 빌링키 조회 | ||
| 4-6. 빌링키 조회 | ||
@@ -38,7 +38,7 @@ 5. (생체인증, 비밀번호 결제를 위한) 구매자 토큰 발급 | ||
| ## pypi로 설치하기 | ||
| ## npm으로 설치하기 | ||
| ``` | ||
| pip install backend-bootpay | ||
| npm install --save @bootpay/backend-js | ||
| ``` | ||
@@ -48,12 +48,23 @@ | ||
| ```python | ||
| ```javascript | ||
| import { Bootpay } from "@bootpay/backend-js"; | ||
| from bootpay_backend import BootpayBackend | ||
| bootpay = BootpayBackend('59b731f084382614ebf72215', 'WwDv0UjfwFa04wYG0LJZZv1xwraQnlhnHE375n52X0U=') | ||
| token = bootpay.get_access_token() | ||
| if 'error_code' not in token: | ||
| print(token) | ||
| print(token['access_token']) | ||
| (async () => { | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.cancelPayment({ | ||
| receipt_id: '628b2206d01c7e00209b6087', | ||
| cancel_price: 1000, | ||
| cancel_username: '테스트 사용자', | ||
| cancel_message: '테스트 취소입니다.' | ||
| }) | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() | ||
| ``` | ||
@@ -67,7 +78,16 @@ | ||
| ```python | ||
| bootpay = BootpayBackend('59b731f084382614ebf72215', 'WwDv0UjfwFa04wYG0LJZZv1xwraQnlhnHE375n52X0U=') | ||
| ```javascript | ||
| (async () => { | ||
| Bootpay.setConfiguration({ | ||
| application_id: '59b731f084382614ebf72215', | ||
| private_key: 'WwDv0UjfwFa04wYG0LJZZv1xwraQnlhnHE375n52X0U=' | ||
| }) | ||
| try { | ||
| let response = await Bootpay.getAccessToken() | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() | ||
| token = bootpay.get_access_token() | ||
| print(token) | ||
| ``` | ||
@@ -78,9 +98,17 @@ | ||
| 결제창 및 정기결제에서 승인/취소된 결제건에 대하여 올바른 결제건인지 서버간 통신으로 결제검증을 합니다. | ||
| ```python | ||
| bootpay = BootpayBackend('59b731f084382614ebf72215', 'WwDv0UjfwFa04wYG0LJZZv1xwraQnlhnHE375n52X0U=') | ||
| token = bootpay.get_access_token() | ||
| if 'error_code' not in token: | ||
| response = bootpay.receipt_payment('61b009aaec81b4057e7f6ecd') | ||
| print(response) | ||
| ```javascript | ||
| (async () => { | ||
| const Bootpay = require('@bootpay/backend-js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.receiptPayment('62b12f4b6262500007629fec') | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() | ||
| ``` | ||
@@ -98,98 +126,103 @@ | ||
| 간혹 개발사에서 실수로 여러번 부분취소를 보내서 여러번 취소되는 경우가 있기때문에, 부트페이에서는 부분취소 중복 요청을 막기 위해 cancel_id 라는 필드를 추가했습니다. cancel_id를 지정하시면, 해당 건에 대해 중복 요청방지가 가능합니다. | ||
| ```python | ||
| bootpay = BootpayBackend('5b8f6a4d396fa665fdc2b5ea', 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=') | ||
| result = bootpay.get_access_token() | ||
| if result['status'] == 200: | ||
| print(bootpay.cancel('1234', 'test', 'test결제 취소')) | ||
| ```javascript | ||
| (async () => { | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.cancelPayment({ | ||
| receipt_id: '628b2206d01c7e00209b6087', | ||
| cancel_price: 1000, | ||
| cancel_username: '테스트 사용자', | ||
| cancel_message: '테스트 취소입니다.' | ||
| }) | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() | ||
| ``` | ||
| ## 4. 빌링키 발급 | ||
| ## 4-1. 빌링키 발급 | ||
| REST API 방식으로 고객으로부터 카드 정보를 전달하여, PG사에게 빌링키를 발급받을 수 있습니다. | ||
| 발급받은 빌링키를 저장하고 있다가, 원하는 시점, 원하는 금액에 결제 승인 요청하여 좀 더 자유로운 결제시나리오에 적용이 가능합니다. | ||
| * 비인증 정기결제(REST API) 방식을 지원하는 PG사만 사용 가능합니다. | ||
| ```python | ||
| bootpay = BootpayBackend('5b8f6a4d396fa665fdc2b5ea', 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=') | ||
| token = bootpay.get_access_token() | ||
| if 'error_code' not in token: | ||
| response = bootpay.request_subscribe_billing_key( | ||
| pg='나이스페이', | ||
| order_name='테스트결제', | ||
| subscription_id="order_1234", | ||
| card_no="5570********1074", # 카드번호 | ||
| card_pw="**", # 카드 비밀번호 2자리 | ||
| card_identity_no="******", # 카드 소주 생년월일 | ||
| card_expire_year="**", # 카드 유효기간 년 2자리 | ||
| card_expire_month="**", # 카드 유효기간 월 2자리 | ||
| ) | ||
| print(response) | ||
| ```javascript | ||
| (async () => { | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.requestSubscribeBillingKey({ | ||
| pg: '나이스페이', | ||
| order_name: '테스트결제', | ||
| subscription_id: (new Date()).getTime(), | ||
| card_no: '5570********1074', //카드번호 | ||
| card_pw: '**', //카드 비밀번호 2자리 | ||
| card_identity_no: '******', //카드 소유주 생년월일 6자리 | ||
| card_expire_year: '**', //카드 유효기간 년 2자리 | ||
| card_expire_month: '**', //카드 유효기간 월 2자리 | ||
| user: { | ||
| username: '홍길동', | ||
| phone: '01012345678' | ||
| } | ||
| }) | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() | ||
| ``` | ||
| ## 4-1. 빌링키 발급 | ||
| 발급된 빌링키로 원하는 시점에 원하는 금액으로 결제 승인 요청을 할 수 있습니다. 잔액이 부족하거나 도난 카드 등의 특별한 건이 아니면 PG사에서 결제를 바로 승인합니다. | ||
| ```python | ||
| bootpay = BootpayBackend("5b8f6a4d396fa665fdc2b5ea", "rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=") | ||
| token = bootpay.get_access_token() | ||
| if 'error_code' not in token: | ||
| response = bootpay.request_subscribe_card_payment( | ||
| billing_key='62b2c3cfd01c7e001cc20a84', | ||
| order_name='테스트결제', | ||
| order_id=str(time.time()), | ||
| price=100, | ||
| user={ | ||
| "phone": '01000000000', | ||
| "username": '홍길동', | ||
| "email": 'test@bootpay.co.kr' | ||
| } | ||
| ) | ||
| print(response) | ||
| ``` | ||
| ## 4-2. 발급된 빌링키로 결제 승인 요청 | ||
| 발급된 빌링키로 원하는 시점에 원하는 금액으로 결제 승인 요청을 할 수 있습니다. 잔액이 부족하거나 도난 카드 등의 특별한 건이 아니면 PG사에서 결제를 바로 승인합니다. | ||
| ```python | ||
| bootpay = BootpayBackend("5b8f6a4d396fa665fdc2b5ea", "rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=") | ||
| token = bootpay.get_access_token() | ||
| if 'error_code' not in token: | ||
| response = bootpay.subscribe_payment_reserve( | ||
| billing_key='[ 빌링키 ]', | ||
| order_name='테스트결제', | ||
| order_id=str(time.time()), | ||
| price=1000, | ||
| user={ | ||
| "phone": '01000000000', | ||
| "username": '홍길동', | ||
| "email": 'test@bootpay.co.kr' | ||
| }, | ||
| reserve_execute_at=(datetime.datetime.now() + datetime.timedelta(seconds=5)).astimezone().strftime( | ||
| '%Y-%m-%dT%H:%M:%S%z') | ||
| ) | ||
| print(response) | ||
| ```javascript | ||
| (async () => { | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.requestSubscribeCardPayment({ | ||
| billing_key: '62b3d166cf9f6d001bd20d59', | ||
| order_name: '테스트 결제', | ||
| order_id: (new Date()).getTime(), | ||
| price: 100, | ||
| tax_free: 0 | ||
| }) | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() | ||
| ``` | ||
| ## 4-3. 발급된 빌링키로 결제 예약 요청 | ||
| 원하는 시점에 4-1로 결제 승인 요청을 보내도 되지만, 빌링키 발급 이후에 바로 결제 예약 할 수 있습니다. (빌링키당 최대 10건) | ||
| ```python | ||
| bootpay = BootpayBackend("5b8f6a4d396fa665fdc2b5ea", "rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=") | ||
| token = bootpay.get_access_token() | ||
| if 'error_code' not in token: | ||
| response = bootpay.subscribe_payment_reserve( | ||
| billing_key='[ 빌링키 ]', | ||
| order_name='테스트결제', | ||
| order_id=str(time.time()), | ||
| price=1000, | ||
| user={ | ||
| "phone": '01000000000', | ||
| "username": '홍길동', | ||
| "email": 'test@bootpay.co.kr' | ||
| }, | ||
| reserve_execute_at=(datetime.datetime.now() + datetime.timedelta(seconds=5)).astimezone().strftime( | ||
| '%Y-%m-%dT%H:%M:%S%z') | ||
| ) | ||
| print(response) | ||
| ```javascript | ||
| (async () => { | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| // console.log(new Date((new Date()).getTime() + 5000)) | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.subscribePaymentReserve({ | ||
| billing_key: '62b3d166cf9f6d001bd20d59', | ||
| order_name: '테스트 결제', | ||
| order_id: (new Date()).getTime(), | ||
| price: 1000, | ||
| reserve_execute_at: new Date((new Date()).getTime() + 5000) | ||
| }) | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() | ||
| ``` | ||
@@ -199,26 +232,26 @@ | ||
| 빌링키로 예약된 결제건을 취소합니다. | ||
| ```python | ||
| bootpay = BootpayBackend('59b731f084382614ebf72215', 'WwDv0UjfwFa04wYG0LJZZv1xwraQnlhnHE375n52X0U=') | ||
| token = bootpay.get_access_token() | ||
| if 'error_code' not in token: | ||
| response = bootpay.subscribe_payment_reserve( | ||
| billing_key='[ 빌링키 ]', | ||
| order_name='테스트결제', | ||
| order_id=str(time.time()), | ||
| price=1000, | ||
| user={ | ||
| "phone": '01000000000', | ||
| "username": '홍길동', | ||
| "email": 'test@bootpay.co.kr' | ||
| }, | ||
| reserve_execute_at=(datetime.datetime.now() + datetime.timedelta(seconds=5)).astimezone().strftime( | ||
| '%Y-%m-%dT%H:%M:%S%z') | ||
| ) | ||
| print(response) | ||
| if 'error_code' not in response: | ||
| cancel = bootpay.cancel_subscribe_reserve( | ||
| reserve_id=response['reserve_id'] | ||
| ) | ||
| print(cancel) | ||
| ```javascript | ||
| (async () => { | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| // console.log(new Date((new Date()).getTime() + 5000)) | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.subscribePaymentReserve({ | ||
| billing_key: '62b3d166cf9f6d001bd20d59', | ||
| order_name: '테스트 결제', | ||
| order_id: (new Date()).getTime(), | ||
| price: 1000, | ||
| reserve_execute_at: new Date((new Date()).getTime() + 5000) | ||
| }) | ||
| if (response.reserve_id !== undefined) { | ||
| const cancel = await Bootpay.cancelSubscribeReserve(response.reserve_id) | ||
| console.log(cancel) | ||
| } | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() | ||
| ``` | ||
@@ -228,22 +261,34 @@ | ||
| 발급된 빌링키로 더 이상 사용되지 않도록, 삭제 요청합니다. | ||
| ```python | ||
| bootpay = BootpayBackend("5b8f6a4d396fa665fdc2b5ea", "rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=") | ||
| token = bootpay.get_access_token() | ||
| if 'error_code' not in token: | ||
| response = bootpay.destroy_billing_key( | ||
| billing_key='62b2c3cfd01c7e001cc20a85', | ||
| ) | ||
| print(response) | ||
| ```javascript | ||
| (async () => { | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.destroyBillingKey('62b3d166cf9f6d001bd20d59') | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() | ||
| ``` | ||
| ## 4-6. 해당 결제건의 빌링키 조회 | ||
| 해당 결제건이 어떤 빌링키로 결제되었는지 조회합니다. | ||
| ```python | ||
| bootpay = BootpayBackend("5b8f6a4d396fa665fdc2b5ea", "rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=") | ||
| token = bootpay.get_access_token() | ||
| if 'error_code' not in token: | ||
| response = bootpay.lookup_subscribe_billing_key('62b2c3c2d01c7e001bc20b10') | ||
| print(response) | ||
| ## 4-6. 빌링키 조회 | ||
| (빌링키 발급 완료시 리턴받았던 receipt_id에 한정) 어떤 빌링키였는지 조회합니다. | ||
| ```javascript | ||
| (async () => { | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.lookupSubscribeBillingKey('62b3cbbecf9f6d001bd20ce8') | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() | ||
| ``` | ||
@@ -255,12 +300,19 @@ | ||
| 이 토큰값을 기반으로 클라이언트에서 결제요청 하시면 되겠습니다. | ||
| ```python | ||
| bootpay = BootpayBackend("5b8f6a4d396fa665fdc2b5ea", "rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=") | ||
| token = bootpay.get_access_token() | ||
| if 'error_code' not in token: | ||
| response = bootpay.request_user_token( | ||
| user_id='gosomi1', | ||
| phone='01012345678' | ||
| ) | ||
| print(response) | ||
| ```javascript | ||
| (async () => { | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.requestUserToken({ | ||
| user_id: 'gosomi1', | ||
| phone:'01012345678' | ||
| }) | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() | ||
| ``` | ||
@@ -271,3 +323,3 @@ | ||
| 클라이언트 승인 방식은 pythonscript나 native 등에서 confirm 함수에서 진행하는 일반적인 방법입니다만, 경우에 따라 서버 승인 방식이 필요할 수 있습니다. | ||
| 클라이언트 승인 방식은 웹, 앱에서 진행하는 일반적인 방법입니다만, 경우에 따라 서버 승인 방식이 필요할 수 있습니다. | ||
@@ -278,10 +330,16 @@ 필요한 이유 | ||
| ```python | ||
| bootpay = BootpayBackend("5b8f6a4d396fa665fdc2b5ea", "rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=") | ||
| token = bootpay.get_access_token() | ||
| if 'error_code' not in token: | ||
| response = bootpay.confirm_payment('62b2c3c2d01c7e001bc20b10') | ||
| print(response) | ||
| } | ||
| ```javascript | ||
| (async () => { | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.confirmPayment('62876963d01c7e00209b6028') | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() | ||
| ``` | ||
@@ -292,9 +350,16 @@ | ||
| 다날 본인인증에서 통신사, 외국인여부, 전화번호 이 3가지 정보는 다날에 추가로 요청하셔야 받으실 수 있습니다. | ||
| ```python | ||
| bootpay = BootpayBackend('59b731f084382614ebf72215', 'WwDv0UjfwFa04wYG0LJZZv1xwraQnlhnHE375n52X0U=') | ||
| token = bootpay.get_access_token() | ||
| if 'error_code' not in token: | ||
| response = bootpay.certificate('61b009aaec81b4057e7f6ecd') | ||
| print(response) | ||
| ```javascript | ||
| (async () => { | ||
| Bootpay.setConfiguration({ | ||
| application_id: '59b731f084382614ebf72215', | ||
| private_key: 'WwDv0UjfwFa04wYG0LJZZv1xwraQnlhnHE375n52X0U=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.certificate('625783a6cf9f6d001d0aed19') | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() | ||
| ``` | ||
@@ -307,19 +372,26 @@ | ||
| PG사로 배송정보( 이니시스, KCP만 지원 )를 보내서 에스크로 상태를 변경하는 API 입니다. | ||
| ```python | ||
| bootpay = BootpayBackend('59b731f084382614ebf72215', 'WwDv0UjfwFa04wYG0LJZZv1xwraQnlhnHE375n52X0U=') | ||
| token = bootpay.get_access_token() | ||
| if 'error_code' not in token: | ||
| response = bootpay.shipping_start( | ||
| receipt_id="62a946aad01c7e001b7dc20b", | ||
| tracking_number='3989838', | ||
| delivery_corp='CJ대한통운', | ||
| user={ | ||
| "phone": '01000000000', | ||
| "username": '홍길동', | ||
| "address": "서울특별시 종로구", | ||
| "zipcode": "039899" | ||
| } | ||
| ) | ||
| print(response) | ||
| ```javascript | ||
| (async () => { | ||
| Bootpay.setConfiguration({ | ||
| application_id: '59b731f084382614ebf72215', | ||
| private_key: 'WwDv0UjfwFa04wYG0LJZZv1xwraQnlhnHE375n52X0U=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.shippingStart({ | ||
| receipt_id: "62a9379ad01c7e001f7dc1f3", | ||
| tracking_number: '123456', | ||
| delivery_corp: 'CJ대한통운', | ||
| user: { | ||
| username: '테스트', | ||
| phone: '01000000000', | ||
| address: '서울특별시 종로구', | ||
| zipcode: '08490' | ||
| } | ||
| }) | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() | ||
| ``` | ||
@@ -326,0 +398,0 @@ |
+21
-6
| { | ||
| "name": "@bootpay/backend-js", | ||
| "version": "2.1.0", | ||
| "version": "2.1.10.beta1", | ||
| "description": "Bootpay Server Side Package for Node.js", | ||
| "types": "dist/bootpay.d.ts", | ||
| "main": "dist/bootpay.js", | ||
| "module": "dist/bootpay.js", | ||
| "exports": { | ||
| ".": { | ||
| "import": "./dist/bootpay.js", | ||
| "require": "./dist/bootpay.js", | ||
| "types": "./dist/bootpay.d.ts" | ||
| } | ||
| }, | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1", | ||
| "build": "rm -rf ./dist && tsc --build && cp ./package.json dist/package.json && rm -rf ./dist/src && cp ./README.md dist/", | ||
| "build": "rm -rf ./dist && tsc --p ./tsconfig.json && rm -rf ./dist/src && cp ./README.md dist/", | ||
| "clear": "tsc --build --clean" | ||
| }, | ||
| "dependencies": { | ||
| "axios": "^0.26.1" | ||
| "axios": "^1.6.2" | ||
| }, | ||
| "devDependencies": { | ||
| "ts-node": "^10.7.0", | ||
| "typescript": "^4.7.4", | ||
| "typescript": "^5.3.3", | ||
| "@types/node": "^18.6.2" | ||
@@ -21,3 +30,3 @@ }, | ||
| "type": "git", | ||
| "url": "git+https://github.com/bootpay/backend-nodejs" | ||
| "url": "git+https://github.com/bootpay/backend-nodejs.git" | ||
| }, | ||
@@ -33,2 +42,5 @@ "keywords": [ | ||
| ], | ||
| "ts-node": { | ||
| "esm": true | ||
| }, | ||
| "author": "Bootpay", | ||
@@ -39,3 +51,6 @@ "license": "MIT", | ||
| }, | ||
| "homepage": "https://www.bootpay.co.kr" | ||
| "homepage": "https://www.bootpay.co.kr", | ||
| "directories": { | ||
| "test": "test" | ||
| } | ||
| } |
| module.exports = require('./bootpay') |
| { | ||
| "name": "@bootpay/backend-js", | ||
| "version": "2.0.2", | ||
| "description": "Bootpay Server Side Package for Node.js", | ||
| "main": "dist/bootpay.js", | ||
| "types": "dist/bootpay.d.ts", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1", | ||
| "build": "rm -rf ./dist && tsc --build && cp ./package.json dist/package.json && cp ./src/index.js ./dist/index.js && rm -rf ./dist/src && cp ./README.md dist/", | ||
| "clear": "tsc --build --clean" | ||
| }, | ||
| "dependencies": { | ||
| "axios": "^0.26.1" | ||
| }, | ||
| "devDependencies": { | ||
| "ts-node": "^10.7.0", | ||
| "typescript": "^4.6.3" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/bootpay/backend-nodejs" | ||
| }, | ||
| "keywords": [ | ||
| "결제", | ||
| "payment", | ||
| "결제연동", | ||
| "PG연동", | ||
| "PG", | ||
| "부트페이", | ||
| "bootpay" | ||
| ], | ||
| "author": "Bootpay", | ||
| "license": "MIT", | ||
| "bugs": { | ||
| "url": "https://bootpay.channel.io/" | ||
| }, | ||
| "homepage": "https://www.bootpay.co.kr" | ||
| } |
| (async () => { | ||
| const RestClient = require('../dist/bootpay').Bootpay | ||
| RestClient.setConfig( | ||
| '5b8f6a4d396fa665fdc2b5ea', | ||
| 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| ) | ||
| let response = await RestClient.getAccessToken() | ||
| // console.log(response) | ||
| const axios = require('axios') | ||
| try { | ||
| response = await axios.post("https://dev-api.bootpay.co.kr/request/token.json", { | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw==' | ||
| }) | ||
| console.log(response) | ||
| } catch(e) { | ||
| console.log(e.response.data) | ||
| } | ||
| })() |
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.cancelPayment({ | ||
| receipt_id: '628b2206d01c7e00209b6087', | ||
| cancel_price: 1000, | ||
| cancel_username: '테스트 사용자', | ||
| cancel_message: '테스트 취소입니다.' | ||
| }) | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| // console.log(new Date((new Date()).getTime() + 5000)) | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.subscribePaymentReserve({ | ||
| billing_key: '62b3d166cf9f6d001bd20d59', | ||
| order_name: '테스트 결제', | ||
| order_id: (new Date()).getTime(), | ||
| price: 1000, | ||
| reserve_execute_at: new Date((new Date()).getTime() + 5000) | ||
| }) | ||
| if (response.reserve_id !== undefined) { | ||
| const cancel = await Bootpay.cancelSubscribeReserve(response.reserve_id) | ||
| console.log(cancel) | ||
| } | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| // Bootpay.setConfiguration({ | ||
| // application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| // private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| // }) | ||
| Bootpay.setConfiguration({ | ||
| application_id: '59bfc738e13f337dbd6ca48a', | ||
| private_key: 'pDc0NwlkEX3aSaHTp/PPL/i8vn5E/CqRChgyEp/gHD0=', | ||
| mode: 'development' | ||
| }) | ||
| try { | ||
| // console.log(new Date((new Date()).getTime() + 5000)) | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.cashReceiptPublishOnReceipt({ | ||
| receipt_id: "62e32b3f1fc192036e8db942", | ||
| username: '테스트', | ||
| email: 'test@bootpay.co.kr', | ||
| phone: '01000000000', | ||
| identity_no: '01000000000', | ||
| cash_receipt_type: '소득공제' | ||
| }) | ||
| console.log(response) | ||
| if (response.receipt_id !== undefined) { | ||
| const cancel = await Bootpay.cashReceiptCancelOnReceipt({ | ||
| receipt_id: "62e32b3f1fc192036e8db942", | ||
| }) | ||
| console.log(cancel) | ||
| } | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '59b731f084382614ebf72215', | ||
| private_key: 'WwDv0UjfwFa04wYG0LJZZv1xwraQnlhnHE375n52X0U=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.certificate('625783a6cf9f6d001d0aed19') | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
| // import { Bootpay } from "../dist/bootpay" | ||
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.confirmPayment('62876963d01c7e00209b6028') | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.destroyBillingKey('62b3d166cf9f6d001bd20d59') | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
| const Bootpay = require('../lib/bootpay'); | ||
| Bootpay.setConfig( | ||
| "[[ REST용 Application ID]]", | ||
| "[[ Private Key ]]" | ||
| ); | ||
| // POST로 Params를 받아서 처리 | ||
| // params가 POST로 전달된 Object라고 가정하면 | ||
| switch (params.act) { | ||
| case 'cancel': | ||
| // 결제창 닫을 때 이벤트 | ||
| break; | ||
| case 'error': | ||
| // 결제 진행중 에러가 났을 때 | ||
| // params.message로 데이터 전달 | ||
| break; | ||
| case 'confirm': | ||
| Bootpay.getAccessToken().then(function (tokenData) { | ||
| // 부트페이 서버에서 토큰값을 제대로 가져온 경우 | ||
| if (tokenData.status === 200) { | ||
| Bootpay.verify(params.receipt_id).then( | ||
| function (verify) { | ||
| // 원래 요청했던 금액과 일치하거나 | ||
| // 결제 승인 전 상태라면 결제 승인 요청을 한다. ( 승인전 상태는 status 값이 2 입니다. ) | ||
| if (verify.status === 200 && verify.price == originPrice && verify.data.status === 2) { | ||
| // 결제 승인한다. | ||
| Bootpay.submit(params.receipt_id).then( | ||
| function (response) { | ||
| // 서버에서 REST API로 승인 후 200 OK를 받았다면 | ||
| // 결제가 완료 처리를 한다. | ||
| if (response.status === 200) { | ||
| console.log(response.data); | ||
| } | ||
| } | ||
| ) | ||
| } | ||
| } | ||
| ); | ||
| } | ||
| }); | ||
| break; | ||
| } |
| // import { Bootpay } from "../dist/index.js"; | ||
| // | ||
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '59b731f084382614ebf72215', | ||
| private_key: 'WwDv0UjfwFa04wYG0LJZZv1xwraQnlhnHE375n52X0U=' | ||
| }) | ||
| try { | ||
| let response = await Bootpay.getAccessToken() | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.requestSubscribeBillingKey({ | ||
| pg: '나이스페이', | ||
| order_name: '테스트결제', | ||
| subscription_id: (new Date()).getTime(), | ||
| card_no: '5570********1074', //카드번호 | ||
| card_pw: '**', //카드 비밀번호 2자리 | ||
| card_identity_no: '******', //카드 소유주 생년월일 6자리 | ||
| card_expire_year: '**', //카드 유효기간 년 2자리 | ||
| card_expire_month: '**', //카드 유효기간 월 2자리 | ||
| user: { | ||
| username: '홍길동', | ||
| phone: '01012345678' | ||
| } | ||
| }) | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.lookupSubscribeBillingKey('62b3cbbecf9f6d001bd20ce8') | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
| // import { Bootpay } from "../dist/bootpay" | ||
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.receiptPayment('62b12f4b6262500007629fec') | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
| // @deprecated | ||
| // (async () => { | ||
| // const Bootpay = require('../dist/bootpay').Bootpay | ||
| // Bootpay.setConfig( | ||
| // '5b8f6a4d396fa665fdc2b5ea', | ||
| // 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| // ) | ||
| // const token = await Bootpay.getAccessToken() | ||
| // if (token.status === 200) { | ||
| // let result | ||
| // try { | ||
| // result = await Bootpay.requestPayment({ | ||
| // pg: 'kcp', | ||
| // method: 'card', | ||
| // orderId: (new Date).getTime(), | ||
| // price: 1000, | ||
| // itemName: '테스트 부트페이 상품', | ||
| // returnUrl: 'https://dev-api.bootpay.co.kr/callback', | ||
| // extra: { | ||
| // expire: 30 | ||
| // } | ||
| // }) | ||
| // } catch (e) { | ||
| // return console.log(e) | ||
| // } | ||
| // console.log(result) | ||
| // } | ||
| // })() |
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '59b731f084382614ebf72215', | ||
| private_key: 'WwDv0UjfwFa04wYG0LJZZv1xwraQnlhnHE375n52X0U=' | ||
| }) | ||
| // Bootpay.setConfiguration({ | ||
| // application_id: '59bfc738e13f337dbd6ca48a', | ||
| // private_key: 'pDc0NwlkEX3aSaHTp/PPL/i8vn5E/CqRChgyEp/gHD0=', | ||
| // mode: 'development' | ||
| // }) | ||
| try { | ||
| // console.log(new Date((new Date()).getTime() + 5000)) | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.requestCashReceipt({ | ||
| pg: '나이스페이', | ||
| price: 1000, | ||
| tax_free: 0, | ||
| order_name: '테스트', | ||
| cash_receipt_type: '소득공제', | ||
| user: { | ||
| username: '부트페이', | ||
| phone: '01000000000', | ||
| email: 'bootpay@bootpay.co.kr' | ||
| }, | ||
| identity_no: '0100000000', | ||
| order_id: (new Date()).getTime(), | ||
| }) | ||
| console.log(response) | ||
| if (response.receipt_id !== undefined) { | ||
| const cancel = await Bootpay.cancelCashReceipt({ | ||
| receipt_id: response.receipt_id, | ||
| }) | ||
| console.log(cancel) | ||
| } | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.requestUserToken({ | ||
| user_id: 'gosomi1', | ||
| phone:'01012345678' | ||
| }) | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '59b731f084382614ebf72215', | ||
| private_key: 'WwDv0UjfwFa04wYG0LJZZv1xwraQnlhnHE375n52X0U=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.shippingStart({ | ||
| receipt_id: "62a9379ad01c7e001f7dc1f3", | ||
| tracking_number: '123456', | ||
| delivery_corp: 'CJ대한통운', | ||
| user: { | ||
| username: '테스트', | ||
| phone: '01000000000', | ||
| address: '서울특별시 종로구', | ||
| zipcode: '08490' | ||
| } | ||
| }) | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.requestSubscribeCardPayment({ | ||
| billing_key: '62b3d166cf9f6d001bd20d59', | ||
| order_name: '테스트 결제', | ||
| order_id: (new Date()).getTime(), | ||
| price: 100, | ||
| tax_free: 0 | ||
| }) | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
| (async () => { | ||
| const Bootpay = require('../dist/bootpay.js').Bootpay | ||
| Bootpay.setConfiguration({ | ||
| application_id: '5b8f6a4d396fa665fdc2b5ea', | ||
| private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=' | ||
| }) | ||
| try { | ||
| // console.log(new Date((new Date()).getTime() + 5000)) | ||
| await Bootpay.getAccessToken() | ||
| const response = await Bootpay.subscribePaymentReserve({ | ||
| billing_key: '62b3d166cf9f6d001bd20d59', | ||
| order_name: '테스트 결제', | ||
| order_id: (new Date()).getTime(), | ||
| price: 1000, | ||
| reserve_execute_at: new Date((new Date()).getTime() + 5000) | ||
| }) | ||
| console.log(response) | ||
| } catch (e) { | ||
| console.log(e) | ||
| } | ||
| })() |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
64217
-7.65%11
-64.52%1024
-7.91%2
100%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
Updated