diff --git a/src/content/docs/en/auth/guide-1/bill/rest-api.mdx b/src/content/docs/en/auth/guide-1/bill/rest-api.mdx index ecfa4409a..c0e0f66ac 100644 --- a/src/content/docs/en/auth/guide-1/bill/rest-api.mdx +++ b/src/content/docs/en/auth/guide-1/bill/rest-api.mdx @@ -4,9 +4,9 @@ description: Easily get a billing key using the i'mport REST API. --- import Codepen from "~/components/gitbook/Codepen.astro"; -import Hint from "~/components/Hint.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; +import Hint from "~/components/Hint.astro"; You can use the i'mport REST API to request for a billing key to make a payment request. When you request for a billing key with the customer's credit card information, the i'mport server calls the @@ -19,137 +19,150 @@ has the following pros/cons: requirements are strict for this service, and must take precautions to protect personal information. -#### If you are planning to develop a merchant UI/UX-friendly payment environment, API integration is the right choice. +If you are planning to develop a merchant UI/UX-friendly payment environment, +API integration is the right choice. -### **STEP 01.** Accept credit card information +## **STEP 01.** Accept credit card information Add input fields for card information as shown below. Create a hidden field to store the -**customer_uid** to send to the server upon form submission. For corporate cards (excluding cards +**customer\_uid** to send to the server upon form submission. For corporate cards (excluding cards issued under an employee's name), enter a _10-digit business registration number_ for the `birth` parameter. The following example calls a `POST` request for `/subscription/issue-billing` with input -values and **customer_uid** when you click the **Pay** button. +values and **customer\_uid** when you click the **Pay** button. -**What is a customer\_uid?** + **What is a customer\_uid?** -It is a unique value specified by the merchant that maps 1:1 with the billing key issued by PG. A unique `customer_uid` must be created for each card. - -Example: If a customer named **Hong Gildong** requests for a billing key from **A card**, the customer_uid must be issued for the **specified member's credit card number**. + It is a unique value specified by the merchant that maps 1:1 with the billing key issued by PG. A unique `customer_uid` must be created for each card. + Example: If a customer named **Hong Gildong** requests for a billing key from **A card**, the customer\_uid must be issued for the **specified member's credit card number**. -If you reuse the customer\_uid used to get the existing billing key, the existing billing key will be replaced with the new billing key issued on the new card number. (**The billing key that maps to the existing card will be deleted.**) - + If you reuse the customer\_uid used to get the existing billing key, the existing billing key will be replaced with the new billing key issued on the new card number. (**The billing key that maps to the existing card will be deleted.**) -**Credit card information required for billing key** - -- **Credit card number** -- **Credit card expiration** -- **DOB** -- **First 2-digits of card password** + **Credit card information required for billing key** + - **Credit card number** + - **Credit card expiration** + - **DOB** + - **First 2-digits of card password** - -```html title="client-side" -
- -
- - -
-
- - -
-
- - -
-
- - -
- - -
-``` - -
- - -```jsx title="client-side" -// React.js - class CardForm extends React.Components { - constructor(props) { - super(props); - this.state = { - cardNumber: "", - expiry: "", - birth: "", - pwd2Digit: "", - customer_uid: "gildong_0001_1234", + + ```html title="client-side" +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + +
+ ``` +
+ + + ```tsx title="client-side" + // React.js + class CardForm extends React.Components { + constructor(props) { + super(props); + this.state = { + cardNumber: "", + expiry: "", + birth: "", + pwd2Digit: "", + customer_uid: "gildong_0001_1234", + }; + } + handleInputChange = (event) => { + const { value, name } = event.target; + this.setState({ + [name]: value, + }); }; + handleFormSubmit = (event) => { + event.preventDefault(); + const { cardNumber, expiry, birth, pwd2Digit, customer_uid } = this.state; + axios({ + // Example: https://www.myservice.com/subscription/issue-billing + url: "{service URL to receive billing key request}", + method: "post", + data: { + cardNumber, + expiry, + birth, + pwd2Digit, + customer_uid, + }, + }).then((rsp) => { + // Do something with the response + }); + }; + render() { + const { cardNumber, expiry, birth, pwd2Digit } = this.state; + return ( +
+ + + + + +
+ ); + } } - ... - handleInputChange = (event) => { - const { value, name } = event.target; - this.setState({ - [name]: value, - }); - }; - ... - handleFormSubmit = (event) => { - event.preventDefault(); - const { cardNumber, expiry, birth, pwd2Digit, customer_uid } = this.state; - axios({ - // Example: https://www.myservice.com/subscription/issue-billing - url: "{service URL to receive billing key request}", - method: "post", - data: { - cardNumber, - expiry, - birth, - pwd2Digit, - customer_uid, - } - }).then(rsp => { - ... - }); - }; - ... - render() { - const { cardNumber, expiry, birth, pwd2Digit } = this.state; - return ( -
- - - - - -
- ) - } - } -``` - -
+ ``` +
@@ -157,39 +170,37 @@ If you reuse the customer\_uid used to get the existing billing key, the existin ### **STEP 02.** Extract card information Create an API endpoint to extract the card information from the request body. The following is a -sample **API endpoint** that processes a `POST` request to `/subscription/issue-billing`.\ +sample **API endpoint** that processes a `POST` request to `/subscription/issue-billing`.\\ - -```javascript title="server-side" -// Process POST request to "/subscription/issue-billing" - app.post("/subscriptions/issue-billing", async (req, res) => { - try { - const { - card_number, // card number - expiry, // card expiration - birth, // DOB - pwd_2digit, // first 2-digits of card password - customer_uid, // value that maps 1:1 with card (billing key) - } = req.body; // extract card info from req.body - ... - } catch (e) { - res.status(400).send(e); - } - }); -``` - - + + ```ts title="server-side" + // Process POST request to "/subscription/issue-billing" + app.post("/subscriptions/issue-billing", async (req, res) => { + try { + const { + card_number, // card number + expiry, // card expiration + birth, // DOB + pwd_2digit, // first 2-digits of card password + customer_uid, // value that maps 1:1 with card (billing key) + } = req.body; // extract card info from req.body + } catch (e) { + res.status(400).send(e); + } + }); + ``` + ### **STEP 03.** Request billing key and handle response -Request for a billing key by using the i'mport [**Get billing key REST API**](../../../api/billing-key-api/get-billing-key-api) and +Request for a billing key by using the i'mport [**Get billing key REST API**](../../../api/api/readme) and return a response based on the result code. - -```javascript title="server-side" + + ```ts title="server-side" // Process POST request to "/subscription/issue-billing" app.post("/subscriptions/issue-billing", async (req, res) => { try { @@ -200,7 +211,6 @@ return a response based on the result code. pwd_2digit, // First 2-digits of card password customer_uid, // Unique ID for each card (billing key) } = req.body; // Get card info from req.body - ... // Get billing key const getToken = await axios({ url: "https://api.iamport.kr/users/getToken", @@ -208,47 +218,48 @@ return a response based on the result code. headers: { "Content-Type": "application/json" }, // "Content-Type": "application/json" data: { imp_key: "imp_apikey", // REST API key - imp_secret: "ekKoeW8RyKuT0zgaZsUtXXTLQ4AhPFW3ZGseDA6bkA5lamv9OqDMnxyeB9wqOsuO9W3Mx9YSJ4dTqJ3f" // REST API Secret - } + imp_secret: + "ekKoeW8RyKuT0zgaZsUtXXTLQ4AhPFW3ZGseDA6bkA5lamv9OqDMnxyeB9wqOsuO9W3Mx9YSJ4dTqJ3f", // REST API Secret + }, }); const { access_token } = getToken.data.response; // Access token - ... // Get access token const issueBilling = await axios({ - url: \`https://api.iamport.kr/subscribe/customers/\${customer_uid}\`, + url: `https://api.iamport.kr/subscribe/customers/${customer_uid}`, method: "post", - headers: { "Authorization": access_token }, // Add access token to authorization header + headers: { Authorization: access_token }, // Add access token to authorization header data: { card_number, // Card number expiry, // Card expiration birth, // Date of birth pwd_2digit, // First 2-digits of card password - } + }, }); - ... const { code, message } = issueBilling.data; - if (code === 0) { // Billing key request successful - res.send({ status: "success", message: "Billing has successfully issued" }); - } else { // Billing key request failed + if (code === 0) { + // Billing key request successful + res.send({ + status: "success", + message: "Billing has successfully issued", + }); + } else { + // Billing key request failed res.send({ status: "failed", message }); } } catch (e) { res.status(400).send(e); } }); -``` - - + ``` + -**To use the i'mport REST API, you must first get an** [**access token**](../../../api/rest-api-access-token)**.** - + **To use the i'mport REST API, you must first get an** [**access token**](../../../api/rest-api-access-token)**.** -**Request billing key and make payment at once** - -By using the key-in payment REST API[**`/subscribe/payments/onetime`**](../../../api/api/readme), you can get the billing key and make a payment in a single API call. + **Request billing key and make payment at once** + By using the key-in payment REST API[**`/subscribe/payments/onetime`**](../../../api/api/readme), you can get the billing key and make a payment in a single API call. diff --git a/src/content/docs/en/auth/guide/2.mdx b/src/content/docs/en/auth/guide/2.mdx index 5f2b78c13..92f4846cf 100644 --- a/src/content/docs/en/auth/guide/2.mdx +++ b/src/content/docs/en/auth/guide/2.mdx @@ -7,20 +7,20 @@ import Tab from "~/components/gitbook/tabs/Tab.astro"; import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Hint from "~/components/Hint.astro"; -#### On the checkout page, initialize the IMP object using your [Merchant ID](../../ready/3). +On the checkout page, initialize the IMP object using your [Merchant ID](../../ready/3). ```javascript title="Client-side" - var IMP = window.IMP; // Can be omitted - IMP.init("Merchant ID"); // Example: imp00000000 + var IMP = window.IMP; // Can be omitted + IMP.init("Merchant ID"); // Example: imp00000000 ``` ```javascript title="Client-side" - const IMP = window.IMP; // Can be omitted - IMP.init("{Merchant ID}"); // Example: imp00000000a + const IMP = window.IMP; // Can be omitted + IMP.init("{Merchant ID}"); // Example: imp00000000a ``` diff --git a/src/content/docs/en/auth/guide/3.mdx b/src/content/docs/en/auth/guide/3.mdx index d68d611d9..723e99fde 100644 --- a/src/content/docs/en/auth/guide/3.mdx +++ b/src/content/docs/en/auth/guide/3.mdx @@ -11,46 +11,44 @@ import Hint from "~/components/Hint.astro"; Once [**IMP object initialization**](2) is complete, you can open the payment window. -You can pass the [**parameters**](../../sdk/javascript-sdk/readme) required to call the payment window in -the first argument of the **request\_pay** function. +You can pass the [**parameters**](../../sdk/javascript-sdk/readme) required to call the payment +window in the first argument of the **request\_pay** function. - ```javascript - + }, + ); ``` - ```jsx - class RequestPay extends React.Component { - requestPay = () => { - IMP.request_pay({ // param + ```tsx + export class RequestPay extends React.Component { + requestPay = () => { + IMP.request_pay( + { + // param pg: "kcp", pay_method: "card", merchant_uid: "ORD20180131-0000011", @@ -60,54 +58,53 @@ the first argument of the **request\_pay** function. buyer_name: "Hong Gildong", buyer_tel: "010-4242-4242", buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", - buyer_postcode: "01181" - }, rsp => { // callback + buyer_postcode: "01181", + }, + (rsp) => { + // callback if (rsp.success) { - ..., // Payment is successful - ... } else { - ..., // Payment failed - ... } - }); - } + }, + ); + }; + } ``` - ```javascript - + ```ts + export default { + methods: { + requestPay: function () { + IMP.request_pay( + { + // param + pg: "kcp", + pay_method: "card", + merchant_uid: "ORD20180131-0000011", + name: "Norway swivel chair", + amount: 64900, + buyer_email: "gildong@gmail.com", + buyer_name: "Hong Gildong", + buyer_tel: "010-4242-4242", + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "01181", + }, + (rsp) => { + // callback + if (rsp.success) { + // Payment is successful + } else { + // Payment failed + } + }, + ); + }, + }, + }; ``` @@ -115,11 +112,11 @@ the first argument of the **request\_pay** function. **Note - Creating an order ID (merchant\_uid)** - - The order number must always be assigned a **unique** **value** when the payment window is requested. + - The order number must always be assigned a **unique value** when the payment window is requested. - After the payment process is complete, the server uses the order ID to retrieve the order information for **payment fraud check**. Be sure to create a **unique ID** on the merchant server and **store it in the DB**. -#### The following is the above sample code with the Pay button added. +The following is the above sample code with the Pay button added. ```html title="sample.html" diff --git a/src/content/docs/en/auth/guide/4/iframe.mdx b/src/content/docs/en/auth/guide/4/iframe.mdx index 4572c9e39..e1b662940 100644 --- a/src/content/docs/en/auth/guide/4/iframe.mdx +++ b/src/content/docs/en/auth/guide/4/iframe.mdx @@ -15,7 +15,8 @@ import Hint from "~/components/Hint.astro";
-#### Most payments that are processed in the PC environment can receive payment results through the callback function, which is the second argument of the request\_pay() function. +Most payments that are processed in the PC environment can receive payment results +through the callback function, which is the second argument of the request\_pay() function. For **PayPal** payments, the payment window is loaded as a **pop-up (new window)** in a PC environment and you can also receive the payment result through **m\_redirect\_url**. @@ -26,36 +27,47 @@ import Hint from "~/components/Hint.astro"; - ```javascript title="client-side" - IMP.request_pay({ - /* ...Omitted... */ - }, function (rsp) { // callback - if (rsp.success) { // payment successful: payment accepted or virtual account issued - // HTTP request with jQuery - jQuery.ajax({ - url: "{Merchant endpoint that receives server's payment info}", - method: "POST", - headers: { "Content-Type": "application/json" }, - data: { - imp_uid: rsp.imp_uid, // Payment ID - merchant_uid: rsp.merchant_uid // Order ID - } - }).done(function (data) { - // Merchant server payment API call is successful + ```ts title="client-side" + IMP.request_pay( + { + /* ...Omitted... */ + }, + function (rsp) { + // callback + if (rsp.success) { + // payment successful: payment accepted or virtual account issued + // HTTP request with jQuery + jQuery + .ajax({ + url: "{Merchant endpoint that receives server's payment info}", + method: "POST", + headers: { "Content-Type": "application/json" }, + data: { + imp_uid: rsp.imp_uid, // Payment ID + merchant_uid: rsp.merchant_uid, // Order ID + }, }) - } else { - alert("Payment failed. Error: " + rsp.error_msg); - } - }); + .done(function (data) { + // Merchant server payment API call is successful + console.log(data); + }); + } else { + alert("Payment failed. Error: " + rsp.error_msg); + } + }, + ); ``` - ```javascript title="client-side" - IMP.request_pay({ + ```ts title="client-side" + IMP.request_pay( + { /* ...Omitted... */ - }, rsp => { // callback - if (rsp.success) { + }, + (rsp) => { + // callback + if (rsp.success) { // HTTP request with axios axios({ url: "{Endpoint that receives server's payment info}", @@ -63,27 +75,30 @@ import Hint from "~/components/Hint.astro"; headers: { "Content-Type": "application/json" }, data: { imp_uid: rsp.imp_uid, - merchant_uid: rsp.merchant_uid - } + merchant_uid: rsp.merchant_uid, + }, }).then((data) => { // Server payment API call is successful - }) + console.log(data); + }); } else { - alert(\`Payment failed. Error: \${rsp.error_msg}\`); + alert(`Payment failed. Error: ${rsp.error_msg}`); } - }); + }, + ); ``` Based on the the payment result (sucess/fail) in the response object -([**rsp**](../../../sdk/javascript-sdk/readme)) returned after the payment process is complete, add the -post-payment processing logic in the **callback** function. When the payment is successful, add the -logic to **send the payment ID (imp\_uid) and order ID (merchant\_uid) to the server** as shown +([**rsp**](../../../sdk/javascript-sdk/readme)) returned after the payment process is complete, add +the post-payment processing logic in the **callback** function. When the payment is successful, add +the logic to **send the payment ID (imp\_uid) and order ID (merchant\_uid) to the server** as shown above. > For information about the response parameter passed to the **callback** function, refer to [**rsp**](../../../sdk/javascript-sdk/undefined-1). - The final payment result logic processing must be handled stably by using a [**webhook**](../../../result/webhook). If you don't set up a webhook, you may fail to receive the payment result. + The final payment result logic processing must be handled stably by using a [**webhook**](../../../result/webhook). + If you don't set up a webhook, you may fail to receive the payment result. diff --git a/src/content/docs/en/auth/guide/readme.mdx b/src/content/docs/en/auth/guide/readme.mdx index f84f80603..f27eb7c9a 100644 --- a/src/content/docs/en/auth/guide/readme.mdx +++ b/src/content/docs/en/auth/guide/readme.mdx @@ -23,7 +23,8 @@ authentication result. Communication for a live payment request is made directly between the merchant server and the PG server, and card information is not used in the payment request process. -#### Authenticated payment is traditionally categorized into the following two types based on the authentication method. +Authenticated payment is traditionally categorized into the following two types +based on the authentication method. - ISP: authenticates pre-registered card information through a public key-based digital certificate - MPI: authenticates card information by entering the card number, CVC, and secure click password. @@ -33,7 +34,7 @@ to pre-register a credit card and use the **6-digit payment password** to easily
-#### You can easily integrate authenticated payments through i'mport! +You can easily integrate authenticated payments through i'mport! ## 1. Add i'mport library @@ -58,18 +59,18 @@ Add the JS library to your checkout page. ## 2. Initialize IMP object -#### On the checkout page, initialize the IMP object using your [Merchant ID](../../ready/3). +On the checkout page, initialize the IMP object using your [Merchant ID](../../ready/3). - ```javascript title="Client-side" - var IMP = window.IMP; // Can be omitted + ```ts title="Client-side" + const IMP = window.IMP; // Can be omitted IMP.init("Merchant ID"); // Example: imp00000000 ``` - ```javascript title="Client-side" + ```ts title="Client-side" const IMP = window.IMP; // Can be omitted IMP.init("{Merchant ID}"); // Example: imp00000000a ``` @@ -84,46 +85,44 @@ Add the JS library to your checkout page. Once [**IMP object initialization**](2) is complete, you can open the payment window. -You can pass the [**parameters**](../../sdk/javascript-sdk/readme) required to call the payment window in -the first argument of the **request\_pay** function. +You can pass the [**parameters**](../../sdk/javascript-sdk/readme) required to call the payment +window in the first argument of the **request\_pay** function. - ```javascript - + }, + ); ``` - ```jsx - class RequestPay extends React.Component { - requestPay = () => { - IMP.request_pay({ // param + ```tsx + export class RequestPay extends React.Component { + requestPay = () => { + IMP.request_pay( + { + // param pg: "kcp", pay_method: "card", merchant_uid: "ORD20180131-0000011", @@ -133,54 +132,53 @@ the first argument of the **request\_pay** function. buyer_name: "Hong Gildong", buyer_tel: "010-4242-4242", buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", - buyer_postcode: "01181" - }, rsp => { // callback + buyer_postcode: "01181", + }, + (rsp) => { + // callback if (rsp.success) { - ..., // Payment is successful - ... } else { - ..., // Payment failed - ... } - }); - } + }, + ); + }; + } ``` - ```javascript - + ```ts + export default { + methods: { + requestPay: function () { + IMP.request_pay( + { + // param + pg: "kcp", + pay_method: "card", + merchant_uid: "ORD20180131-0000011", + name: "Norway swivel chair", + amount: 64900, + buyer_email: "gildong@gmail.com", + buyer_name: "Hong Gildong", + buyer_tel: "010-4242-4242", + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "01181", + }, + (rsp) => { + // callback + if (rsp.success) { + // Payment is successful + } else { + // Payment failed + } + }, + ); + }, + }, + }; ``` @@ -188,11 +186,11 @@ the first argument of the **request\_pay** function. **Note - Creating an order ID (merchant\_uid)** - - The order number must always be assigned a **unique** **value** each time the payment window is requested. + - The order number must always be assigned a **unique value** each time the payment window is requested. - After the payment process is complete, the server uses the order ID to retrieve the order information for **payment fraud check**. Be sure to create a **unique ID** on the merchant server and **store it in the DB**. -#### The following is the above sample code with the Pay button added. +The following is the above sample code with the Pay button added. ```html title="sample.html" @@ -263,7 +261,8 @@ the payment window type as follows:
-#### Most payments that are processed in the PC environment can receive payment results through the callback function, which is the second argument of the request\_pay() function. +Most payments that are processed in the PC environment can receive payment results +through the callback function, which is the second argument of the request\_pay() function. For **PayPal** payments, the payment window is loaded as a **pop-up (new window)** in a PC environment and you can also receive the payment result through **m\_redirect\_url**. @@ -274,7 +273,7 @@ the payment window type as follows: - ```javascript title="client-side" + ```ts title="client-side" IMP.request_pay( { /* ...Omitted... */ @@ -296,6 +295,7 @@ the payment window type as follows: }) .done(function (data) { // Merchant server payment API call is successful + console.log(data); }); } else { alert("Payment failed. Error: " + rsp.error_msg); @@ -306,11 +306,14 @@ the payment window type as follows: - ```javascript title="client-side" - IMP.request_pay({ + ```ts title="client-side" + IMP.request_pay( + { /* ...Omitted... */ - }, rsp => { // callback - if (rsp.success) { + }, + (rsp) => { + // callback + if (rsp.success) { // HTTP request with axios axios({ url: "{Endpoint that receives server's payment info}", @@ -318,15 +321,17 @@ the payment window type as follows: headers: { "Content-Type": "application/json" }, data: { imp_uid: rsp.imp_uid, - merchant_uid: rsp.merchant_uid - } + merchant_uid: rsp.merchant_uid, + }, }).then((data) => { // Server payment API call is successful - }) + console.log(data); + }); } else { - alert(\`Payment failed. Error: \${rsp.error_msg}\`); + alert(`Payment failed. Error: ${rsp.error_msg}`); } - }); + }, + ); ``` @@ -351,20 +356,26 @@ above. - ```javascript title="client-side" - IMP.request_pay({ - /* ...Omitted... */, - m_redirect_url: "{redirect URL}" - }, /* callback */); // callback is not called + ```ts title="client-side" + IMP.request_pay( + { + /* ...Omitted... */ + m_redirect_url: "{redirect URL}", + }, + /* callback */ + ); // callback is not called ``` - ```javascript title="client-side" - IMP.request_pay({ - /* ...Omitted... */, - m_redirect_url: "{redirect URL}" - }, /* callback */); // callback is not called + ```ts title="client-side" + IMP.request_pay( + { + /* ...Omitted... */ + m_redirect_url: "{redirect URL}", + }, + /* callback */ + ); // callback is not called ``` @@ -376,13 +387,13 @@ The following is an example of redirecting URL based on the query string. - ```url + ```sh curl https://myservice.com/payments/complete?imp_uid=unique_iamport_paymentID&merchant_uid=unique_merchant_orderID&imp_success=true ``` - ``` + ```sh curl https://myservice.com/payments/complete?imp_uid=unique_iamport_paymentID&merchant_uid=unique_merchant_orderID&imp_success=false&error_code=error_code(none_defined_currently)&error_msg=error_message ``` @@ -405,19 +416,28 @@ The following is an example of redirecting URL based on the query string. > The `payment process is complete` when: > > 1. **Payment is successful** (Status: `paid`, imp\_success: `true`) +> > 2. **Payment fails** (Status: `failed`, imp\_success: `false`) +> > 3. **Payment window fails to open** due to PG module setting error +> > 4. User **terminates the payment process** by clicking the X or Cancel button -> 5. **Payment is suspended** due to invalid card information, limit exceeded, insufficient balance, etc. +> +> 5. **Payment is suspended** due to invalid card information, +> limit exceeded, insufficient balance, etc. +> > 6. **Virtual account is issued** (status: `ready`, imp\_success: `true`) - The final payment result logic processing must be handled stably by using a [**webhook**](../../result/webhook). If you don't set up a webhook, you may fail to receive the payment result. + The final payment result logic processing must be handled stably by using a [**webhook**](../../result/webhook). + If you don't set up a webhook, you may fail to receive the payment result. ## 5. Verify payment information -Based on the payment information from the client, the server verifies the **payment amount for fraud** and saves the payment information in the database if needed. The following are the steps for verifying the payment information. +Based on the payment information from the client, the server verifies the **payment amount for fraud** +and saves the payment information in the database if needed. +The following are the steps for verifying the payment information. - Server receives the i'mport payment ID (**imp\_uid**) and order ID (**merchant\_uid**) @@ -433,7 +453,7 @@ Based on the payment information from the client, the server verifies the Example of handling a POST request to the merchant endpoint URL that receives the payment information - ```javascript title="server-side" + ```ts title="server-side" app.use(bodyParser.json()); // "{Merchant endpoint that receives server's payment info}" POST request receiver app.post("/payments/complete", async (req, res) => { @@ -454,41 +474,38 @@ Based on the payment information from the client, the server verifies the Example of calling the [**Get payment**](https://api.iamport.kr/#!/payments/getPaymentByImpUid) **API** with the i'mport **payment ID (imp\_uid)** to retrieve the payment info. - ```javascript title="server-side" + ```ts title="server-side" app.use(bodyParser.json()); - ... - app.post("/payments/complete", async (req, res) => { - try { - // Get imp_uid, merchant_uid from req.body - const { imp_uid, merchant_uid } = req.body; - ... - // Get access token - const getToken = await axios({ - url: "https://api.iamport.kr/users/getToken", - method: "post", // POST method - headers: { "Content-Type": "application/json" }, - data: { - imp_key: "imp_apikey", // REST API key - imp_secret: "ekKoeW8RyKuT0zgaZsUtXXTLQ4AhPFW3ZGseDA6bkA5lamv9OqDMnxyeB9wqOsuO9W3Mx9YSJ4dTqJ3f" // REST API Secret - } - }); - const { access_token } = getToken.data.response; // access token - ... - // Get payment info from i'mport server using imp_uid - const getPaymentData = await axios({ - // Pass imp_uid - url: \`https://api.iamport.kr/payments/\${imp_uid}\`, - // GET method - method: "get", - // Add access toke to Authorization header - headers: { "Authorization": access_token } - }); - const paymentData = getPaymentData.data.response; // Payment info - ... - } catch (e) { - res.status(400).send(e); - } + app.post("/payments/complete", async (req, res) => { + try { + // Get imp_uid, merchant_uid from req.body + const { imp_uid, merchant_uid } = req.body; + // Get access token + const getToken = await axios({ + url: "https://api.iamport.kr/users/getToken", + method: "post", // POST method + headers: { "Content-Type": "application/json" }, + data: { + imp_key: "imp_apikey", // REST API key + imp_secret: + "ekKoeW8RyKuT0zgaZsUtXXTLQ4AhPFW3ZGseDA6bkA5lamv9OqDMnxyeB9wqOsuO9W3Mx9YSJ4dTqJ3f", // REST API Secret + }, }); + const { access_token } = getToken.data.response; // access token + // Get payment info from i'mport server using imp_uid + const getPaymentData = await axios({ + // Pass imp_uid + url: `https://api.iamport.kr/payments/${imp_uid}`, + // GET method + method: "get", + // Add access toke to Authorization header + headers: { Authorization: access_token }, + }); + const paymentData = getPaymentData.data.response; // Payment info + } catch (e) { + res.status(400).send(e); + } + }); ``` @@ -511,56 +528,66 @@ Based on the payment information from the client, the server verifies the Example of comparing the actual payment amount and the payment request amount, performing fraud check on the payment amount, and saving the data in the DB. - ```javascript title="server-side" + ```ts title="server-side" app.use(bodyParser.json()); - ... - app.post("/payments/complete", async (req, res) => { - try { - // Get imp_uid, merchant_uid from req.body - const { imp_uid, merchant_uid } = req.body; - // Get access token - /* ...Omitted... */ - // Get payment info from iamport server using imp_uid - /* ...Omitted... */ - const paymentData = getPaymentData.data.response; // Payment info - ... - // Get the requested payment amount from the DB - const order = await Orders.findById(paymentData.merchant_uid); - const amountToBePaid = order.amount; // Requested payment amount - ... - // Verify payment - const { amount, status } = paymentData; - // If amount matches. Processed amount === Requested amount - if (amount === amountToBePaid) { - await Orders.findByIdAndUpdate(merchant_uid, { $set: paymentData }); // Save payment info to DB - ... - switch (status) { - case "ready": // Issue virtual account - // Save virtual account info in DB - const { vbank_num, vbank_date, vbank_name } = paymentData; - await Users.findByIdAndUpdate("/* customer id */", { $set: { vbank_num, vbank_date, vbank_name }}); - // Send virtual account issuance text message - SMS.send({ text: \`Virtual account issued successfully. Account info \${vbank_num} \${vbank_date} \${vbank_name}\`}); - res.send({ status: "vbankIssued", message: "Virtual account issued successfully" }); - break; - case "paid": // Payment complete - res.send({ status: "success", message: "General payment successful" }); - break; - } - } else { // Amount mismatch. Forged/falsified payment. - throw { status: "forgery", message: "Forged/falsified payment attempted" }; + app.post("/payments/complete", async (req, res) => { + try { + // Get imp_uid, merchant_uid from req.body + const { imp_uid, merchant_uid } = req.body; + // Get access token + /* ...Omitted... */ + // Get payment info from iamport server using imp_uid + /* ...Omitted... */ + const paymentData = getPaymentData.data.response; // Payment info + // Get the requested payment amount from the DB + const order = await Orders.findById(paymentData.merchant_uid); + const amountToBePaid = order.amount; // Requested payment amount + // Verify payment + const { amount, status } = paymentData; + // If amount matches. Processed amount === Requested amount + if (amount === amountToBePaid) { + await Orders.findByIdAndUpdate(merchant_uid, { $set: paymentData }); // Save payment info to DB + switch (status) { + case "ready": // Issue virtual account + // Save virtual account info in DB + const { vbank_num, vbank_date, vbank_name } = paymentData; + await Users.findByIdAndUpdate("/* customer id */", { + $set: { vbank_num, vbank_date, vbank_name }, + }); + // Send virtual account issuance text message + SMS.send({ + text: `Virtual account issued successfully. Account info ${vbank_num} ${vbank_date} ${vbank_name}`, + }); + res.send({ + status: "vbankIssued", + message: "Virtual account issued successfully", + }); + break; + case "paid": // Payment complete + res.send({ + status: "success", + message: "General payment successful", + }); + break; } - } catch (e) { - res.status(400).send(e); + } else { + // Amount mismatch. Forged/falsified payment. + throw { + status: "forgery", + message: "Forged/falsified payment attempted", + }; } - }); + } catch (e) { + res.status(400).send(e); + } + }); ``` The original requested amount is queried from the database with the **`merchant_uid`**, and the actual processed amount is retrieved from the i'mport server with the **`imp_uid`**. The **two -values ​​are compared** to verify that they match. **If the verification is successful, +values are compared** to verify that they match. **If the verification is successful, the payment information is saved in the database** and a response is returned based on the payment status (**`status`**). Otherwise, an error message is returned. @@ -577,57 +604,69 @@ example. - ```javascript title="client-side" - IMP.request_pay({ + ```ts title="client-side" + IMP.request_pay( + { /* ...Omitted... */ - }, function (rsp) { // callback - if (rsp.success) { // payment successful: payment accepted or virtual account issued - // jQuery HTTP request - jQuery.ajax({ + }, + function (rsp) { + // callback + if (rsp.success) { + // payment successful: payment accepted or virtual account issued + // jQuery HTTP request + jQuery + .ajax({ /* ...Omitted... */ - }).done(function(data) { // response processing - switch(data.status) { - case: "vbankIssued": + }) + .done(function (data) { + // response processing + switch (data.status) { + case "vbankIssued": // Virtual account issued break; - case: "success": + case "success": // Payment successful break; } }); } else { - alert("Payment failed. Error message: " + rsp.error_msg); + alert("Payment failed. Error message: " + rsp.error_msg); } - }); + }, + ); ``` - ```javascript title="client-side" - IMP.request_pay({ + ```ts title="client-side" + IMP.request_pay( + { /* ...Omitted... */ - }, rsp => { // callback - if (rsp.success) { // payment successful: payment accepted or virtual account issued + }, + (rsp) => { + // callback + if (rsp.success) { + // payment successful: payment accepted or virtual account issued // axios HTTP request axios({ /* ...Omitted... */ - }).then((data) => { // Response processing - switch(data.status) { - case: "vbankIssued": + }).then((data) => { + // Response processing + switch (data.status) { + case "vbankIssued": // Virtual account issued break; - case: "success": + case "success": // Payment successful break; } }); } else { - alert(\`Payment failed. Error message: \${rsp.error_msg}\`); + alert(`Payment failed. Error message: ${rsp.error_msg}`); } - - }); - + }, + ); ``` @@ -640,6 +679,3 @@ payment complete message from the merchant endpoint URL** set in the **m\_redire These parameters are returned as a response when the payment fails and they contains the same values returned from the PG without additional processing. Note that we don't yet provide definitions for the error codes and error messages that have accumulated in our system. - -``` -``` diff --git a/src/content/docs/en/console/pg.mdx b/src/content/docs/en/console/pg.mdx index 9b9cd680f..53c6f6089 100644 --- a/src/content/docs/en/console/pg.mdx +++ b/src/content/docs/en/console/pg.mdx @@ -4,56 +4,58 @@ description: Learn how to set up and use multiple PGs. --- import Figure from "~/components/Figure.astro"; -import Hint from "~/components/Hint.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; +import Hint from "~/components/Hint.astro"; -### Set up multiple PGs in the i'mport **Admin console** and open a payment window for the desired payment method. +Set up multiple PGs in the i'mport **Admin console** +and open a payment window for the desired payment method. -### 1. Configure authenticated payment (general) +## 1. Configure authenticated payment (general) -Go to [**i'mport Admin Console > System Settings > PG Settings tab > Default PG tab**](https://admin.iamport.kr/settings#tab_pg) to set the `default PG` that is used as the default `param.pg` value when you call [`IMP.request_pay`](https://docs.iamport.kr/en-US/sdk/javascript-sdk#request_pay) to open the payment window. The default value is used when the `pg` value is missing or invalid. +Go to [**i'mport Admin Console > System Settings > PG Settings tab > Default PG tab**](https://admin.iamport.kr/settings#tab_pg) +to set the `default PG` that is used as the default `param.pg` value +when you call [`IMP.request_pay`](https://docs.iamport.kr/en-US/sdk/javascript-sdk#request_pay) +to open the payment window. The default value is used when the `pg` value is missing or invalid. -
+
-### 2. Add PG for subscription payment (for non-authenticated/**PG payment window)** +## 2. Add PG for subscription payment (for non-authenticated/**PG payment window)** -After acquiring a separate Merchant ID (MID) for subscription (non-authenticated) payment from the PG, use it to add the PG from the [**i'mport Admin Console > System Settings > PG Settings (general/subscription) tab**](https://admin.iamport.kr/settings#tab_pg). +After acquiring a separate Merchant ID (MID) for subscription (non-authenticated) payment +from the PG, use it to add the PG from the [**i'mport Admin Console > System Settings > PG Settings (general/subscription) tab**](https://admin.iamport.kr/settings#tab_pg).
-### 3. **Add PG for simple payment (Kakao Pay)** +## 3. **Add PG for simple payment (Kakao Pay)** Repeat step 2 to add PG setting for Kakao Pay. -
+
-## Open PG's payment window +## Open PG's payment window -To open a PG's payment window, call [**JavaScript SDK**](../sdk/javascript-sdk/readme) `IMP.request_pay` by specifying the PG that is already configured in **Admin console** in the `param.pg` property. +To open a PG's payment window, call [**JavaScript SDK**](../sdk/javascript-sdk/readme) `IMP.request_pay` +by specifying the PG that is already configured in **Admin console** in the `param.pg` property. -The [`pg` value](https://docs.iamport.kr/en-US/sdk/javascript-sdk#request_pay) can have the following format: +The [`pg` value](https://docs.iamport.kr/en-US/sdk/javascript-sdk#request_pay) +can have the following format: - **`{ PG code }`** - **`{ PG code }.{ PG Merchant ID }`** Assume that we have added **3 PG settings** as follows: -| PG | Merchant ID | Pay Type | Default PG | -| --------------- | ----------------- | ---------------- | ---------- | -| **`KG INICIS`** | `MID-a` (example) | **General** | O | -| **`KG INICIS`** | `MID-b` (example) | **Subscription** | X | -| `Kakao Pay` | `MID-c` (example) | Simple | X | +|PG |Merchant ID |Pay Type |Default PG| +|---------------|-----------------|----------------|----------| +|**`KG INICIS`**|`MID-a` (example)|**General** |O | +|**`KG INICIS`**|`MID-b` (example)|**Subscription**|X | +|`Kakao Pay` |`MID-c` (example)|Simple |X | -Of the previously added PG settings, `Kakao Pay` can be identified just with the `PG service code`. Set **`kakaopay`** in the `pg` property for the Kakao Pay payment request as follows: +Of the previously added PG settings, `Kakao Pay` can be identified just with the `PG service code`. +Set **`kakaopay`** in the `pg` property for the Kakao Pay payment request as follows: -```javascript title="client-side" +```ts title="client-side" IMP.request_pay({ pg: "kakaopay", //Open Kakao Pay payment page amount: 1000, @@ -63,39 +65,39 @@ IMP.request_pay({ }); ``` -Of the previously added PG settings, **`KG INICIS (general)`** and **`KG INICIS (subscription)`** have the **same PG service code**. Hence, you need to set `pg` to a value that combines the service code with the Merchant ID, **`{ PG Code }.{ PG Merchant ID }`**. +Of the previously added PG settings, **`KG INICIS (general)`** and **`KG INICIS (subscription)`** +have the **same PG service code**. +Hence, you need to set `pg` to a value that combines the service code with the Merchant ID, **`{ PG Code }.{ PG Merchant ID }`**. - -```javascript title="JavaScript" -IMP.request_pay({ - pg : "html5_inicis.MID-a", // Call KG INICIS general payment window (merchant ID: MID-a) - amount : 1000, - name : "Sample order", - buyer_name : "Buyer", - buyer_email : "buyer@iamport.kr" - }); -``` - - - - -```javascript title="JavaScript" -IMP.request_pay({ - pg : "html5_inicis.MID-b", // Call KG INICIS subscription payment window (merchant ID: MID-b) - amount : 1000, - name : "Sample order", - buyer_name : "Buyer", - buyer_email : "buyer@iamport.kr" - }); -``` - - + + ```ts title="JavaScript" + IMP.request_pay({ + pg: "html5_inicis.MID-a", // Call KG INICIS general payment window (merchant ID: MID-a) + amount: 1000, + name: "Sample order", + buyer_name: "Buyer", + buyer_email: "buyer@iamport.kr", + }); + ``` + + + + ```ts title="JavaScript" + IMP.request_pay({ + pg: "html5_inicis.MID-b", // Call KG INICIS subscription payment window (merchant ID: MID-b) + amount: 1000, + name: "Sample order", + buyer_name: "Buyer", + buyer_email: "buyer@iamport.kr", + }); + ``` + -**Matching priority for PG** - -[`IMP.request_pay`](https://docs.iamport.kr/en-US/sdk/javascript-sdk#request_pay) finds the setting that matches the `pg` value in the order the PG settings are shown in the **Admin console**. It opens the payment window for the first matching PG setting. + **Matching priority for PG** + [`IMP.request_pay`](https://docs.iamport.kr/en-US/sdk/javascript-sdk#request_pay) finds the setting that matches the `pg` value + in the order the PG settings are shown in the **Admin console**. It opens the payment window for the first matching PG setting. diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/blue-walnut.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/blue-walnut.mdx index 2eb6b476c..a26b71f30 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/blue-walnut.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/blue-walnut.mdx @@ -5,88 +5,86 @@ description: Blue Walnut payment window integration guide import Codepen from "~/components/gitbook/Codepen.astro"; import Details from "~/components/gitbook/Details.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; -### 1. Configure Blue Walnut PG settings +## 1. Configure Blue Walnut PG settings -Refer to the [**Blue Walnut settings**](../../ready/2-pg/payment-gateway-settings/undefined-7) page to configure the PG settings. +Refer to the [**Blue Walnut settings**](../../ready/2-pg/payment-gateway-settings/undefined-7) +page to configure the PG settings. ![]() -### 2. Request payment +## 2. Request payment -To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) IMP.**request_pay**(param, callback). +To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) +IMP.**request\_pay**(param, callback). -In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. In mobile browsers, the page is redirected to **m_redirect_url**. +In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. +In mobile browsers, the page is redirected to **m\_redirect\_url**. - -```javascript title="Javascript SDK" -IMP.request_pay({ - pg : 'bluewalnut', - pay_method : 'card', - merchant_uid : '{Merchant created Order ID}', // Example: order_no_0001 - name : 'Order name: Test payment request', - amount : 14000, - buyer_email : 'iamport@siot.do', // required - buyer_name : 'Jack Son', // Must include a space between Firstname Lastname - buyer_tel : '010-1234-5678', - buyer_addr : 'Shinsa-dong, Gangnam-gu, Seoul', - buyer_postcode : '123-456', - m_redirect_url : '{Mobile only - URL to redirect to after payment approval}' // Example: https://www.my-service.com/payments/complete/mobile -}, function(rsp) { // callback logic - //* ...Omitted... *// -}); -``` - -### - -### Key parameter description - -**`pg`** **\***\*\* ****s****tring\*\* - -**PG code** + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "bluewalnut", + pay_method: "card", + merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 + name: "Order name: Test payment request", + amount: 14000, + buyer_email: "iamport@siot.do", // required + buyer_name: "Jack Son", // Must include a space between Firstname Lastname + buyer_tel: "010-1234-5678", + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "123-456", + m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`bluewalnut`**. + ### Key parameter description -**`pay_method`** **\***\*\* ****s****tring\*\* + **`pg`** **\*** **string** -**Payment method code** + **PG code** -
-

Payment method codes

+ - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`bluewalnut`**. -- `card` (credit card) -- `trans`(instant account transfer) -- `vbank`(virtual account) -- `phone`(mobile micropayment) + **`pay_method`** **\*** **string** -
+ **Payment method code** -**`merchant_uid`** **\***\*\* ****s****tring\*\* +
+

Payment method codes

-**Order ID** + - `card` (credit card) + - `trans`(instant account transfer) + - `vbank`(virtual account) + - `phone`(mobile micropayment) +
-Must be unique for each request. + **`merchant_uid`** **\*** **string** -**`amount`** **\***\*\* ****integer\*\* + **Order ID** -**Payment amount** + Must be unique for each request. -Must be an integer (not string) + **`amount`** **\*** **integer** - + **Payment amount** -
+ Must be an integer (not string) - -#### Not supported + + -
+ + Not supported +
diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/danal.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/danal.mdx index 235abc633..b71dfc644 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/danal.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/danal.mdx @@ -5,256 +5,254 @@ description: Danal payment window integration guide import Codepen from "~/components/gitbook/Codepen.astro"; import Details from "~/components/gitbook/Details.astro"; -import Hint from "~/components/Hint.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; +import Hint from "~/components/Hint.astro"; -### 1. Configure Danal PG settings +## 1. Configure Danal PG settings -Refer to the [**Danal settings**](../../ready/2-pg/payment-gateway-settings/undefined-2) page to configure the PG settings. +Refer to the [**Danal settings**](../../ready/2-pg/payment-gateway-settings/undefined-2) page +to configure the PG settings. ![]() -### 2. Request payment +## 2. Request payment -To open the Danal TPay payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) IMP.**request_pay**(param, callback). +To open the Danal TPay payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) +IMP.**request\_pay**(param, callback). In both PC and mobile browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. - - -```javascript title="Javascript SDK" -IMP.request_pay( - { - pg: "danal_tpay", - pay_method: "card", - merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 - name: "Order name: Test payment request", - amount: 14000, - buyer_email: "iamport@siot.do", - buyer_name: "John Doe", - buyer_tel: "010-1234-5678", - buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", - buyer_postcode: "123-456", - }, - function (rsp) { - // callback logic - //* ...Omitted... *// - } -); -``` + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "danal_tpay", + pay_method: "card", + merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 + name: "Order name: Test payment request", + amount: 14000, + buyer_email: "iamport@siot.do", + buyer_name: "John Doe", + buyer_tel: "010-1234-5678", + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "123-456", + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` -### Key parameter description + ### Key parameter description -**`pg`** **\*** **s** **tring** + **`pg`** **\*** **string** -**PG code** + **PG code** -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`danal_tpay`**. + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`danal_tpay`**. -**`pay_method`** **\*** **s** **tring** + **`pay_method`** **\*** **string** -**Payment method code** + **Payment method code** -
-

Payment method codes

+
+

Payment method codes

-- `card` (credit card) -- `trans`(instant account transfer) -- `vbank`(virtual account) -- `cultureland`(Cultureland) -- `happymoney`(Happy Money) -- `booknlife` (Book n culture gift card) + - `card` (credit card) + - `trans`(instant account transfer) + - `vbank`(virtual account) + - `cultureland`(Cultureland) + - `happymoney`(Happy Money) + - `booknlife` (Book n culture gift card) +
-
+ **`merchant_uid`** **\*** **string** -**`merchant_uid`** **\*** **s** **tring** + **Order ID** -**Order ID** + Must be unique for each request. -Must be unique for each request. + **`buyer_tel`** **\*** **`string`** -**`buyer_tel`** **`*`** **`string`** + **Customer phone number** -**Customer phone number** + Danal payment window may throw an error if omitted -Danal payment window may throw an error if omitted + **`amount`** **\*** **integer** -**`amount`** **\*** **integer** + **Payment amount** -**Payment amount** + Must be an integer (not string) -Must be an integer (not string) + + #### Virtual account payment requirement - -#### Virtual account payment requirement + - **`biz_num`**: 10-digit business registration number (required) + -- **`biz_num`**: 10-digit business registration number (required) + +
- + + To open non-authenticated payment window, specify the **customer\_uid** parameter. - - + + #### **amount** - -To open non-authenticated payment window, specify the **customer\_uid** parameter. + - If requesting **both billing key and initial payment**, specify the payment amount. - -#### **amount** - -- If requesting **both billing key and initial payment**, specify the payment amount. -- If only requesting for billing key, set to **0**.\ - (if amount is set to 0, Danal executes a test payment of 10 won which is automatically cancelled after 30 minutes.) - - - -```javascript title="Javascript SDK" -IMP.request_pay( - { - pg: "danal_tpay", - pay_method: "card", // only 'card' supported. - merchant_uid: "{Merchant created Order ID}", // Example: issue_billingkey_monthly_0001 - name: "Order name: Billing key request test", - amount: 0, // For display purpose only (set actual amount to also request payment approval). - customer_uid: "{Unique ID for the card (billing key)}", // Required (Example: gildong_0001_1234) - buyer_email: "johndoe@gmail.com", - buyer_name: "John Doe", - buyer_tel: "02-1234-1234", - buyer_addr: "Samseong-dong, Gangnam-gu, Seoul", - period: { - from: "20200101", //YYYYMMDD - to: "20201231", //YYYYMMDD - }, - }, - function (rsp) { - if (rsp.success) { - alert("Success"); - } else { - alert("Failed"); - } - } -); -``` + - If only requesting for billing key, set to **0**.\ + (if amount is set to 0, Danal executes a test payment of 10 won which is automatically cancelled after 30 minutes.) + -### Key parameter description + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "danal_tpay", + pay_method: "card", // only 'card' supported. + merchant_uid: "{Merchant created Order ID}", // Example: issue_billingkey_monthly_0001 + name: "Order name: Billing key request test", + amount: 0, // For display purpose only (set actual amount to also request payment approval). + customer_uid: "{Unique ID for the card (billing key)}", // Required (Example: gildong_0001_1234) + buyer_email: "johndoe@gmail.com", + buyer_name: "John Doe", + buyer_tel: "02-1234-1234", + buyer_addr: "Samseong-dong, Gangnam-gu, Seoul", + period: { + from: "20200101", //YYYYMMDD + to: "20201231", //YYYYMMDD + }, + }, + function (rsp) { + if (rsp.success) { + alert("Success"); + } else { + alert("Failed"); + } + }, + ); + ``` -**`pg`** **\***\*\* ****s****tring\*\* + ### Key parameter description -**PG code** + **`pg`** **\*** **string** -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`danal_tpay`**. + **PG code** -**`customer_uid`** **\*** **string** + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`danal_tpay`**. -**Credit card billing key** + **`customer_uid`** **\*** **string** -Billing key to be mapped 1:1 with the user-entered credit card information. + **Credit card billing key** -**`amount`** **\*** **Integer** + Billing key to be mapped 1:1 with the user-entered credit card information. -**Payment amount** + **`amount`** **\*** **Integer** -0: only billing key, **> 0: billing key + initial payment** + **Payment amount** -**` period`` `****`array`** + 0: only billing key, **> 0: billing key + initial payment** -Product subscription payment for subscription payment. The date is displayed on the Danal payment window. + **`period`` `****`array`** -**`from`****`: YYYYMMDD`** + Product subscription payment for subscription payment. The date is displayed on the Danal payment window. -**`to`****`: YYYYMMDD`**\ + **`from`****`: YYYYMMDD`** -### Request payment with billing key (customer_uid) + **`to`****`: YYYYMMDD`**\\ -After successfully getting the billing key, the billing key is **stored on the i'mport server** mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the [**non-authenticated payment request REST API**](../../api/api/api) with the `customer_uid` as follows: + ### Request payment with billing key (customer\_uid) -```title="sever-side" -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 -``` + After successfully getting the billing key, + the billing key is **stored on the i'mport server** mapped 1:1 with the specified `customer_uid`. + For security reasons, the server cannot directly access the billing key. + Subsequent payments can be requested by calling + the [**non-authenticated payment request REST API**](../../api/api/api) + with the `customer_uid` as follows: -
+ ```sh title="sever-side" + 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 + ``` +
-### 3. Additional functions +## 3. Additional functions - -```javascript title="javascript" -display: { - card_quota: [6] // Display up to 6 months installment plans -} -``` - -**Parameters** - -- **card_quota :** - - `[]`: Only immediate pay - - `3,6`: immediate, 3, 6 month installment plans - - -Installment plan option is available only for **KRW 50,000 or more**. - - - - - - - - -```javascript title="javascript" -card: { - direct: { - code: "367", - quota: 3, - usePoint : “Y” + + ```json title="javascript" + { + "display": { + "card_quota": [6] // Display up to 6 months installment plans + } } -} -``` - -**Parameters** - -- **code**: [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) -- **quota**: Installment plan. For immediate, set to 0. (**integer**) -- **usePoint**: Option to use points (post applied) - - -**Danal setup required** - -- Direct module call requires pre-setup by Danal. - - - - - - -```javascript title="javascript" -card : { - detail : [ - {card_code:"*", enabled:false}, // Disable all credit cards - {card_code:'366', enabled:true} // Enable specific credit card - ] -} -``` + ``` + + **Parameters** + + - **card\_quota :** + - `[]`: Only immediate pay + - `3,6`: immediate, 3, 6 month installment plans + + + Installment plan option is available only for **KRW 50,000 or more**. + + + + + + + ```json title="javascript" + { + "card": { + "direct": { + "code": "367", + "quota": 3, + "usePoint": "Y" + } + } + } + ``` + + **Parameters** + + - **code**: [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) + - **quota**: Installment plan. For immediate, set to 0. (**integer**) + - **usePoint**: Option to use points (post applied) + + + **Danal setup required** + + - Direct module call requires pre-setup by Danal. + + + + + ```json title="javascript" + { + "card": { + "detail": [ + { "card_code": "*", "enabled": false }, // Disable all credit cards + { "card_code": "366", "enabled": true }, // Enable specific credit card + ] + } + } + ``` -**Parameters** + **Parameters** -- **card_code:** [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string)** -- **enabled:** Option to enable the credit card (**boolean)** + - **card\_code:** [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) + (**string)** - + - **enabled:** Option to enable the credit card (**boolean)** - + + diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/daou-payjoa/readme.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/daou-payjoa/readme.mdx index 0d1a9cf5e..49a278899 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/daou-payjoa/readme.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/daou-payjoa/readme.mdx @@ -5,232 +5,232 @@ description: Daou payment window integration guide import ContentRef from "~/components/gitbook/ContentRef.astro"; import Details from "~/components/gitbook/Details.astro"; -import Hint from "~/components/Hint.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; +import Hint from "~/components/Hint.astro"; -### 1. Configure Daou PG settings +## 1. Configure Daou PG settings Refer to the [**Daou settings**](../../../ready/2-pg/payment-gateway-settings/daou) page to configure the PG settings. ![]() -### 2. Request payment +## 2. Request payment To open the payment window, call [JavaScript SDK](../../../sdk/javascript-sdk/readme) -IMP.**request_pay**(param, callback). +IMP.**request\_pay**(param, callback). -In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. In mobile browsers, the page is redirected to **m_redirect_url**. +In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. +In mobile browsers, the page is redirected to **m\_redirect\_url**. -**PAYJOA payment window integration requires ****JS SDK 1.2.0**** or later version.** - + **PAYJOA payment window integration requires ****JS SDK 1.2.0**** or later version.** - -```javascript title="Javascript SDK" -IMP.request_pay({ - pg : 'daou', - pay_method : 'card', - merchant_uid: 'mid_1234567890', - escrow: false, - amount: 1004, - name: 'NF long padding jacket M', - buyer_name: 'John Doe', - buyer_email: 'hello@world.com', - buyer_tel: '01012345678', - digital : false, // Set to true if contracted as digital - m_redirect_url: 'https://allerts.com/payments/complete', - bypass: { - // PAYJOA (DaouData) specific parameters - daou: { - PRODUCTCODE: 'iamport', - CASHRECEIPTFLAG: 2, - }, - }, - app_scheme: 'iamportappscheme', -}, function(rsp) { // callback logic - //* ...Omitted... *// -}); -``` - -### - -### Key parameter description - -**`pg`** **\*** **s** **tring** - -**PG code** + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "daou", + pay_method: "card", + merchant_uid: "mid_1234567890", + escrow: false, + amount: 1004, + name: "NF long padding jacket M", + buyer_name: "John Doe", + buyer_email: "hello@world.com", + buyer_tel: "01012345678", + digital: false, // Set to true if contracted as digital + m_redirect_url: "https://allerts.com/payments/complete", + bypass: { + // PAYJOA (DaouData) specific parameters + daou: { + PRODUCTCODE: "iamport", + CASHRECEIPTFLAG: 2, + }, + }, + app_scheme: "iamportappscheme", + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`daou`**. + ### Key parameter description -**`pay_method`** **\*** **s** **tring** + **`pg`** **\*** **string** -**Payment method code** + **PG code** -
-

Payment method codes

+ - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`daou`**. -- `card` (credit card) -- `trans`(instant account transfer) -- `vbank`(virtual account) + **`pay_method`** **\*** **string** -
+ **Payment method code** -**`merchant_uid`** **\*** **s** **tring** +
+

Payment method codes

-**Order ID** + - `card` (credit card) + - `trans`(instant account transfer) + - `vbank`(virtual account) +
-Must be unique for each request. + **`merchant_uid`** **\*** **string** -**`digital`** **`*`** **`string`** + **Order ID** -**Digital contents option** + Must be unique for each request. -Must specify the value based on the contract between merchant and PAYJOA. Otherwise, request will fail. + **`digital`** **`*`** **`string`** -**`bypass.daou.PRODUCTCODE`** **`string`** + **Digital contents option** -**Product code** + Must specify the value based on the contract between merchant and PAYJOA. Otherwise, request will fail. -If there is no specification for the value and the value is not specified, i'mport sets it to the default value (iamport) and sends it to PAYJOA. + **`bypass.daou.PRODUCTCODE`** **`string`** -**`bypass.daou.CASHRECEIPTFLAG`** **``** **`integer`** + **Product code** -**Cash receipt issuance code** + If there is no specification for the value and the value is not specified, i'mport sets it to the default value (iamport) and sends it to PAYJOA. -Auto cash receipt issuance code for cash payments (account transfer, virtual account) + **`bypass.daou.CASHRECEIPTFLAG`** **\`\`** **`integer`** -**`1: Allow`** + **Cash receipt issuance code** -**`2: Block`** + Auto cash receipt issuance code for cash payments (account transfer, virtual account) -**`app_scheme`** **`string`** + **`1: Allow`** -**Mobile app URL scheme** + **`2: Block`** -Required in mobile app + **`app_scheme`** **`string`** -**`amount`** **\*** **integer** + **Mobile app URL scheme** -**Payment amount** + Required in mobile app -Must be an integer (not string) + **`amount`** **\*** **integer** -**`escrow`** **`boolean`** + **Payment amount** -**Escrow option** + Must be an integer (not string) -Only supports account transfer and virtual account payment. + **`escrow`** **`boolean`** -
+ **Escrow option** - -#### **You can use i'mport REST API to request billing key, request payment, and schedule payment.** + Only supports account transfer and virtual account payment. + -### Request one-time payment + + **You can use i'mport REST API to request billing key, request payment, and schedule payment.** -To request a one-time payment, use the key-in REST[ **API POST /subscribe/payments/onetime**](../../../api/api/request-non-authenticated-payment-one-time-api). The card information is not saved during this process. + ### Request one-time payment -``` -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 -``` + To request a one-time payment, use the key-in REST[**API POST /subscribe/payments/onetime**](../../../api/api/request-non-authenticated-payment-one-time-api). + The card information is not saved during this process. -### + ```sh + 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 + ``` -### Request billing key + ### Request billing key -To request a billing key, use the billing key request REST [**API POST /subscribe/customers/\{customer_uid}**](../../../api/billing-key-api/api-1). + To request a billing key, use the billing key request REST [**API POST /subscribe/customers/\{customer\_uid}**](../../../api/billing-key-api/api-1). -``` -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 -``` + ```sh + 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 + ``` -### Request billing key + initial payment + ### Request billing key + initial payment -To request a billing key and initial payment, use the key-in REST [**API POST /subscribe/payments/onetime**](../../../api/api/request-non-authenticated-payment-one-time-api). + To request a billing key and initial payment, use the key-in REST [**API POST /subscribe/payments/onetime**](../../../api/api/request-non-authenticated-payment-one-time-api). -- **`customer_uid`** : required for saving the billing key. + - **`customer_uid`** : required for saving the billing key. -``` -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 -``` + ```sh + 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 + ``` -### Request payment with billing key + ### Request payment with billing key -After successfully getting the billing key and making the initial payment, the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the repeat pay REST API ([**POST /subscribe/payments/again**](../../../api/api/api)) with the `customer_uid` as follows: + After successfully getting the billing key and making the initial payment, the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the repeat pay REST API ([**POST /subscribe/payments/again**](../../../api/api/api)) with the `customer_uid` as follows: -``` -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 -``` + ```sh + 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 + ``` -**For detailed information, refer to:** + **For detailed information, refer to:** - - - + +
-### 3. Additional functions +## 3. Additional functions - -```javascript title="javascript" -display: { - card_quota: [6] // Display up to 6 months installment plans -} -``` - -**Parameters** - -- **card_quota :** - - `[]`: Only immediate pay - - `2,3,4,5,6`: immediate, 2, 3, 4, 5, 6 month installment plans\ + + ```json title="javascript" + { + "display": { + "card_quota": [6], // Display up to 6 months installment plans + } + } + ``` - -Installment plan option is available only for **KRW 50,000 or more**. + **Parameters** - + - **card\_quota :** + - `[]`: Only immediate pay + - `2,3,4,5,6`: immediate, 2, 3, 4, 5, 6 month installment plans\\ - + + Installment plan option is available only for **KRW 50,000 or more**. + + - -For escrow payment, the **`escrow`** parameter must be set to **true** . When the escrow payment is completed, the merchant must register the shipping information for **settlement**. You can manage shipping information by using the [**Add delivery info**](../../../api/escrow-api/add-delivery-info-api) and [**Update delivery info**](../../../api/escrow-api/update-delivery-info-api) APIs. + + For escrow payment, the **`escrow`** parameter must be set to **true** . + When the escrow payment is completed, the merchant must register the shipping information for **settlement**. + You can manage shipping information by using the [**Add delivery info**](../../../api/escrow-api/add-delivery-info-api) + and [**Update delivery info**](../../../api/escrow-api/update-delivery-info-api) APIs. -```javascript title="API Body Example" -{ - "logis": { + ```json title="API Body Example" + { + "logis": { "invoice": "1728384716123", "company": "CJGLS", "receiving_at": "20220215", "address": "16, Seongsui-ro 20-gil" - }, - "receiver": { + }, + "receiver": { "name": "John DOe" - }, - "sender": { + }, + "sender": { "relationship": "self" + } } -} -``` - - -**Precaution** + ``` -- When adding/updating the escrow delivery information, PAYJOA does not validate the delivery information (tracking number, courier name, etc.) received from the merchant. - - + + **Precaution** - + - When adding/updating the escrow delivery information, PAYJOA does not validate the delivery information + (tracking number, courier name, etc.) received from the merchant. + + diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/eximbay.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/eximbay.mdx index 9661a3e69..47b5d8368 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/eximbay.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/eximbay.mdx @@ -4,143 +4,147 @@ description: Eximbay payment window integration guide --- import Details from "~/components/gitbook/Details.astro"; -import Hint from "~/components/Hint.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; +import Hint from "~/components/Hint.astro"; -### 1. Configure Eximbay PG settings +## 1. Configure Eximbay PG settings Refer to the [**Eximbay settings**](../../ready/2-pg/payment-gateway-settings/undefined-6) page to configure the PG settings. ![]() -### 2. Request payment +## 2. Request payment To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) -IMP.**request_pay**(param, callback). +IMP.**request\_pay**(param, callback). In PC and mobile browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. - -```javascript title="Javascript SDK" -IMP.request_pay({ - pg : 'eximbay', - pay_method : 'card', - merchant_uid : '{Merchant created Order ID}', // Example: order_no_0001 - name : 'Order name: Test payment request', - amount : 14.20, - currency : 'USD', - buyer_email : 'iamport@siot.do', - buyer_name : 'John Doe', - buyer_tel : '010-1234-5678', // Required - buyer_addr : 'Shinsa-dong, Gangnam-gu, Seoul', - buyer_postcode : '123-456' -}, function(rsp) { // callback logic - //* ...Omitted... *// -}); -``` + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "eximbay", + pay_method: "card", + merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 + name: "Order name: Test payment request", + amount: 14.2, + currency: "USD", + buyer_email: "iamport@siot.do", + buyer_name: "John Doe", + buyer_tel: "010-1234-5678", // Required + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "123-456", + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` -#### + ### Key parameter description -### Key parameter description + **`pg`** **\*** **string** -**`pg`** **\***\*\* ****s****tring\*\* + **PG code** -**PG code** + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`eximbay`**. -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`eximbay`**. + **`pay_method`** **\*** **string** -**`pay_method`** **\***\*\* ****s****tring\*\* + **Payment method code** -**Payment method code** +
+

Payment method codes

-
-

Payment method codes

- -- `card` (credit card) -- `wechat` -- `alipay` -- `card` (foreign credit card) -- `unionpay` -- `tenpay` -- `econtext` (payment via Japanese convenience store) - -
+ - `card` (credit card) + - `wechat` + - `alipay` + - `card` (foreign credit card) + - `unionpay` + - `tenpay` + - `econtext` (payment via Japanese convenience store) +
-**`merchant_uid`** **\***\*\* ****s****tring\*\* + **`merchant_uid`** **\*** **string** -**Order ID** + **Order ID** -Must be unique for each request.\ + Must be unique for each request. -**`buyer_tel`****`*`****`string`** + **`buyer_tel`****\*****`string`** -**`Customer phone`** + **`Customer phone`** -**`amount`** **\***\*\* ****integer\*\* + **`amount`** **\*** **integer** -**Payment amount** + **Payment amount** -Must be an integer (not string) + Must be an integer (not string) -**`currency`****`string`** + **`currency`****`string`** -**Currency** + **Currency** -- KRW -- USD -- EUR -- GBP -- JPY -- THB -- SGD -- RUB -- HKD -- CAD -- AUD + - KRW + - USD + - EUR + - GBP + - JPY + - THB + - SGD + - RUB + - HKD + - CAD + - AUD -**` language`` `****`string`** + **`language`` `****`string`** -- Korean : ko -- English : en -- Chinese : zh -- Japanese : jp - -
+ - Korean : ko + - English : en + - Chinese : zh + - Japanese : jp +
-### Note - -i'mport does not support Eximbay subscription payment. + ### Note + i'mport does not support Eximbay subscription payment.
-

How to test convenience store payment

+

How to test convenience store payment

+ + ### Convenience store payment method + + As with virtual accounts in Korea, payment is processed at the convenience store counter using the message sent to the customer by e-mail or text message after requesting payment via the payment window. + + - i'mport internally sets pay\_method : vbank + - Sends callback and webhook to notify that Econtext has been created (status: ready / vbank\_num is fixed as unknown) + - When Econtext confirms payment deposit, i'mport receives a response from Eximbay, changes status to `paid`, and sends a webhook for post-payment processing + + ### **Convenience store payment test procedure** + + As with the virtual account, you need to test the result of the customer's deposit and receive a notification upon deposit. -### Convenience store payment method + 1. Set Eximbay test mode to `ON` and proceed with the payment window. -As with virtual accounts in Korea, payment is processed at the convenience store counter using the message sent to the customer by e-mail or text message after requesting payment via the payment window. + 2. Write down the `pg_tid` value from the callback response (check the value from the PG approval number column in the i'mport Admin console) -- i'mport internally sets pay_method : vbank -- Sends callback and webhook to notify that Econtext has been created (status: ready / vbank_num is fixed as unknown) -- When Econtext confirms payment deposit, i'mport receives a response from Eximbay, changes status to `paid`, and sends a webhook for post-payment processing + 3. Log in from [http://test.econ.ne.jp/site/tuchi\_2/tuchi\_menu\_2.html](http://test.econ.ne.jp/site/tuchi_2/tuchi_menu_2.html) \ + (ID: ectest / password: #eg0810# ) -### **Convenience store payment test procedure** + 4. ShopID : 361301, orderID : `pg_tid` (from step 2) -As with the virtual account, you need to test the result of the customer's deposit and receive a notification upon deposit. + 5. Click **登録** button at the bottom -1. Set Eximbay test mode to `ON` and proceed with the payment window. -2. Write down the `pg_tid` value from the callback response (check the value from the PG approval number column in the i'mport Admin console) -3. Log in from [http://test.econ.ne.jp/site/tuchi_2/tuchi_menu_2.html](http://test.econ.ne.jp/site/tuchi_2/tuchi_menu_2.html) \ - (ID: ectest / password: #eg0810# ) -4. ShopID : 361301, orderID : `pg_tid` (from step 2) -5. Click **登録** button at the bottom -6. On the next page, click **登録** button -7. Wait 10 minutes and then check that the status is changed to **paid** (at this point, webhook is sent to notify of the deposit) + 6. On the next page, click **登録** button + 7. Wait 10 minutes and then check that the status is changed to **paid** (at this point, webhook is sent to notify of the deposit)
diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/inicis.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/inicis.mdx index bd5138744..d218d34c8 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/inicis.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/inicis.mdx @@ -6,294 +6,289 @@ description: KG INICIS payment window integration guide import Codepen from "~/components/gitbook/Codepen.astro"; import ContentRef from "~/components/gitbook/ContentRef.astro"; import Details from "~/components/gitbook/Details.astro"; -import Hint from "~/components/Hint.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; +import Hint from "~/components/Hint.astro"; -### 1. Configure KG INICIS settings +## 1. Configure KG INICIS settings -Refer to the [**KG INICIS settings**](../../ready/2-pg/payment-gateway-settings/nhn-kcp-1) page to configure the PG settings. +Refer to the [**KG INICIS settings**](../../ready/2-pg/payment-gateway-settings/nhn-kcp-1) page +to configure the PG settings. ![](/gitbook-assets/en/7043_14679_1310.jpeg) -### 2. Request payment +## 2. Request payment -To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) IMP.**request_pay**(param, callback). +To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) +IMP.**request\_pay**(param, callback). -In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. In mobile browsers, the page is redirected to **m_redirect_url** . +In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. +In mobile browsers, the page is redirected to **m\_redirect\_url** . - + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "html5_inicis", + pay_method: "card", + merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 + name: "Order name: Test payment request", + amount: 14000, + buyer_email: "iamport@siot.do", + buyer_name: "John Doe", + buyer_tel: "010-1234-5678", + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "123-456", + m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` + + ### Key parameter description + + **`pg`** **\*** **string** -```javascript title="Javascript SDK" -IMP.request_pay( - { - pg: "html5_inicis", - pay_method: "card", - merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 - name: "Order name: Test payment request", - amount: 14000, - buyer_email: "iamport@siot.do", - buyer_name: "John Doe", - buyer_tel: "010-1234-5678", - buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", - buyer_postcode: "123-456", - m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile - }, - function (rsp) { - // callback logic - //* ...Omitted... *// - } -); -``` - -#### - -### Key parameter description - -**`pg`** **\*** **s** **tring** - -**PG code** - -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`html5_inicis`**. - -**`pay_method`** **\*** **s** **tring** - -**Payment method code** - -
-

Payment method codes

- -- `card` (credit card) -- `trans`(instant account transfer) -- `vbank`(virtual account) -- `phone`(mobile micropayment) -- `samsung`(Samsung Pay hub-type) -- `kakaopay`(Kakao Pay) -- `payco` ( PAYCO hub-type) -- `tosspay` (Toss Simple Pay hub-type) -- `ssgpay` (SSG Pay hub-type) -- `chai` (CHAI Pay) -- `lpay` (LPAY hub-type) -- `naverpay` (Naver Pay) -- `cultureland`(Cultureland) -- `smartculture`(Smart Culture) -- `happymoney`(Happy Money) - -
- -**`merchant_uid`** **\*** **s** **tring** - -**Order ID** - -Must be unique for each request. - -**`amount`** **\*** **integer** - -**Payment amount** - -Must be an integer (not string) - -**`buyer_tel`** **`*`** **`string`** - -**Customer phone number** - -Required - - - -
- - -### You can request for a billing key through the KG INICIS payment window. - -- To open non-authenticated payment window, specify the **customer_uid** parameter. -- After getting a billing key from the window, you can request payment using the billing key. -- **`amount`** parameter is for display purpose only. Actual payment approval is not processed. - -```javascript title="Javascript SDK" -IMP.request_pay( - { - pg: "html5_inicis", - pay_method: "card", // only 'card' supported. - merchant_uid: "{Merchant created Order ID}", // Example: issue_billingkey_monthly_0001 - name: "Initial billing key request", - amount: 0, // For display purpose only (no payment approval). - customer_uid: "{Unique ID for the card (billing key)}", // Required (Example: gildong_0001_1234) - buyer_email: "johndoe@gmail.com", - buyer_name: "John Doe", - buyer_tel: "02-1234-1234", - m_redirect_url: "{redirect URL}", // Example: https://www.my-service.com/payments/complete/mobile (for mobile only) - }, - function (rsp) { - if (rsp.success) { - alert("Success"); - } else { - alert("Failed"); - } - } -); -``` + **PG code** -### Key parameter description + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`html5_inicis`**. -**`pg`** **\*** **s** **tring** + **`pay_method`** **\*** **string** -**PG code** + **Payment method code** -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`html5_inicis`**. +
+

Payment method codes

-> If you have multiple merchant IDs (each for general and subscription) issued by KG INCIS, set to `html5_inicis.{Merchant ID}` or `inicis.{Merchant ID}`(for ActiveX). + - `card` (credit card) + - `trans`(instant account transfer) + - `vbank`(virtual account) + - `phone`(mobile micropayment) + - `samsung`(Samsung Pay hub-type) + - `kakaopay`(Kakao Pay) + - `payco` ( PAYCO hub-type) + - `tosspay` (Toss Simple Pay hub-type) + - `ssgpay` (SSG Pay hub-type) + - `chai` (CHAI Pay) + - `lpay` (LPAY hub-type) + - `naverpay` (Naver Pay) + - `cultureland`(Cultureland) + - `smartculture`(Smart Culture) + - `happymoney`(Happy Money) +
-**`customer_uid`** **\*** **string** + **`merchant_uid`** **\*** **string** -**Credit card billing key** + **Order ID** + + Must be unique for each request. -Billing key to be mapped 1:1 with the user-entered credit card information. + **`amount`** **\*** **integer** -**`amount`** **\*** **Integer** + **Payment amount** -**Payment amount** + Must be an integer (not string) -Amount to display in the payment window, but actual payment approval is not processed. (To request payment, use the **REST API with the customer_uid**.)\ + **`buyer_tel`** **`*`** **`string`** -### Request payment with billing key (customer_uid) + **Customer phone number** -After successfully getting the billing key, the billing key is **stored on the i'mport server** mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the [**non-authenticated payment request REST API**](../../api/api/api) with the `customer_uid` as follows: + Required -```title="sever-side" -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 -``` + +
-
+ + ### You can request for a billing key through the KG INICIS payment window. - -#### **You can use i'mport REST API to request billing key, request payment, and schedule payment.** + - To open non-authenticated payment window, specify the **customer\_uid** parameter. + - After getting a billing key from the window, you can request payment using the billing key. + - **`amount`** parameter is for display purpose only. Actual payment approval is not processed. -### Request one-time payment + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "html5_inicis", + pay_method: "card", // only 'card' supported. + merchant_uid: "{Merchant created Order ID}", // Example: issue_billingkey_monthly_0001 + name: "Initial billing key request", + amount: 0, // For display purpose only (no payment approval). + customer_uid: "{Unique ID for the card (billing key)}", // Required (Example: gildong_0001_1234) + buyer_email: "johndoe@gmail.com", + buyer_name: "John Doe", + buyer_tel: "02-1234-1234", + m_redirect_url: "{redirect URL}", // Example: https://www.my-service.com/payments/complete/mobile (for mobile only) + }, + function (rsp) { + if (rsp.success) { + alert("Success"); + } else { + alert("Failed"); + } + }, + ); + ``` -To request a one-time payment, use the key-in REST[ **API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). The card information is not saved during this process. + ### Key parameter description -``` -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 -``` + **`pg`** **\*** **string** -### + **PG code** -### Request billing key + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`html5_inicis`**. -To request a billing key, use the billing key request REST [**API POST /subscribe/customers/\{customer_uid}**](../../api/billing-key-api/api-1). + > If you have multiple merchant IDs (each for general and subscription) issued by KG INCIS, set to `html5_inicis.{Merchant ID}` or `inicis.{Merchant ID}`(for ActiveX). -``` -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`** **\*** **string** -### Request billing key + initial payment + **Credit card billing key** -To request a billing key and initial payment, use the key-in REST [**API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). + Billing key to be mapped 1:1 with the user-entered credit card information. -- **`customer_uid`** : required for saving the billing key. + **`amount`** **\*** **Integer** -``` -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 -``` + **Payment amount** -### Request payment with billing key + Amount to display in the payment window, but actual payment approval is not processed. + (To request payment, use the **REST API with the customer\_uid**.) -After successfully getting the billing key and making the initial payment, the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the repeat pay REST API ([**POST /subscribe/payments/again**](../../api/api/api)) with the `customer_uid` as follows: + ### Request payment with billing key (customer\_uid) -``` -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 -``` + After successfully getting the billing key, the billing key is **stored on the i'mport server** mapped 1:1 + with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. + Subsequent payments can be requested by calling + the [**non-authenticated payment request REST API**](../../api/api/api) + with the `customer_uid` as follows: -**For detailed information, refer to:** + ```sh title="sever-side" + 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 + ``` + - + + **You can use i'mport REST API to request billing key, request payment, and schedule payment.** - -
+ ### Request one-time payment -### 3. Additional functions + To request a one-time payment, use the key-in [**REST API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). + The card information is not saved during this process. - - + ```sh + 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 + ``` -```javascript title="javascript" -display: { - card_quota: [6]; // Display up to 6 months installment plans -} -``` + ### Request billing key -**Parameters** + To request a billing key, use the billing key request [**REST API POST /subscribe/customers/\{customer\_uid}**](../../api/billing-key-api/api-1). -- **card_quota :** - - `[]`: Only immediate pay - - `2,3,4,5,6`: immediate, 2, 3, 4, 5, 6 month installment plans\ + ```sh + 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 + ``` - -Installment plan option is available only for **KRW 50,000 or more**. + ### Request billing key + initial payment - + To request a billing key and initial payment, use the key-in [**REST API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). - + - **`customer_uid`** : required for saving the billing key. - + ```sh + 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 + ``` - + ### Request payment with billing key -```javascript title="javascript" -card: { - direct: { - code: "367", - quota: 3 - } -} -``` + After successfully getting the billing key and making the initial payment, + the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. + For security reasons, the server cannot directly access the billing key. + Subsequent payments can be requested by calling the repeat pay + REST API ([**POST /subscribe/payments/again**](../../api/api/api)) with the `customer_uid` as follows: -**Parameters** + ```sh + 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 + ``` -- **code**: [ **Credit card code** ](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) -- **quota**: Installment plan. For immediate, set to 0. (**integer**) + **For detailed information, refer to:** - + + + - +## 3. Additional functions - + + + ```json title="javascript" + { + "display": { + "card_quota": [6] // Display up to 6 months installment plans + } + } + ``` + + **Parameters** + + - **card\_quota :** + - `[]`: Only immediate pay + - `2,3,4,5,6`: immediate, 2, 3, 4, 5, 6 month installment plans\\ + + + Installment plan option is available only for **KRW 50,000 or more**. + + + + + + + ```json title="javascript" + { + "card": { + "direct": { + "code": "367", + "quota": 3 + } + } + } + ``` -```javascript title="javascript" -card: { - detail: [ - { card_code: "*", enabled: false }, // Disable all credit cards - { card_code: "366", enabled: true }, // Enable specific credit card - ]; -} -``` + **Parameters** -**Parameters** + - **code**: [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) + - **quota**: Installment plan. For immediate, set to 0. (**integer**) + + + + + + ```json title="javascript" + { + "card": { + "detail": [ + { "card_code": "*", "enabled": false }, // Disable all credit cards + { "card_code": "366", "enabled": true }, // Enable specific credit card + ] + } + } + ``` -- **card_code:** [ **Credit card code** ](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) -- **enabled:** Option to enable the credit card (**boolean**) + **Parameters** - + - **card\_code:** [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) + - **enabled:** Option to enable the credit card (**boolean**) + diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/jtnet.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/jtnet.mdx index 3d1519720..2d0159536 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/jtnet.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/jtnet.mdx @@ -6,231 +6,233 @@ description: JTNet payment window integration guide import Codepen from "~/components/gitbook/Codepen.astro"; import ContentRef from "~/components/gitbook/ContentRef.astro"; import Details from "~/components/gitbook/Details.astro"; -import Hint from "~/components/Hint.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; +import Hint from "~/components/Hint.astro"; -### 1. Configure JTNet settings +## 1. Configure JTNet settings Refer to the [**JTNET settings**](../../ready/2-pg/payment-gateway-settings/jtnet) page to configure the PG settings. ![]() -### 2. Request payment +## 2. Request payment To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) -IMP.**request_pay**(param, callback). +IMP.**request\_pay**(param, callback). -In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. In mobile browsers, the page is redirected to **m_redirect_url**. +In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. +In mobile browsers, the page is redirected to **m\_redirect\_url**. - - -```javascript title="Javascript SDK" -IMP.request_pay( - { - pg: "jtnet", - pay_method: "card", - merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 - name: "Order name: Test payment request", - amount: 14000, - buyer_email: "iamport@siot.do", - buyer_name: "John Doe", - buyer_tel: "010-1234-5678", - buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", - buyer_postcode: "123-456", - m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile - }, - function (rsp) { - // callback logic - //* ...Omitted... *// - } -); -``` - -#### - -### Key parameter description - -**`pg`** **\***\*\* ****s****tring\*\* + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "jtnet", + pay_method: "card", + merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 + name: "Order name: Test payment request", + amount: 14000, + buyer_email: "iamport@siot.do", + buyer_name: "John Doe", + buyer_tel: "010-1234-5678", + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "123-456", + m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` -**PG code** + ### Key parameter description -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`jtnet`**. + **`pg`** **\*** **string** -**`pay_method`** **\***\*\* ****s****tring\*\* + **PG code** -**Payment method code** + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`jtnet`**. -
-

Payment method codes

+ **`pay_method`** **\*** **string** -- `card` (credit card) -- `trans`(instant account transfer) -- `vbank`(virtual account) -- `phone`(mobile micropayment) + **Payment method code** -
+
+

Payment method codes

-**`merchant_uid`** **\***\*\* ****s****tring\*\* + - `card` (credit card) + - `trans`(instant account transfer) + - `vbank`(virtual account) + - `phone`(mobile micropayment) +
-**Order ID** + **`merchant_uid`** **\*** **string** -Must be unique for each request. + **Order ID** -**`amount`** **\***\*\* ****integer\*\* + Must be unique for each request. -**Payment amount** + **`amount`** **\*** **integer** -Must be an integer (not string) + **Payment amount** - + Must be an integer (not string) -
+ +
- -To open non-authenticated payment window, specify the **customer\_uid** parameter. + + To open non-authenticated payment window, specify the **customer\_uid** parameter. - -#### **amount** + + #### **amount** -- If requesting **both billing key and initial payment**, specify the payment amount. -- If only requesting for billing key, set to **0**. + - If requesting **both billing key and initial payment**, specify the payment amount. + - If only requesting for billing key, set to **0**. + - + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "jtnet", + pay_method: "card", // only 'card' supported. + merchant_uid: "{Merchant created Order ID}", // Example: issue_billingkey_monthly_0001 + name: "Initial billing key request", + amount: 0, // For display purpose only (no payment approval). + customer_uid: "{Unique ID for the card (billing key)}", // Required (Example: gildong_0001_1234) + buyer_email: "johndoe@gmail.com", + buyer_name: "John Doe", + buyer_tel: "02-1234-1234", + m_redirect_url: "{redirect URL}", // Example: https://www.my-service.com/payments/complete/mobile (for mobile only) + }, + function (rsp) { + if (rsp.success) { + alert("Success"); + } else { + alert("Failed"); + } + }, + ); + ``` -```javascript title="Javascript SDK" -IMP.request_pay( - { - pg: "jtnet", - pay_method: "card", // only 'card' supported. - merchant_uid: "{Merchant created Order ID}", // Example: issue_billingkey_monthly_0001 - name: "Initial billing key request", - amount: 0, // For display purpose only (no payment approval). - customer_uid: "{Unique ID for the card (billing key)}", // Required (Example: gildong_0001_1234) - buyer_email: "johndoe@gmail.com", - buyer_name: "John Doe", - buyer_tel: "02-1234-1234", - m_redirect_url: "{redirect URL}", // Example: https://www.my-service.com/payments/complete/mobile (for mobile only) - }, - function (rsp) { - if (rsp.success) { - alert("Success"); - } else { - alert("Failed"); - } - } -); -``` - -### Key parameter description - -**`pg`** **\***\*\* ****s****tring\*\* - -**PG code** + ### Key parameter description -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`jtnet`**. + **`pg`** **\*** **string** -> + **PG code** -**`customer_uid`** **\***\*\* ****string\*\* + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`jtnet`**. -**Credit card billing key** + > -Billing key to be mapped 1:1 with the user-entered credit card information. + **`customer_uid`** **\*** **string** -**`amount`** **\***\*\* ****Integer\*\* + **Credit card billing key** -**Payment amount** + Billing key to be mapped 1:1 with the user-entered credit card information. -0: only billing key, **> 0: billing key + initial payment**\ + **`amount`** **\*** **Integer** -### Request payment with billing key (customer_uid) + **Payment amount** -After successfully getting the billing key, the billing key is **stored on the i'mport server** mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the [**non-authenticated payment request REST API**](../../api/api/api) with the `customer_uid` as follows: + 0: only billing key, **> 0: billing key + initial payment**\\ -```title="sever-side" -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 -``` + ### Request payment with billing key (customer\_uid) - + After successfully getting the billing key, the billing key is **stored on the i'mport server** + mapped 1:1 with the specified `customer_uid`. + For security reasons, the server cannot directly access the billing key. + Subsequent payments can be requested by calling + the [**non-authenticated payment request REST API**](../../api/api/api) + with the `customer_uid` as follows: - -#### **You can use i'mport REST API to request billing key, request payment, and schedule payment.** + ```sh title="sever-side" + 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 + ``` + -### Request one-time payment + + **You can use i'mport REST API to request billing key, request payment, and schedule payment.** -To request a one-time payment, use the key-in REST[ **API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). The card information is not saved during this process. + ### Request one-time payment -``` -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 -``` + To request a one-time payment, use the key-in [**REST API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). The card information is not saved during this process. -### + ```sh + 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 + ``` -### Request billing key + ### Request billing key -To request a billing key, use the billing key request REST [**API POST /subscribe/customers/\{customer_uid}**](../../api/billing-key-api/api-1). + To request a billing key, use the billing key request REST [**API POST /subscribe/customers/\{customer\_uid}**](../../api/billing-key-api/api-1). -``` -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 -``` + ```sh + 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 + ``` -### Request billing key + initial payment + ### Request billing key + initial payment -To request a billing key and initial payment, use the key-in REST [**API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). + To request a billing key and initial payment, use the key-in REST [**API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). -- **`customer_uid`** : required for saving the billing key. + - **`customer_uid`** : required for saving the billing key. -``` -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 -``` + ```sh + 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 + ``` -### Request payment with billing key + ### Request payment with billing key -After successfully getting the billing key and making the initial payment, the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the repeat pay REST API ([**POST /subscribe/payments/again**](../../api/api/api)) with the `customer_uid` as follows: + After successfully getting the billing key and making the initial payment, + the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. + For security reasons, the server cannot directly access the billing key. + Subsequent payments can be requested by calling + the repeat pay REST API ([**POST /subscribe/payments/again**](../../api/api/api)) + with the `customer_uid` as follows: -``` -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 -``` + ```sh + 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 + ``` -**For detailed information, refer to:** + **For detailed information, refer to:** - - - + +
-### 3. Additional functions +## 3. Additional functions - -```javascript title="javascript" -card : { - detail : [ - {card_code:"*", enabled:false}, // Disable all credit cards - {card_code:'366', enabled:true} // Enable specific credit card - ] -} -``` - -**Parameters** - -- **card_code:** [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string)** -- **enabled:** Option to enable the credit card (**boolean)** - - + + ```json title="javascript" + { + "card": { + "detail": [ + { "card_code": "*", "enabled": false }, // Disable all credit cards + { "card_code": "366", "enabled": true }, // Enable specific credit card + ] + } + } + ``` + + **Parameters** + + - **card\_code:** [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string)** + - **enabled:** Option to enable the credit card (**boolean)** + diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/kg-mobilians.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/kg-mobilians.mdx index 335dfa1f1..a3c23ec0c 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/kg-mobilians.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/kg-mobilians.mdx @@ -5,161 +5,168 @@ description: KG Mobilians payment window integration guide import Codepen from "~/components/gitbook/Codepen.astro"; import Details from "~/components/gitbook/Details.astro"; -import Hint from "~/components/Hint.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; +import Hint from "~/components/Hint.astro"; -### 1. Configure KG Mobilians PG Settings +## 1. Configure KG Mobilians PG Settings Refer to the [**KG Mobilians settings**](../../ready/2-pg/payment-gateway-settings/kg) page to configure the PG settings. ![]() -### 2. Request payment +## 2. Request payment To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) -IMP.**request_pay**(param, callback). +IMP.**request\_pay**(param, callback). -In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. In mobile browsers, the page is redirected to **m_redirect_url**. +In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. +In mobile browsers, the page is redirected to **m\_redirect\_url**. - -```javascript title="Javascript SDK" -IMP.request_pay({ - pg : 'mobilians', - pay_method : 'phone', - merchant_uid : '{Merchant created Order ID}', // Example: order_no_0001 - name : 'Order name: Test payment request', - amount : 14000, - buyer_email : 'iamport@siot.do', - buyer_name : 'John Doe', - buyer_tel : '010-1234-5678', //required - buyer_addr : 'Shinsa-dong, Gangnam-gu, Seoul', - buyer_postcode : '123-456', - m_redirect_url : '{Mobile only - URL to redirect to after payment approval}' // Example: https://www.my-service.com/payments/complete/mobile -}, function(rsp) { // callback logic - //* ...Omitted... *// -}); -``` - -### - -### Key parameter description - -**`pg`** **\***\*\* ****s****tring\*\* - -**PG code** - -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`mobilians`**. + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "mobilians", + pay_method: "phone", + merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 + name: "Order name: Test payment request", + amount: 14000, + buyer_email: "iamport@siot.do", + buyer_name: "John Doe", + buyer_tel: "010-1234-5678", //required + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "123-456", + m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` -**`pay_method`** **\***\*\* ****s****tring\*\* + ### Key parameter description -**Payment method code** + **`pg`** **\*** **string** -
-

Payment method codes

+ **PG code** -- `card` (credit card) -- `trans`(instant account transfer) -- `phone`(mobile micropayment) + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`mobilians`**. -
+ **`pay_method`** **\*** **string** -**`merchant_uid`** **\***\*\* ****s****tring\*\* + **Payment method code** -**Order ID** +
+

Payment method codes

-Must be unique for each request. + - `card` (credit card) + - `trans`(instant account transfer) + - `phone`(mobile micropayment) +
-**`buyer_tel`****`*`****`string`** + **`merchant_uid`** **\*** **string** -**Customer phone number** + **Order ID** -Required + Must be unique for each request. -**`amount`** **\***\*\* ****integer\*\* + **`buyer_tel`****`*`** **`string`** -**Payment amount** + **Customer phone number** -Must be an integer (not string) + Required - + **`amount`** **\*** **integer** -
+ **Payment amount** - -To open non-authenticated payment window, specify the **customer\_uid** parameter. After getting a billing key from this window, you can request payment using the billing key. + Must be an integer (not string) -```javascript title="Javascript SDK" -IMP.request_pay( - { - pg: "mobilians", - pay_method: "phone", - merchant_uid: "{Merchant created Order ID}", // Example: issue_billingkey_monthly_0001 - name: "Initial billing key request", - amount: 0, // For display purpose only (no payment approval). - customer_uid: "{Unique ID for the card (billing key)}", // Required (Example: gildong_0001_1234) - buyer_email: "johndoe@gmail.com", - buyer_name: "John Doe", - buyer_tel: "02-1234-1234", - m_redirect_url: "{redirect URL}", // Example: https://www.my-service.com/payments/complete/mobile (for mobile only) - }, - function (rsp) { - if (rsp.success) { - alert("Success"); - } else { - alert("Failed"); - } - } -); -``` + + -#### + + To open non-authenticated payment window, specify the **customer\_uid** parameter. + After getting a billing key from this window, you can request payment using the billing key. - -- To request non-authenticated payment, you must set the **MID info issued by KG Mobilians** in the Admin console. -- KG Mobilians **does not process the payment** when issuing the billing key even if you specify an amount. -- Subsequent payments using the billing key must be for the **same amount and on the same day** as the initial payment on monthly basis. + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "mobilians", + pay_method: "phone", + merchant_uid: "{Merchant created Order ID}", // Example: issue_billingkey_monthly_0001 + name: "Initial billing key request", + amount: 0, // For display purpose only (no payment approval). + customer_uid: "{Unique ID for the card (billing key)}", // Required (Example: gildong_0001_1234) + buyer_email: "johndoe@gmail.com", + buyer_name: "John Doe", + buyer_tel: "02-1234-1234", + m_redirect_url: "{redirect URL}", // Example: https://www.my-service.com/payments/complete/mobile (for mobile only) + }, + function (rsp) { + if (rsp.success) { + alert("Success"); + } else { + alert("Failed"); + } + }, + ); + ``` - + + - To request non-authenticated payment, you must set the **MID info issued by KG Mobilians** in the Admin console. -### Key parameter description + - KG Mobilians **does not process the payment** + when issuing the billing key even if you specify an amount. -**`pg`** **\***\*\* ****s****tring\*\* + - Subsequent payments using the billing key must be for + the **same amount and on the same day** + as the initial payment on monthly basis. + -**PG code** + ### Key parameter description -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`mobilians.[MID]`**. + **`pg`** **\*** **string** -**`customer_uid`** **\***\*\* ****string\*\* + **PG code** -**Credit card billing key** + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`mobilians.[MID]`**. -Billing key to be mapped 1:1 with the user-entered credit card information. + **`customer_uid`** **\*** **string** -**`amount`** **\***\*\* ****Integer\*\* + **Credit card billing key** -**Payment amount** + Billing key to be mapped 1:1 with the user-entered credit card information. -Amount to display in the payment window, but actual payment approval is not processed. (To request payment, use the **REST API with the customer_uid**.)\ + **`amount`** **\*** **Integer** -### Request payment with billing key (customer_uid) + **Payment amount** -After successfully getting the billing key, the billing key is **stored on the i'mport server** mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the [**non-authenticated payment request REST API**](../../api/api/api) with the `customer_uid` as follows: + Amount to display in the payment window, but actual payment approval is not processed. + (To request payment, use the **REST API with the customer\_uid**.)\\ -```title="sever-side" -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 -``` + ### Request payment with billing key (customer\_uid) - + After successfully getting the billing key, the billing key is **stored on the i'mport server** mapped 1:1 with the specified `customer_uid`. + For security reasons, the server cannot directly access the billing key. + Subsequent payments can be requested by calling the + [**non-authenticated payment request REST API**](../../api/api/api) + with the `customer_uid` as follows: - -#### **Not supported.** + ```sh title="sever-side" + 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 + ``` + -
+ + #### **Not supported.** +
diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/kicc.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/kicc.mdx index d9951bfd0..6a581a3cb 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/kicc.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/kicc.mdx @@ -5,265 +5,270 @@ description: KICC payment window integration guide import Codepen from "~/components/gitbook/Codepen.astro"; import Details from "~/components/gitbook/Details.astro"; -import Hint from "~/components/Hint.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; +import Hint from "~/components/Hint.astro"; -### 1. Configure KICC PG settings +## 1. Configure KICC PG settings Refer to the [**KICC settings**](../../ready/2-pg/payment-gateway-settings/kicc) page to configure the PG settings. ![]() -### 2. Request payment +## 2. Request payment To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) -IMP.**request_pay**(param, callback). +IMP.**request\_pay**(param, callback). -In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. In mobile browsers, the page is redirected to **m_redirect_url** . +In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. +In mobile browsers, the page is redirected to **m\_redirect\_url** . - - -```javascript title="Javascript SDK" -IMP.request_pay( - { - pg: "kicc", - pay_method: "card", - merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 - name: "Order name: Test payment request", - amount: 14000, - buyer_email: "iamport@siot.do", - buyer_name: "John Doe", - buyer_tel: "010-1234-5678", - buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", - buyer_postcode: "123-456", - m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile - }, - function (rsp) { - // callback logic - //* ...Omitted... *// - } -); -``` - -### - -### Key parameter description - -**`pg`** **\*** **s** **tring** - -**PG code** - -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`kicc`**. + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "kicc", + pay_method: "card", + merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 + name: "Order name: Test payment request", + amount: 14000, + buyer_email: "iamport@siot.do", + buyer_name: "John Doe", + buyer_tel: "010-1234-5678", + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "123-456", + m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` -**`pay_method`** **\*** **s** **tring** + ### Key parameter description -**Payment method code** + **`pg`** **\*** **string** -
-

Payment method codes

+ **PG code** -- `card` (credit card) -- `trans`(instant account transfer) -- `vbank`(virtual account) -- `phone`(mobile micropayment) + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`kicc`**. -
+ **`pay_method`** **\*** **string** -**`merchant_uid`** **\*** **s** **tring** + **Payment method code** -**Order ID** +
+

Payment method codes

-Must be unique for each request. + - `card` (credit card) + - `trans`(instant account transfer) + - `vbank`(virtual account) + - `phone`(mobile micropayment) +
-**`buyer_tel`** **`*`** **`string`** + **`merchant_uid`** **\*** **string** -**Customer phone number** + **Order ID** -**`amount`** **\*** **integer** + Must be unique for each request. -**Payment amount** + **`buyer_tel`** **`*`** **`string`** -Must be an integer (not string) + **Customer phone number** -**`escrow`** **`boolean`** + **`amount`** **\*** **integer** -**Escrow option** + **Payment amount** -Only supports account transfer and virtual account payment. + Must be an integer (not string) - -
+ **`escrow`** **`boolean`** - -To open non-authenticated payment window, specify the **customer\_uid** parameter. After getting a billing key from this window, you can request payment using the billing key. + **Escrow option** -```javascript title="Javascript SDK" -IMP.request_pay( - { - pg: "kicc", - pay_method: "card", // only 'card' supported. - merchant_uid: "{Merchant created Order ID}", // Example: issue_billingkey_monthly_0001 - name: "Initial billing key request", - amount: 0, // For display purpose only (no payment approval). - customer_uid: "{Unique ID for the card (billing key)}", // Required (Example: gildong_0001_1234) - buyer_email: "johndoe@gmail.com", - buyer_name: "John Doe", - buyer_tel: "02-1234-1234", - m_redirect_url: "{redirect URL}", // Example: https://www.my-service.com/payments/complete/mobile (for mobile only) - }, - function (rsp) { - if (rsp.success) { - alert("Success"); - } else { - alert("Failed"); - } - } -); -``` + Only supports account transfer and virtual account payment. -#### + + - -- To request non-authenticated payment, you must set the **MID info issued by KICC** in the Admin console. -- KICC **does not process the payment** when issuing the billing key even if you specify an amount. + + To open non-authenticated payment window, specify the **customer\_uid** parameter. After getting a billing key from this window, you can request payment using the billing key. - + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "kicc", + pay_method: "card", // only 'card' supported. + merchant_uid: "{Merchant created Order ID}", // Example: issue_billingkey_monthly_0001 + name: "Initial billing key request", + amount: 0, // For display purpose only (no payment approval). + customer_uid: "{Unique ID for the card (billing key)}", // Required (Example: gildong_0001_1234) + buyer_email: "johndoe@gmail.com", + buyer_name: "John Doe", + buyer_tel: "02-1234-1234", + m_redirect_url: "{redirect URL}", // Example: https://www.my-service.com/payments/complete/mobile (for mobile only) + }, + function (rsp) { + if (rsp.success) { + alert("Success"); + } else { + alert("Failed"); + } + }, + ); + ``` -### Key parameter description + #### -**`pg`** **\*** \*\* ** **s** **tring\*\* + + - To request non-authenticated payment, you must set the **MID info issued by KICC** in the Admin console. + - KICC **does not process the payment** when issuing the billing key even if you specify an amount. + -**PG code** + ### Key parameter description -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`kicc.[billing MID]`**. + **`pg`** **\*** **string** -**`customer_uid`** **\*** **string** + **PG code** -**Credit card billing key** + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`kicc.[billing MID]`**. -Billing key to be mapped 1:1 with the user-entered credit card information. + **`customer_uid`** **\*** **string** -**`amount`** **\*** **Integer** + **Credit card billing key** -**Payment amount** + Billing key to be mapped 1:1 with the user-entered credit card information. -Amount to display in the payment window, but actual payment approval is not processed. (To request payment, use the **REST API with the customer_uid**.)\ + **`amount`** **\*** **Integer** -### Request payment with billing key (customer_uid) + **Payment amount** -After successfully getting the billing key, the billing key is **stored on the i'mport server** mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the [**non-authenticated payment request REST API**](../../api/api/api) with the `customer_uid` as follows: + Amount to display in the payment window, but actual payment approval is not processed. (To request payment, use the **REST API with the customer\_uid**.)\\ -```title="sever-side" -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 -``` + ### Request payment with billing key (customer\_uid) -
+ After successfully getting the billing key, the billing key is **stored on the i'mport server** + mapped 1:1 with the specified `customer_uid`. + For security reasons, the server cannot directly access the billing key. + Subsequent payments can be requested by calling + the [**non-authenticated payment request REST API**](../../api/api/api) + with the `customer_uid` as follows: - -#### **Not supported.** + ```sh title="sever-side" + 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 + ``` + - + + #### **Not supported.** +
### 3. Additional functions - -KICC supports escrow payments only for **cash payment methods** (instant account transfer or virtual bank account). - -> To enable escrow payment, first set the following parameters and then configure additional parameters below. -> -> - **escrow : true** - -### Additional parameters - -When making an escrow payment, you must enter the following required parameters: - -- `buyer_name` : Customer name -- `buyer_email` : Customer email -- `buyer_tel` : Customer phone number -- `kiccProducts` : An array of objects consisting of the following 4 required properties. The `amount` value has no relation to the payment amount (`param.amount`) value and is not used for comparison. - - `orderNumber` : Product order number - - `name` : Product name - - `quantity` : Quantity - - `amount` : Product price - -```javascript title="JavaScript SDK" -IMP.request_pay({ - ... - escrow : true, // Required for escrow payment - kiccProducts : [ - { - "orderNumber" : "xxxx", - "name" : "Product A", - "quantity" : 3, - "amount" : 1000 - }, - { - "orderNumber" : "yyyy", - "name" : "Product B", - "quantity" : 2, - "amount" : 3000 - } - ] - ... -}, function(rsp) { // callback logic - //* ...Omitted ... *// -}); -``` - - - - -```javascript title="javascript" -card: { - direct: { - code: "367", - quota: 3 + + KICC supports escrow payments only for **cash payment methods** (instant account transfer or virtual bank account). + + > To enable escrow payment, first set the following parameters and then configure additional parameters below. + > + > - **escrow : true** + + ### Additional parameters + + When making an escrow payment, you must enter the following required parameters: + + - `buyer_name` : Customer name + + - `buyer_email` : Customer email + + - `buyer_tel` : Customer phone number + + - `kiccProducts` : An array of objects consisting of the following 4 required properties. The `amount` value has no relation to the payment amount (`param.amount`) value and is not used for comparison. + - `orderNumber` : Product order number + - `name` : Product name + - `quantity` : Quantity + - `amount` : Product price + + ```ts title="JavaScript SDK" + IMP.request_pay( + { + escrow: true, // Required for escrow payment + kiccProducts: [ + { + orderNumber: "xxxx", + name: "Product A", + quantity: 3, + amount: 1000, + }, + { + orderNumber: "yyyy", + name: "Product B", + quantity: 2, + amount: 3000, + }, + ], + }, + function (rsp) { + // callback logic + //* ...Omitted ... *// + }, + ); + ``` + + + + ```json title="javascript" + { + "card": { + "direct": { + "code": "367", + "quota": 3 + } + } } -} -``` - -**Parameters** - -- **code**: [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) -- **quota**: Installment plan. For immediate, set to 0. (**integer**) - - -**Precautions** - -- Some PGs do not support direct call to credit card company's payment windows for all Merchant IDs. You must check your Merchant ID with each PG for direct call support. - - - - - - -```javascript title="javascript" -card : { - detail : [ - {card_code:"*", enabled:false}, // Disable all credit cards - {card_code:'366', enabled:true} // Enable specific credit card - ] -} -``` - -**Parameters** + ``` + + **Parameters** + + - **code**: [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) + - **quota**: Installment plan. For immediate, set to 0. (**integer**) + + + **Precautions** + + - Some PGs do not support direct call to credit card company's payment windows for all Merchant IDs. + You must check your Merchant ID with each PG for direct call support. + + + + + ```json title="javascript" + { + "card": { + "detail": [ + { "card_code": "*", "enabled": false }, // Disable all credit cards + { "card_code": "366", "enabled": true }, // Enable specific credit card + ] + } + } + ``` -- **card_code:** [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string)** -- **enabled:** Option to enable the credit card (**boolean)** + **Parameters** - + - **card\_code:** [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string)** + - **enabled:** Option to enable the credit card (**boolean)** -**Example of enabling only ****Shinhan Card**** payment -window**" /> + - + **Example of enabling only ****Shinhan Card**** payment + window** + diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/nhh-kcp.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/nhh-kcp.mdx index 89b4e1efb..226625b10 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/nhh-kcp.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/nhh-kcp.mdx @@ -6,486 +6,519 @@ description: NHN KCP payment window integration guide import Codepen from "~/components/gitbook/Codepen.astro"; import ContentRef from "~/components/gitbook/ContentRef.astro"; import Details from "~/components/gitbook/Details.astro"; -import Hint from "~/components/Hint.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; +import Hint from "~/components/Hint.astro"; -### 1. Configure NHH KCP PG settings +## 1. Configure NHH KCP PG settings -Refer to the [**NHN KCP settings**](../../ready/2-pg/payment-gateway-settings/nhn-kcp) page to configure the PG settings. +Refer to the [**NHN KCP settings**](../../ready/2-pg/payment-gateway-settings/nhn-kcp) page +to configure the PG settings. ![]() -### 2. Request payment +## 2. Request payment -To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) IMP.**request_pay**(param, callback). +To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) +IMP.**request\_pay**(param, callback). -In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. In mobile browsers, the page is redirected to **m_redirect_url**. +In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. +In mobile browsers, the page is redirected to **m\_redirect\_url**. - -```javascript title="Javascript SDK" -IMP.request_pay({ - pg : 'kcp', - pay_method : 'card', - merchant_uid : '{Merchant created Order ID}', // Example: order_no_0001 - name : 'Order name: Test payment request', - amount : 14000, - buyer_email : 'iamport@siot.do', - buyer_name : 'John Doe', - buyer_tel : '010-1234-5678', - buyer_addr : 'Shinsa-dong, Gangnam-gu, Seoul', - buyer_postcode : '123-456', - language : 'ko', // default: ko (Korean) - m_redirect_url : '{Mobile only - URL to redirect to after payment approval}' // Example: https://www.my-service.com/payments/complete/mobile -}, function(rsp) { // callback logic - //* ...Omitted... *// -}); -``` - -#### - -### Key parameter description - -**`pg`** **\***\*\* ****s****tring\*\* - -**PG code** - -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to `kcp`. - -**`pay_method`** **\***\*\* ****s****tring\*\* - -**Payment method code** - -
-

Payment method codes

- -- `card` (credit card) -- `trans`(instant account transfer) -- `vbank`(virtual account) -- `phone`(mobile micropayment) -- `samsung`(Samsung Pay) -- `kakaopay`(Kakao Pay) -- `payco` ( PAYCO hub-type) -- `lpay` (LPAY hub-type) -- `naverpay` (Naver Pay) -- `cultureland`(Cultureland) -- `smartculture`(Smart Culture) -- `happymoney`(Happy Money) -- `booknlife`(Book culture gift certificate) -- `point`(Benepia) - -
- -**`merchant_uid`** **\***\*\* ****s****tring\*\* - -**Order ID** - -Must be unique for each request. - -**`amount`** **\***\*\* ****integer\*\* - -**Payment amount** - -Must be an integer (not string). - - -**For Payco hub-type**, you must apply through KCP Admin page and configure the settings. - -How to apply: [https://sir.kr/main/service/p_payco_hub.php](https://sir.kr/main/service/p_payco_hub.php) - - - - -
- - -To open non-authenticated payment window, specify the **customer\_uid** parameter. After getting a billing key from this window, you can request payment using the billing key. - -```javascript title="Javascript SDK" -IMP.request_pay( - { - pg: "kcp_billing", - pay_method: "card", // only 'card' supported. - merchant_uid: "{Merchant created Order ID}", // Example: issue_billingkey_monthly_0001 - name: "Initial billing key request", - amount: 0, // For display purpose only (no payment approval). - customer_uid: "{Unique ID for the card (billing key)}", // Required (Example: gildong_0001_1234) - buyer_email: "johndoe@gmail.com", - buyer_name: "John Doe", - buyer_tel: "02-1234-1234", - m_redirect_url: "{redirect URL}", // Example: https://www.my-service.com/payments/complete/mobile (for mobile only) - }, - function (rsp) { - if (rsp.success) { - alert("Success"); - } else { - alert("Failed"); - } - } -); -``` - - -* To request non-authenticated payment, you must set the **site code issued by KCP** in the Admin console. -* KCP **does not process the payment** when issuing the billing key even if you specify an amount. - - + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "kcp", + pay_method: "card", + merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 + name: "Order name: Test payment request", + amount: 14000, + buyer_email: "iamport@siot.do", + buyer_name: "John Doe", + buyer_tel: "010-1234-5678", + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "123-456", + language: "ko", // default: ko (Korean) + m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` + + ### Key parameter description + + **`pg`** **\*** **string** + + **PG code** + + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to `kcp`. + + **`pay_method`** **\*** **string** + + **Payment method code** + +
+

Payment method codes

+ + - `card` (credit card) + - `trans`(instant account transfer) + - `vbank`(virtual account) + - `phone`(mobile micropayment) + - `samsung`(Samsung Pay) + - `kakaopay`(Kakao Pay) + - `payco` ( PAYCO hub-type) + - `lpay` (LPAY hub-type) + - `naverpay` (Naver Pay) + - `cultureland`(Cultureland) + - `smartculture`(Smart Culture) + - `happymoney`(Happy Money) + - `booknlife`(Book culture gift certificate) + - `point`(Benepia) +
+ + **`merchant_uid`** **\*** **string** + + **Order ID** + + Must be unique for each request. + + **`amount`** **\*** **integer** + + **Payment amount** + + Must be an integer (not string). + + + **For Payco hub-type**, you must apply through KCP Admin page and configure the settings. + + How to apply: [https://sir.kr/main/service/p\_payco\_hub.php](https://sir.kr/main/service/p_payco_hub.php) + + + +
+ + + To open non-authenticated payment window, specify the **customer\_uid** parameter. + After getting a billing key from this window, you can request payment using the billing key. -### Key parameter description + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "kcp_billing", + pay_method: "card", // only 'card' supported. + merchant_uid: "{Merchant created Order ID}", // Example: issue_billingkey_monthly_0001 + name: "Initial billing key request", + amount: 0, // For display purpose only (no payment approval). + customer_uid: "{Unique ID for the card (billing key)}", // Required (Example: gildong_0001_1234) + buyer_email: "johndoe@gmail.com", + buyer_name: "John Doe", + buyer_tel: "02-1234-1234", + m_redirect_url: "{redirect URL}", // Example: https://www.my-service.com/payments/complete/mobile (for mobile only) + }, + function (rsp) { + if (rsp.success) { + alert("Success"); + } else { + alert("Failed"); + } + }, + ); + ``` -**`pg`** **\***\*\* ****s****tring\*\* + + - To request non-authenticated payment, you must set the **site code issued by KCP** in the Admin console. -**PG code** + - KCP **does not process the payment** + when issuing the billing key even if you specify an amount. + -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to `kcp_billing`. + ### Key parameter description -**`customer_uid`** **\***\*\* ****string\*\* + **`pg`** **\*** **string** -**Credit card billing key** + **PG code** -Billing key to be mapped 1:1 with the user-entered credit card information. + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to `kcp_billing`. -**`amount`** **\***\*\* ****Integer\*\* + **`customer_uid`** **\*** **string** -**Payment amount** + **Credit card billing key** -Amount to display in the payment window, but actual payment approval is not processed. (To request payment, use the **REST API with the customer_uid**.)\ + Billing key to be mapped 1:1 with the user-entered credit card information. -### Request payment with billing key (customer_uid) + **`amount`** **\*** **Integer** -After successfully getting the billing key, the billing key is **stored on the i'mport server** mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the [**non-authenticated payment request REST API**](../../api/api/api) with the `customer_uid` as follows: + **Payment amount** -```title="sever-side" -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 -``` + Amount to display in the payment window, but actual payment approval is not processed. + (To request payment, use the **REST API with the customer\_uid**.)\\ - + ### Request payment with billing key (customer\_uid) - -#### **You can use i'mport REST API to request billing key, request payment, and schedule payment.** + After successfully getting the billing key, the billing key is **stored on the i'mport server** + mapped 1:1 with the specified `customer_uid`. + For security reasons, the server cannot directly access the billing key. + Subsequent payments can be requested by calling + the [**non-authenticated payment request REST API**](../../api/api/api) + with the `customer_uid` as follows: -### Request one-time payment + ```sh title="sever-side" + 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 + ``` + -To request a one-time payment, use the key-in REST[ **API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). The card information is not saved during this process. + + **You can use i'mport REST API to request billing key, request payment, and schedule payment.** -``` -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 -``` + ### Request one-time payment -### + To request a one-time payment, use the key-in [**REST API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). + The card information is not saved during this process. -### Request billing key + ```sh + 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 + ``` -To request a billing key, use the billing key request REST [**API POST /subscribe/customers/\{customer_uid}**](../../api/billing-key-api/api-1). + ### Request billing key -``` -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 -``` + To request a billing key, use the billing key request REST [**API POST /subscribe/customers/\{customer\_uid}**](../../api/billing-key-api/api-1). -### Request billing key + initial payment + ```sh + 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 + ``` -To request a billing key and initial payment, use the key-in REST [**API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). + ### Request billing key + initial payment -- **`customer_uid`** : required for saving the billing key. + To request a billing key and initial payment, use the key-in REST [**API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). -``` -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 -``` + - **`customer_uid`** : required for saving the billing key. -### Request payment with billing key + ```sh + 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 + ``` -After successfully getting the billing key and making the initial payment, the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the repeat pay REST API ([**POST /subscribe/payments/again**](../../api/api/api)) with the `customer_uid` as follows: + ### Request payment with billing key -``` -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 -``` + After successfully getting the billing key and making the initial payment, + the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. + For security reasons, the server cannot directly access the billing key. + Subsequent payments can be requested by calling + the repeat pay REST API ([**POST /subscribe/payments/again**](../../api/api/api)) + with the `customer_uid` as follows: -**For detailed information, refer to:** + ```sh + 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 + ``` - + **For detailed information, refer to:** - + +
-### 3. Additional functions +## 3. Additional functions - -```javascript title="javascript" -display: { - card_quota: [6] // Display up to 6 months installment plans -} -``` - -**Parameters** - -- **card_quota :** - - `[]`: Only immediate pay - - `2,3,4,5,6`: immediate, 2, 3, 4, 5, 6 month installment plans\ - - -Installment plan option is available only for **KRW 50,000 or more**. - - - - -Example of allowing up to **3 months**** -installment plans**" /> - - - - -```javascript title="javascript" -card: { - direct: { - code: "367", - quota: 3 - // When want to use points of credit card - // quota: 80 = 80(Hyundai Card Point installment) + 0(pay all at once) - // quota: 93 = 80(Hyundai Card Point installment) + 13(number of installments) - // quota: 60 = 60(Other Card Point installment) + 0(pay all at once) - // quota: 63 = 60(Other Card Point installment) + 3(number of installments) + + ```json title="javascript" + { + "display": { + "card_quota": [6] // Display up to 6 months installment plans + } } -} -``` - -**Parameters** - -- **code**: [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) -- **quota**: Installment plan. For immediate, set to 0. If you want to use points of credit card, you need to add the point installment per credit card[1] to number of installments (**integer**) -
- [1] point installment per credit card - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Point of Credit Card

-
-

Point Installment

-
-

Hyundai M

-
-

+80

-
-

Kookmin

-
-

+60

-
-

BC

-
-

+60

-
-

Samsung

-
-

+60

-
-

Hana/KEB

-
-

+60

-
-

Lotte

-
-

+60

-
-

Shinhan

-
-

+60

-
-

NongHyup

-
-

+60

-
-

Citi

-
-

+60

-
-

Woori

-
-

+60

-
-
- - -**Precautions** - -- Currently, direct call to the credit card company's payment window is only supported by 6 PGs: **KG Inicis, KCP, Toss Payments, Nice Payments, KICC, and Danal**. -- Some PGs do not support direct call to credit card company's payment windows for all Merchant IDs. You must check your Merchant ID with each PG for direct call support. - - - - - -
- - -```javascript title="javascript" -card : { - detail : [ - {card_code:"*", enabled:false}, // Disable all credit cards - {card_code:'366', enabled:true} // Enable specific credit card - ] -} -``` - -**Parameters** - -- **card_code:** [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string)** -- **enabled:** Option to enable the credit card (**boolean)** - - - - - - -Set the following parameter to only expose app cards for authenticated payments. - -```javascript title="request_pay()" -... -appCard : true . // Set to true to only expose app cards. -... -``` - - -
+ ``` -### 4. Additional parameters + **Parameters** - - -To use the **gift certificate payment method**, set the merchant assigned user ID as follows: - -```javascript title="javascript SDK " -bypass : { - shop_user_id : ‘ABCD123’ // Merchant user ID (20 bytes) -} -``` - - -**This parameter is required for gift certificate providers' RM action.** - - - -**Example of paying with Cultureland gift certificate** - -```javascript -MP.request_pay({ - pg : 'kcp.{Site code for gift certificate use}', - pay_method : 'cultureland', //Gift certificate - merchant_uid: "A00021-TEST", - name : 'Carrots 10kg', - amount : 1004, - buyer_email : 'iamport@chai.finance', - buyer_name : 'iamport tech support', - buyer_tel : '010-1234-5678', - buyer_addr : 'Shinsa-dong, Gangnam-gu, Seoul', - buyer_postcode : '123-456', - bypass : { - shop_user_id : 'abaddd' // Merchant user ID - } -} -``` + - **card\_quota :** + - `[]`: Only immediate pay + - `2,3,4,5,6`: immediate, 2, 3, 4, 5, 6 month installment plans\\ - + + Installment plan option is available only for **KRW 50,000 or more**. + - -For escrow payment, set the **`escrow`** parameter to **true**. To bundle products in the shopping cart when making an escrow payment request, pass the item-related information as an additional parameter (**`kcpProducts`**). + -**`kcpProducts`** is an object array consisting of the following four required properties: + Example of allowing up to **3 months** + **installment plans** + -**`amount`** is not related or compared with the payment amount (`param.amount`). + + ```json title="javascript" + { + "card": { + "direct": { + "code": "367", + "quota": 3 + // When want to use points of credit card + // quota: 80 = 80(Hyundai Card Point installment) + 0(pay all at once) + // quota: 93 = 80(Hyundai Card Point installment) + 13(number of installments) + // quota: 60 = 60(Other Card Point installment) + 0(pay all at once) + // quota: 63 = 60(Other Card Point installment) + 3(number of installments) + } + } + } + ``` + + **Parameters** + + - **code**: [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) + + - **quota**: Installment plan. For immediate, set to 0. If you want to use points of credit card, you need to add the point installment per credit card\[1] to number of installments (**integer**) + +
+ \[1] point installment per credit card + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Point of Credit Card

+
+

Point Installment

+
+

Hyundai M

+
+

+80

+
+

Kookmin

+
+

+60

+
+

BC

+
+

+60

+
+

Samsung

+
+

+60

+
+

Hana/KEB

+
+

+60

+
+

Lotte

+
+

+60

+
+

Shinhan

+
+

+60

+
+

NongHyup

+
+

+60

+
+

Citi

+
+

+60

+
+

Woori

+
+

+60

+
+
+ + + **Precautions** + + - Currently, direct call to the credit card company's payment window is only supported by 6 PGs: + **KG Inicis, KCP, Toss Payments, Nice Payments, KICC, and Danal**. + + - Some PGs do not support direct call to credit card company's payment windows for all Merchant IDs. + You must check your Merchant ID with each PG for direct call support. + + + +
+ + + ```json title="javascript" + { + "card": { + "detail": [ + { "card_code": "*", "enabled": false }, // Disable all credit cards + { "card_code": "366", "enabled": true }, // Enable specific credit card + ] + } + } + ``` + + **Parameters** -- orderNumber : Order ID -- name : Product name -- quantity : Product quantity -- amount : Product price + - **card\_code:** [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string)** + - **enabled:** Option to enable the credit card (**boolean)** -```javascript title="JavaScript SDK" -IMP.request_pay({ - pg: "kcp", - escrow: true, // For escrow payment - kcpProducts: [ + + + + + Set the following parameter to only expose app cards for authenticated payments. + + ```json title="request_pay()" { - orderNumber: "xxxx", - name: "Product A", - quantity: 3, - amount: 1000, - }, + "appCard": true // Set to true to only expose app cards. + } + ``` + +
+ +## 4. Additional parameters + + + + To use the **gift certificate payment method**, set the merchant assigned user ID as follows: + + ```json title="javascript SDK" { - orderNumber: "yyyy", - name: "Product B", - quantity: 2, - amount: 3000, - }, - ], - //* ...Omitted... *// -}); -``` - - + "bypass": { + "shop_user_id": "ABCD123" // Merchant user ID (20 bytes) + } + } + ``` + + + **This parameter is required for gift certificate providers' RM action.** + + + **Example of paying with Cultureland gift certificate** + + ```ts + IMP.request_pay({ + pg: "kcp.{Site code for gift certificate use}", + pay_method: "cultureland", //Gift certificate + merchant_uid: "A00021-TEST", + name: "Carrots 10kg", + amount: 1004, + buyer_email: "iamport@chai.finance", + buyer_name: "iamport tech support", + buyer_tel: "010-1234-5678", + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "123-456", + bypass: { + shop_user_id: "abaddd", // Merchant user ID + }, + }); + ``` + + + + For escrow payment, set the **`escrow`** parameter to **true**. + To bundle products in the shopping cart when making an escrow payment request, + pass the item-related information as an additional parameter (**`kcpProducts`**). + + **`kcpProducts`** is an object array consisting of the following four required properties: + + **`amount`** is not related or compared with the payment amount (`param.amount`). + + - orderNumber : Order ID + - name : Product name + - quantity : Product quantity + - amount : Product price + + ```ts title="JavaScript SDK" + IMP.request_pay({ + pg: "kcp", + escrow: true, // For escrow payment + kcpProducts: [ + { + orderNumber: "xxxx", + name: "Product A", + quantity: 3, + amount: 1000, + }, + { + orderNumber: "yyyy", + name: "Product B", + quantity: 2, + amount: 3000, + }, + ], + //* ...Omitted... *// + }); + ``` + diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/nice.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/nice.mdx index 4f8f536e2..ffdd892f7 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/nice.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/nice.mdx @@ -5,243 +5,228 @@ description: NICE Payments payment window integration guideNICE import Codepen from "~/components/gitbook/Codepen.astro"; import Details from "~/components/gitbook/Details.astro"; -import Hint from "~/components/Hint.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; +import Hint from "~/components/Hint.astro"; -### 1. Configure NICE Payments PG settings +## 1. Configure NICE Payments PG settings -Refer to the [**NICE Payments settings**](../../ready/2-pg/payment-gateway-settings/nice-payments) page to configure the PG settings. +Refer to the [**NICE Payments settings**](../../ready/2-pg/payment-gateway-settings/nice-payments) +page to configure the PG settings. ![]() -### 2. Request payment +## 2. Request payment -To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) IMP.**request_pay**(param, callback). +To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) +IMP.**request\_pay**(param, callback). -In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. In mobile browsers, the page is redirected to **m_redirect_url** . +In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. +In mobile browsers, the page is redirected to **m\_redirect\_url** . - - -```javascript title="Javascript SDK" -IMP.request_pay( - { - pg: "nice", - pay_method: "card", - merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 - name: "Order name: Test payment request", - amount: 14000, - buyer_email: "iamport@siot.do", - buyer_name: "John Doe", - buyer_tel: "010-1234-5678", - buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", - buyer_postcode: "123-456", - m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile - niceMobileV2: true, // Set to 'true' to enable new mobile version - }, - function (rsp) { - // callback logic - //* ...Omitted... *// - } -); -``` - -#### - -### Key parameter description + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "nice", + pay_method: "card", + merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 + name: "Order name: Test payment request", + amount: 14000, + buyer_email: "iamport@siot.do", + buyer_name: "John Doe", + buyer_tel: "010-1234-5678", + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "123-456", + m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile + niceMobileV2: true, // Set to 'true' to enable new mobile version + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` -**`pg`** **\*** **s** **tring** + ### Key parameter description -**PG code** + **`pg`** **\*** **string** -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`nice`**. + **PG code** -**`pay_method`** **\*** **s** **tring** + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`nice`**. -**Payment method code** + **`pay_method`** **\*** **string** -
-

Payment method codes

+ **Payment method code** -- `card` (credit card) -- `trans`(instant account transfer) -- `vbank`(virtual account) -- `samsung`(Samsung Pay) -- `phone`(mobile micropayment) -- `kakaopay`(Kakao Pay) -- `payco` ( PAYCO hub-type) -- `naverpay` (Naver Pay) +
+

Payment method codes

-
+ - `card` (credit card) + - `trans`(instant account transfer) + - `vbank`(virtual account) + - `samsung`(Samsung Pay) + - `phone`(mobile micropayment) + - `kakaopay`(Kakao Pay) + - `payco` ( PAYCO hub-type) + - `naverpay` (Naver Pay) +
-**`merchant_uid`** **\*** **s** **tring** + **`merchant_uid`** **\*** **string** -**Order ID** + **Order ID** -Must be unique for each request. + Must be unique for each request. -**`amount`** **\*** **integer** + **`amount`** **\*** **integer** -**Payment amount** + **Payment amount** -Must be an integer (not string). + Must be an integer (not string). -**`niceMobileV2`** **`boolean`** + **`niceMobileV2`** **`boolean`** -Option to enable new NICE mobile version (default: false) + Option to enable new NICE mobile version (default: false) -**`escrow`** **`boolean`** + **`escrow`** **`boolean`** -**Ecrow option** + **Ecrow option** - + +
-
+ + **You can use i'mport REST API to request billing key, request payment, and schedule payment.** - -#### **You can use i'mport REST API to request billing key, request payment, and schedule payment.** + ### Request one-time payment -### Request one-time payment + To request a one-time payment, use the key-in [**REST API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). + The card information is not saved during this process. -To request a one-time payment, use the key-in REST[ **API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). The card information is not saved during this process. + ```sh + 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 + ``` -``` -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 -``` + ### Request billing key -### + To request a billing key, use the billing key request REST [**API POST /subscribe/customers/\{customer\_uid}**](../../api/billing-key-api/api-1). -### Request billing key + ```sh + 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 + ``` -To request a billing key, use the billing key request REST [**API POST /subscribe/customers/\{customer_uid}**](../../api/billing-key-api/api-1). + ### Request billing key + initial payment -``` -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 -``` + To request a billing key and initial payment, use the key-in REST [**API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). -### Request billing key + initial payment + - **`customer_uid`** : required for saving the billing key. -To request a billing key and initial payment, use the key-in REST [**API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). + ```sh + 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 + ``` -- **`customer_uid`** : required for saving the billing key. + ### Request payment with billing key -``` -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 -``` + After successfully getting the billing key and making the initial payment, + the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. + For security reasons, the server cannot directly access the billing key. + Subsequent payments can be requested by calling + the repeat pay REST API ([**POST /subscribe/payments/again**](../../api/api/api)) + with the `customer_uid` as follows: -### Request payment with billing key + ```sh + 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 + ``` -After successfully getting the billing key and making the initial payment, the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the repeat pay REST API ([**POST /subscribe/payments/again**](../../api/api/api)) with the `customer_uid` as follows: + + **NICE Payments supports non-authenticated payments only through the API method.** -``` -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 -``` - - -**NICE Payments supports non-authenticated payments only through the API method.** - -To integrate non-authenticated payments, you need to provide a UI for accepting user's card information. For more information, refer to the [**REST API**](../../auth/guide-1/bill/rest-api) page. - - - - + To integrate non-authenticated payments, you need to provide a UI for accepting user's card information. + For more information, refer to the [**REST API**](../../auth/guide-1/bill/rest-api) page. + +
-### 3. Additional functions +## 3. Additional functions - - -```javascript title="javascript" -display: { - card_quota: [6]; // Display up to 6 months installment plans -} -``` - -**Parameters** - -- **card_quota :** - - `[]`: Only immediate pay - - `2,3,4,5,6`: immediate, 2, 3, 4, 5, 6 month installment plans - - -Installment plan option is available only for **KRW 50,000 or more**. - - - - - - - - - -```javascript title="javascript" -card: { - direct: { - code: "367", - quota: 3 + + ```json title="javascript" + { + "display": { + "card_quota": [6] // Display up to 6 months installment plans + } } -} -``` - -**Parameters** - -- **code**: [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) -- **quota**: Installment plan. For immediate, set to 0. (**integer**) - - -**Precautions** + ``` + + **Parameters** + + - **card\_quota :** + - `[]`: Only immediate pay + - `2,3,4,5,6`: immediate, 2, 3, 4, 5, 6 month installment plans + + + Installment plan option is available only for **KRW 50,000 or more**. + + + + + + + ```json title="javascript" + { + "card": { + "direct": { + "code": "367", + "quota": 3 + } + } + } + ``` -- Some PGs do not support direct call to credit card company's payment windows for all Merchant IDs. You must check your Merchant ID with each PG for direct call support. + **Parameters** - + - **code**: [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) + - **quota**: Installment plan. For immediate, set to 0. (**integer**) - + + **Precautions** - + - Some PGs do not support direct call to credit card company's payment windows for all Merchant IDs. + You must check your Merchant ID with each PG for direct call support. + - -```javascript title="javascript" -card : { - detail : [ - {card_code:"*", enabled:false}, // Disable all credit cards - {card_code:'366', enabled:true} // Enable specific credit card - ] -} -``` + + -**Parameters** + + ```json title="javascript" + { + "card": { + "detail": [ + { "card_code": "*", "enabled": false }, // Disable all credit cards + { "card_code": "366", "enabled": true }, // Enable specific credit card + ] + } + } + ``` -- **card_code:** [ **Credit card code** ](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) -- **enabled:** Option to enable the credit card (**boolean**) + **Parameters** - + - **card\_code:** [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) + - **enabled:** Option to enable the credit card (**boolean**) - + + diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/paymentwall.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/paymentwall.mdx index 251e7c53b..76e8caa18 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/paymentwall.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/paymentwall.mdx @@ -3,106 +3,107 @@ title: Paymentwall description: Paymentwall payment window integration guide --- -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; -### 1. Configure Paymentwall PG settings +## 1. Configure Paymentwall PG settings Refer to the [**Paymentwall settings**](../../ready/2-pg/payment-gateway-settings/undefined-1) page to configure the PG settings. ![](/gitbook-assets/en/Paymentwall_logo_dark_latest.jpeg) -### 2. Request payment +## 2. Request payment To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) -IMP.**request_pay**(param, callback). +IMP.**request\_pay**(param, callback). -In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. In mobile browsers, the page is redirected to **m_redirect_url**. +In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. +In mobile browsers, the page is redirected to **m\_redirect\_url**. - -```javascript title="Javascript SDK" -IMP.request_pay({ - pg : 'paymentwall', - pay_method : 'card', // In Paymentwall, the payment method is activated based on the country IP. (Can be omitted) - merchant_uid : '{Merchant created Order ID}', // Example: order_no_0001 - name : 'Order name: Test payment request', - amount : 14000, - currency : 'KRW' // required - buyer_email : 'iamport@siot.do', // required - buyer_name : 'Jack Son', // Must include a space between Firstname Lastname - buyer_tel : '010-1234-5678', - buyer_addr : 'Shinsa-dong, Gangnam-gu, Seoul', - buyer_postcode : '123-456', - m_redirect_url : '{Mobile only - URL to redirect to after payment approval}', // Example: https://www.my-service.com/payments/complete/mobile - bypass: { - // Set this for Terminal 3 only, Defualt: general payment window opens - widget_code: "t3_1", - // Set to enable specific payment method, set to 'all'(default) to enable all methods supported by your country - ps : "all", - country_code:"DE" // Set this to enable all payment methods supported by the country - }, -}, function(rsp) { // callback logic - //* ...Omitted... *// -}); -``` - -### - -### Key parameter description - -**`pg`** **\***\*\* ****s****tring\*\* + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "paymentwall", + pay_method: "card", // In Paymentwall, the payment method is activated based on the country IP. (Can be omitted) + merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 + name: "Order name: Test payment request", + amount: 14000, + currency: "KRW", // required + buyer_email: "iamport@siot.do", // required + buyer_name: "Jack Son", // Must include a space between Firstname Lastname + buyer_tel: "010-1234-5678", + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "123-456", + m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile + bypass: { + // Set this for Terminal 3 only, Defualt: general payment window opens + widget_code: "t3_1", + // Set to enable specific payment method, set to 'all'(default) to enable all methods supported by your country + ps: "all", + country_code: "DE", // Set this to enable all payment methods supported by the country + }, + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` -**PG code** + ### Key parameter description -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`paymentwall`**. + **`pg`** **\*** **string** -**`pay_method`** **s****tring** + **PG code** -**Payment method code (Can be omitted)** + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`paymentwall`**. -You can manage your payment methods by enabling Project from the [Paymentwall website](https://api.paymentwall.com/). + **`pay_method`** **string** -(Payment methods are enabled based on your country IP by default) + **Payment method code (Can be omitted)** -**`merchant_uid`** **\***\*\* ****s****tring\*\* + You can manage your payment methods by enabling Project from the [Paymentwall website](https://api.paymentwall.com/). -**Order ID** + (Payment methods are enabled based on your country IP by default) -Must be unique for each request. + **`merchant_uid`** **\*** **string** -**`amount`** **\***\*\* ****integer\*\* + **Order ID** -**Payment amount** + Must be unique for each request. -Must be an integer (not string) + **`amount`** **\*** **integer** -**`buyer_name`****`*`****`string`** + **Payment amount** -**`Customer name`** + Must be an integer (not string) -**`buyer_email`****`*`****`string`** + **`buyer_name`****`*`****`string`** -**`Customer email address`** + **`Customer name`** -**`currency`****`*`****`string`** + **`buyer_email`****`*`****`string`** -**`Currency`** + **`Customer email address`** -**`bypass`** + **`currency`****`*`****`string`** -**`Paymentwall specific parameter`** + **`Currency`** -- **`widget_code` :** Set this to **t3_1** for Terminal 3 only, Defualt: general payment window -- **`ps` :** Set to enable specific payment method. For available codes, refer to [**Payment system short codes**](https://docs.paymentwall.com/reference/payment-system-shortcodes). Example: `kakaopaykr` = Kakao Pay -- **country_code** : Payment methods are shown based on this code. ([**Country codes**](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) + **`bypass`** - + **`Paymentwall specific parameter`** - -**Preparing for service** + - **`widget_code` :** Set this to **t3\_1** for Terminal 3 only, Defualt: general payment window + - **`ps` :** Set to enable specific payment method. For available codes, refer to [**Payment system short codes**](https://docs.paymentwall.com/reference/payment-system-shortcodes). Example: `kakaopaykr` = Kakao Pay + - **country\_code** : Payment methods are shown based on this code. ([**Country codes**](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) + - + + **Preparing for service** + diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/paypal.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/paypal.mdx index 2fa4f8fb0..6641bcc1e 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/paypal.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/paypal.mdx @@ -4,97 +4,96 @@ description: PayPal payment window integration guide --- import Details from "~/components/gitbook/Details.astro"; -import Hint from "~/components/Hint.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; +import Hint from "~/components/Hint.astro"; -### 1. Configure PayPal PG settings +## 1. Configure PayPal PG settings Refer to the [**PayPal settings**](../../ready/2-pg/payment-gateway-settings/undefined-5) page to configure the PG settings. ![]() -### 2. Request payment +## 2. Request payment To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) -IMP.**request_pay**(param, callback). +IMP.**request\_pay**(param, callback). -In PC and mobile browsers, the page is redirected to **m_redirect_url**. +In PC and mobile browsers, the page is redirected to **m\_redirect\_url**. - -```javascript title="Javascript SDK" -IMP.request_pay({ - pg : 'paypal', - pay_method : 'card', - merchant_uid : '{Merchant created Order ID}', // Example: order_no_0001 - name : 'Order name: Test payment request', - amount : 14.20, - currency : 'USD' // default: USD (KRW not supported) - buyer_email : 'iamport@siot.do', - buyer_name : 'John Doe', - buyer_tel : '010-1234-5678', // Required - buyer_addr : 'Shinsa-dong, Gangnam-gu, Seoul', - buyer_postcode : '123-456' - m_redirect_url : '{URL to redirect to after payment approval}' // Example: https://www.my-service.com/payments/complete/mobile -}, function(rsp) { // callback logic - //* ...Omitted... *// -}); -``` + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "paypal", + pay_method: "card", + merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 + name: "Order name: Test payment request", + amount: 14.2, + currency: "USD", // default: USD (KRW not supported) + buyer_email: "iamport@siot.do", + buyer_name: "John Doe", + buyer_tel: "010-1234-5678", // Required + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "123-456", + m_redirect_url: "{URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` -#### + ### Key parameter description -### Key parameter description + **`pg`** **\*** **string** -**`pg`** **\***\*\* ****s****tring\*\* + **PG code** -**PG code** + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`paypal`**. -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`paypal`**. + **`pay_method`** **\*** **string** -**`pay_method`** **\***\*\* ****s****tring\*\* + **Payment method code** -**Payment method code** +
+

Payment method codes

-
-

Payment method codes

+ - `card` (credit card) +
-- `card` (credit card) + **`merchant_uid`** **\*** **string** -
+ **Order ID** -**`merchant_uid`** **\***\*\* ****s****tring\*\* + Must be unique for each request. -**Order ID** + **`amount`** **\*** **integer** -Must be unique for each request. + **Payment amount** -**`amount`** **\***\*\* ****integer\*\* + Must be an integer (not string)\ + \ + **`currency`****`*`****`string`** -**Payment amount** + **Currency** -Must be an integer (not string)\ -\ -**`currency`****`*`****`string`** + For supported currencies, refer to [PayPal currency codes](https://developer.paypal.com/docs/api/reference/currency-codes/#paypal-account-payments). -**Currency** + **`m_redirect_url`****`*`****`string`** -For supported currencies, refer to [PayPal currency codes](https://developer.paypal.com/docs/api/reference/currency-codes/#paypal-account-payments). + **Redirect URL** -**`m_redirect_url`****`*`****`string`** - -**Redirect URL** - -Required in both PC and mobile to receive payment result. - -
+ Required in both PC and mobile to receive payment result. +
-### Note - -i'mport does not support PayPal subscription payment. + ### Note + i'mport does not support PayPal subscription payment. diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/readme.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/readme.mdx index 36434112e..53b797357 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/readme.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/readme.mdx @@ -3,4 +3,4 @@ title: Payment gateways description: Learn how to integrate with each PG. --- -### Learn how to integrate authenticated and non-authenticated payments by PG. +Learn how to integrate authenticated and non-authenticated payments by PG. diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/settlebank.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/settlebank.mdx index e7ed62858..c590c248d 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/settlebank.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/settlebank.mdx @@ -6,148 +6,150 @@ description: Settlebank payment window integration guide import Codepen from "~/components/gitbook/Codepen.astro"; import ContentRef from "~/components/gitbook/ContentRef.astro"; import Details from "~/components/gitbook/Details.astro"; -import Hint from "~/components/Hint.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; +import Hint from "~/components/Hint.astro"; -### 1. Configure **Settlebank** PG settings +## 1. Configure **Settlebank** PG settings -Refer to the [**Settlebank settings**](../../ready/2-pg/payment-gateway-settings/undefined-3) page to configure the PG settings. +Refer to the [**Settlebank settings**](../../ready/2-pg/payment-gateway-settings/undefined-3) page +to configure the PG settings. ![]() -### 2. Request payment +## 2. Request payment -To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) IMP.**request_pay**(param, callback). +To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) +IMP.**request\_pay**(param, callback). -In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. In mobile browsers, the page is redirected to **m_redirect_url**. +In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. +In mobile browsers, the page is redirected to **m\_redirect\_url**. - -```javascript title="Javascript SDK" -IMP.request_pay({ - pg : 'settle', - pay_method : 'card', - merchant_uid : '{Merchant created Order ID}', // Example: order_no_0001 - name : 'Order name: Test payment request', - amount : 14000, - buyer_email : 'iamport@siot.do', - buyer_name : 'John Doe', - buyer_tel : '010-1234-5678', // Required - buyer_addr : 'Shinsa-dong, Gangnam-gu, Seoul', - company : 'iamport', // Recommended for virtual account payment - buyer_postcode : '123-456', - m_redirect_url : '{Mobile only - URL to redirect to after payment approval}' // Example: https://www.my-service.com/payments/complete/mobile -}, function(rsp) { // callback logic - //* ...Omitted... *// -}); -``` - -#### - -### Key parameter description - -**`pg`** **\***\*\* ****s****tring\*\* - -**PG code** - -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`settle`**. - -**`pay_method`** **\***\*\* ****s****tring\*\* + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "settle", + pay_method: "card", + merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 + name: "Order name: Test payment request", + amount: 14000, + buyer_email: "iamport@siot.do", + buyer_name: "John Doe", + buyer_tel: "010-1234-5678", // Required + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + company: "iamport", // Recommended for virtual account payment + buyer_postcode: "123-456", + m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` -**Payment method code** + ### Key parameter description -
-

Payment method codes

+ **`pg`** **\*** **string** -- `card` (credit card) -- `trans`(instant account transfer) -- `vbank`(virtual account) -- `phone`(mobile micropayment) + **PG code** -
+ - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`settle`**. -**`merchant_uid`** **\***\*\* ****s****tring\*\* + **`pay_method`** **\*** **string** -**Order ID** + **Payment method code** -Must be unique for each request. +
+

Payment method codes

-**`amount`** **\***\*\* ****integer\*\* + - `card` (credit card) + - `trans`(instant account transfer) + - `vbank`(virtual account) + - `phone`(mobile micropayment) +
-**Payment amount** + **`merchant_uid`** **\*** **string** -Must be an integer (not string) + **Order ID** -**`buyer_tel`****`*`****`string`** + Must be unique for each request. -**Customer phone number** + **`amount`** **\*** **integer** -Required + **Payment amount** -**` company`` `****`string`** + Must be an integer (not string) -**`Company name`** + **`buyer_tel`****`*`****`string`** -Required for virtual account payment + **Customer phone number** - + Required -
+ **`company`` `****`string`** - -#### Not supported + **`Company name`** - + Required for virtual account payment - -#### **You can use i'mport REST API to request payment and schedule payment.** + + -### Request one-time payment + + #### Not supported + -To request a one-time payment, use the key-in REST[ **API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). The card information is not saved during this process. + + #### **You can use i'mport REST API to request payment and schedule payment.** -``` -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 -``` + ### Request one-time payment -### Request billing key + initial payment + To request a one-time payment, use the key-in [**REST API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). + The card information is not saved during this process. -To request a billing key and initial payment, use the key-in REST [**API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). + ```sh + 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 + ``` -- **`customer_uid`** : required for saving the billing key. + ### Request billing key + initial payment -``` -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 -``` + To request a billing key and initial payment, use the key-in REST [**API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). -### Request payment with billing key + - **`customer_uid`** : required for saving the billing key. -After successfully getting the billing key and making the initial payment, the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the repeat pay REST API ([**POST /subscribe/payments/again**](../../api/api/api)) with the `customer_uid` as follows: + ```sh + 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 + ``` -``` -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 -``` + ### Request payment with billing key - -**Settlebank does not support** [**Request billing key API**](../../api/billing-key-api/api-1)**.** + After successfully getting the billing key and making the initial payment, + the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. + For security reasons, the server cannot directly access the billing key. + Subsequent payments can be requested by calling + the repeat pay REST API ([**POST /subscribe/payments/again**](../../api/api/api)) + with the `customer_uid` as follows: - + ```sh + 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 + ``` -**For detailed information, refer to:** + + **Settlebank does not support** [**Request billing key API**](../../api/billing-key-api/api-1)**.** + - + **For detailed information, refer to:** - + +
diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/smartro.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/smartro.mdx index e40cb932b..f134f7436 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/smartro.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/smartro.mdx @@ -4,78 +4,79 @@ description: Smartro payment window integration guide --- import Details from "~/components/gitbook/Details.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; -### 1. Configure Smartro PG settings +## 1. Configure Smartro PG settings Refer to the [**Smartro settings**](../../ready/2-pg/payment-gateway-settings/undefined-4) page to configure the PG settings. ![]() -### 2. Request payment +## 2. Request payment To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) -IMP.**request_pay**(param, callback). +IMP.**request\_pay**(param, callback). -In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. In mobile browsers, the page is redirected to **m_redirect_url**. +In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. +In mobile browsers, the page is redirected to **m\_redirect\_url**. - -```javascript title="Javascript SDK" -IMP.request_pay({ - pg : 'smartro', - pay_method : 'card', - merchant_uid : '{Merchant created Order ID}', // Example: order_no_0001 - name : 'Order name: Test payment request', - amount : 14000, - buyer_email : 'iamport@siot.do', - buyer_name : 'John Doe', - buyer_tel : '010-1234-5678', // Required - buyer_addr : 'Shinsa-dong, Gangnam-gu, Seoul', - buyer_postcode : '123-456', - m_redirect_url : '{Mobile only - URL to redirect to after payment approval}' // Example: https://www.my-service.com/payments/complete/mobile -}, function(rsp) { // callback logic - //* ...Omitted... *// -}); -``` - -#### - -### Key parameter description - -**`pg`** **\***\*\* ****s****tring\*\* + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "smartro", + pay_method: "card", + merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 + name: "Order name: Test payment request", + amount: 14000, + buyer_email: "iamport@siot.do", + buyer_name: "John Doe", + buyer_tel: "010-1234-5678", // Required + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "123-456", + m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` -**PG code** + ### Key parameter description -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`smartro`**. + **`pg`** **\*** **string** -**`pay_method`** **\***\*\* ****s****tring\*\* + **PG code** -**Payment method code** + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`smartro`**. -
-

Payment method codes

+ **`pay_method`** **\*** **string** -- `card` (credit card) -- `trans`(instant account transfer) -- `vbank`(virtual account) + **Payment method code** -
+
+

Payment method codes

-**`merchant_uid`** **\***\*\* ****s****tring\*\* + - `card` (credit card) + - `trans`(instant account transfer) + - `vbank`(virtual account) +
-**Order ID** + **`merchant_uid`** **\*** **string** -Must be unique for each request. + **Order ID** -**`amount`** **\***\*\* ****integer\*\* + Must be unique for each request. -**Payment amount** + **`amount`** **\*** **integer** -Must be an integer (not string) + **Payment amount** -
+ Must be an integer (not string) +
diff --git a/src/content/docs/en/payment-integration-by-pg/payment-gateways/toss.mdx b/src/content/docs/en/payment-integration-by-pg/payment-gateways/toss.mdx index a9215e7b1..2655232c4 100644 --- a/src/content/docs/en/payment-integration-by-pg/payment-gateways/toss.mdx +++ b/src/content/docs/en/payment-integration-by-pg/payment-gateways/toss.mdx @@ -6,285 +6,294 @@ description: Toss Payments payment window integration guide import Codepen from "~/components/gitbook/Codepen.astro"; import ContentRef from "~/components/gitbook/ContentRef.astro"; import Details from "~/components/gitbook/Details.astro"; -import Hint from "~/components/Hint.astro"; -import Tabs from "~/components/gitbook/tabs/Tabs.astro"; import Tab from "~/components/gitbook/tabs/Tab.astro"; +import Tabs from "~/components/gitbook/tabs/Tabs.astro"; +import Hint from "~/components/Hint.astro"; -### 1. Configure Toss Payments PG settings +## 1. Configure Toss Payments PG settings -Refer to the [**Toss Payments settings**](../../ready/2-pg/payment-gateway-settings/undefined) page to configure the PG settings. +Refer to the [**Toss Payments settings**](../../ready/2-pg/payment-gateway-settings/undefined) page +to configure the PG settings. ![]() ### 2. Request payment -To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) IMP.**request_pay**(param, callback). +To open the payment window, call [JavaScript SDK](../../sdk/javascript-sdk/readme) +IMP.**request\_pay**(param, callback). -In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. In mobile browsers, the page is redirected to **m_redirect_url**. +In PC browsers, **callback** is invoked after calling `IMP.request_pay(param, callback)`. +In mobile browsers, the page is redirected to **m\_redirect\_url**. - -```javascript title="Javascript SDK" -IMP.request_pay({ - pg : 'uplus', - pay_method : 'card', - merchant_uid : '{Merchant created Order ID}', // Example: order_no_0001 - name : 'Order name: Test payment request', - amount : 14000, - buyer_email : 'iamport@siot.do', - buyer_name : 'John Doe', - buyer_tel : '010-1234-5678', - buyer_addr : 'Shinsa-dong, Gangnam-gu, Seoul', - buyer_postcode : '123-456', - m_redirect_url : '{Mobile only - URL to redirect to after payment approval}' // Example: https://www.my-service.com/payments/complete/mobile -}, function(rsp) { // callback logic - //* ...Omitted... *// -}); -``` - -#### - -### Key parameter description - -**`pg`** **\***\*\* ****s****tring\*\* + + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "uplus", + pay_method: "card", + merchant_uid: "{Merchant created Order ID}", // Example: order_no_0001 + name: "Order name: Test payment request", + amount: 14000, + buyer_email: "iamport@siot.do", + buyer_name: "John Doe", + buyer_tel: "010-1234-5678", + buyer_addr: "Shinsa-dong, Gangnam-gu, Seoul", + buyer_postcode: "123-456", + m_redirect_url: "{Mobile only - URL to redirect to after payment approval}", // Example: https://www.my-service.com/payments/complete/mobile + }, + function (rsp) { + // callback logic + //* ...Omitted... *// + }, + ); + ``` -**PG code** + ### Key parameter description -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`uplus`**. + **`pg`** **\*** **string** -**`pay_method`** **\***\*\* ****s****tring\*\* + **PG code** -**Payment method code** + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`uplus`**. -
-

Payment method codes

+ **`pay_method`** **\*** **string** -- `card` (credit card) -- `trans`(instant account transfer) -- `vbank`(virtual account) -- `phone`(mobile micropayment) + **Payment method code** -
+
+

Payment method codes

-**`merchant_uid`** **\***\*\* ****s****tring\*\* + - `card` (credit card) + - `trans`(instant account transfer) + - `vbank`(virtual account) + - `phone`(mobile micropayment) +
-**Order ID** + **`merchant_uid`** **\*** **string** -Must be unique for each request. + **Order ID** -**`amount`** **\***\*\* ****integer\*\* + Must be unique for each request. -**Payment amount** + **`amount`** **\*** **integer** -Must be an integer (not string). + **Payment amount** -**` escrow`` `****`boolean`** + Must be an integer (not string). -**Ecrow option** + **`escrow`` `****`boolean`** - + **Ecrow option** -
+ +
- -To open non-authenticated payment window, specify the **customer\_uid** parameter. After getting a billing key from this window, you can request payment using the billing key. + + To open non-authenticated payment window, specify the **customer\_uid** parameter. + After getting a billing key from this window, you can request payment using the billing key. -```javascript title="Javascript SDK" -IMP.request_pay( - { - pg: "tosspayments", - pay_method: "card", // only 'card' supported. - merchant_uid: "{Merchant created Order ID}", // Example: issue_billingkey_monthly_0001 - name: "Initial billing key request", - amount: 0, // For display purpose only (no payment approval). - customer_uid: "{Unique ID for the card (billing key)}", // Required (Example: gildong_0001_1234) - buyer_email: "johndoe@gmail.com", - buyer_name: "John Doe", - buyer_tel: "02-1234-1234", - m_redirect_url: "{redirect URL}", // Example: https://www.my-service.com/payments/complete/mobile (for mobile only) - customer_id: "matthew", // Merchant user ID - }, - function (rsp) { - // callback - } -); -``` + ```ts title="Javascript SDK" + IMP.request_pay( + { + pg: "tosspayments", + pay_method: "card", // only 'card' supported. + merchant_uid: "{Merchant created Order ID}", // Example: issue_billingkey_monthly_0001 + name: "Initial billing key request", + amount: 0, // For display purpose only (no payment approval). + customer_uid: "{Unique ID for the card (billing key)}", // Required (Example: gildong_0001_1234) + buyer_email: "johndoe@gmail.com", + buyer_name: "John Doe", + buyer_tel: "02-1234-1234", + m_redirect_url: "{redirect URL}", // Example: https://www.my-service.com/payments/complete/mobile (for mobile only) + customer_id: "matthew", // Merchant user ID + }, + function (rsp) { + // callback + }, + ); + ``` - -* To request non-authenticated payment, you must set the **MID issued by Toss Payments** in the Admin console. -* Toss Payments **does not process the payment** when issuing the billing key even if you specify an amount. - - - -### Key parameter description + + - To request non-authenticated payment, you must set the **MID issued by Toss Payments** in the Admin console. -**`pg`** **\***\*\* ****s****tring\*\* + - Toss Payments **does not process the payment** + when issuing the billing key even if you specify an amount. + -**PG code** + ### Key parameter description -- If not specified and this is the only PG setting that exists, `default PG` is automatically set. -- If there are multiple PG settings, set to **`tosspayments`**. + **`pg`** **\*** **string** -**`customer_uid`** **\***\*\* ****string\*\* + **PG code** -**Credit card billing key** + - If not specified and this is the only PG setting that exists, `default PG` is automatically set. + - If there are multiple PG settings, set to **`tosspayments`**. -Billing key to be mapped 1:1 with the user-entered credit card information. + **`customer_uid`** **\*** **string** -**`amount`** **\***\*\* ****Integer\*\* + **Credit card billing key** -**Payment amount** + Billing key to be mapped 1:1 with the user-entered credit card information. -Amount to display in the payment window, but actual payment approval is not processed. (To request payment, use the **REST API with the customer_uid**.) + **`amount`** **\*** **Integer** -**`customer_id`** **\***\*\* ****string\*\* + **Payment amount** -**Customer ID** + Amount to display in the payment window, but actual payment approval is not processed. (To request payment, use the **REST API with the customer\_uid**.) -Customer user ID that maps to billing key. If not specified, this is generated by i'mport.\ + **`customer_id`** **\*** **string** -### Request payment with billing key (customer_uid) + **Customer ID** -After successfully getting the billing key, the billing key is **stored on the i'mport server** mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the [**non-authenticated payment request REST API**](../../api/api/api) with the `customer_uid` as follows: + Customer user ID that maps to billing key. If not specified, this is generated by i'mport.\\ -```title="sever-side" -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 -``` + ### Request payment with billing key (customer\_uid) - + After successfully getting the billing key, the billing key is **stored on the i'mport server** + mapped 1:1 with the specified `customer_uid`. + For security reasons, the server cannot directly access the billing key. + Subsequent payments can be requested by calling + the [**non-authenticated payment request REST API**](../../api/api/api) + with the `customer_uid` as follows: - -#### **You can use i'mport REST API to request billing key, request payment, and schedule payment.** + ```sh title="sever-side" + 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 + ``` + - -**MID Issuance** - -When you get an MID from Toss Payments, the **API version** must be **1.4**. - - + + #### **You can use i'mport REST API to request billing key, request payment, and schedule payment.** -### Request one-time payment + + **MID Issuance** -To request a one-time payment, use the key-in REST[ **API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). The card information is not saved during this process. + When you get an MID from Toss Payments, the **API version** must be **1.4**. + -``` -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 -``` + ### Request one-time payment -### + To request a one-time payment, use the key-in [**REST API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). + The card information is not saved during this process. -### Request billing key + ```sh + 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 + ``` -To request a billing key, use the billing key request REST [**API POST /subscribe/customers/\{customer_uid}**](../../api/billing-key-api/api-1). + ### Request billing key -``` -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 -``` + To request a billing key, use the billing key request REST [**API POST /subscribe/customers/\{customer\_uid}**](../../api/billing-key-api/api-1). -### Request billing key + initial payment + ```sh + 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 + ``` -To request a billing key and initial payment, use the key-in REST [**API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). + ### Request billing key + initial payment -- **`customer_uid`** : required for saving the billing key. + To request a billing key and initial payment, use the key-in REST [**API POST /subscribe/payments/onetime**](../../api/api/request-non-authenticated-payment-one-time-api). -``` -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 -``` + - **`customer_uid`** : required for saving the billing key. -### Request payment with billing key + ```sh + 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 + ``` -After successfully getting the billing key and making the initial payment, the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the repeat pay REST API ([**POST /subscribe/payments/again**](../../api/api/api)) with the `customer_uid` as follows: + ### Request payment with billing key -``` -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 -``` + After successfully getting the billing key and making the initial payment, + the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. + For security reasons, the server cannot directly access the billing key. + Subsequent payments can be requested by calling + the repeat pay REST API ([**POST /subscribe/payments/again**](../../api/api/api)) + with the `customer_uid` as follows: -**For detailed information, refer to:** + ```sh + 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 + ``` - + **For detailed information, refer to:** - + +
### 3. Additional functions - -```javascript title="javascript" -display: { - card_quota: [6], // Display up to 6 months installment plans - only_installment: true // Disable immediate pay option -} -``` - -**Parameters** - -- **card_quota :** - - Enable only specified installment months - - `[]`: Only immediate pay - - `2,3,4,5,6`: immediate, 2, 3, 4, 5, 6 month installment plans -- If **only_installment: `true`**, only shows specified months in **`card_quota`**.\ - - -Installment plan option is available only for **KRW 50,000 or more**. - - - - - - -```javascript title="javascript" -card: { - direct: { - code: "367", - quota: 3 + + ```json title="javascript" + { + "display": { + "card_quota": [6], // Display up to 6 months installment plans + "only_installment": true // Disable immediate pay option + } } -} -``` - -**Parameters** - -- **code**: [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) -- **quota**: Installment plan. For immediate, set to 0. (**integer**) - - - - -```javascript title="javascript" -card : { - detail : [ - {card_code:"*", enabled:false}, // Disable all credit cards - {card_code:'366', enabled:true} // Enable specific credit card - ] -} -``` - -**Parameters** + ``` + + **Parameters** + + - **card\_quota :** + - Enable only specified installment months + - `[]`: Only immediate pay + - `2,3,4,5,6`: immediate, 2, 3, 4, 5, 6 month installment plans + + - If **only\_installment: `true`**, only shows specified months in **`card_quota`**.\\ + + + Installment plan option is available only for **KRW 50,000 or more**. + + + + + ```json title="javascript" + { + "card": { + "direct": { + "code": "367", + "quota": 3 + } + } + } + ``` + + **Parameters** + + - **code**: [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string**) + - **quota**: Installment plan. For immediate, set to 0. (**integer**) + + + + ```json title="javascript" + { + "card": { + "detail": [ + { "card_code": "*", "enabled": false }, // Disable all credit cards + { "card_code": "366", "enabled": true }, // Enable specific credit card + ] + } + } + ``` -- **card_code:** [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) (**string)** -- **enabled:** Option to enable the credit card (**boolean)** + **Parameters** - + - **card\_code:** [**Credit card code**](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630) **(string)** + - **enabled:** Option to enable the credit card (**boolean)** + -**Hub-type simple payment** - -Simple payments (Kakao Pay, Naver Pay, etc.) are not supported in Toss Payments payment window. + **Hub-type simple payment** + Simple payments (Kakao Pay, Naver Pay, etc.) are not supported in Toss Payments payment window.