Integrating Multiple PGs


This guide describes how to set up multiple PGs in the i'mport Admin Console and open a payment window for the desired payment method.

The example in this guide shows how to add the following PG settings in order.

  1. KG INICIS for default PG
  2. KG INICIS for subscription pay
  3. Kakao Pay for simple pay

Setting up multiple PGs in the Admin Console

Before using the i'mport library, go to the Admin Console to set the Default PG and any Additional PGs if needed.
1Default PG
Go to i'mport Admin Console > System Settings > PG Settings tab > Default PG tab to set the default PG. The default PG is used as the default param.pg value when you call IMP.request_pay to open the payment page. The default value is used when the pg value is missing or invalid.

In this example, KG INICIS (web standard method) is set as the default PG as follows:
2Additional PGs

Add PG for subscription payments

First, get a separate merchant ID (MID) for subscription payment from KG INICIS.

Click the Add PG tab on the left.In the newly created Additional PG tab, enter the Merchant ID and PG information for subscription payment as follows:

Add PG for simple payments (Kakao Pay)

This time, add Kakao Pay for simple payment service.

First, get a merchant code (CID) from Kakao Pay.

Click the Add PG tab on the left again and set PG to Kakao Pay.

In this example, we added 3 PG settings as follows:
PGMerchant IDPay TypeDefault PG
KG INICISMID-a (example)GeneralO
KG INICISMID-b (example)SubscriptionX
Kakao PayMID-c (example)SimpleX

Opening Payment Window for a Specific PG

To open a PG's payment window, call IMP.request_pay by specifing the PG that is already configured in Admin Console, in the param.pg property.

The pg value can have the following format:
  • { PG service code }
  • { PG service code }.{ PG merchant ID }

Matching priority for PG

IMP.request_pay finds the setting that matches the pg value in the order of the PG settings in the Admin Console. It opens the payment window for the first matching PG setting.

Identify PG with { PG service code }

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 window as follows:
  IMP.request_pay({
    pg : "kakaopay",  //Open Kakao Pay payment page
    amount : 1000,
    name : "Sample order",
    buyer_name : "Buyer",
    buyer_email : "buyer@iamport.kr"
  });

Identify PG with { PG service 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. If you set them to the same value, the PG setting is selected according to the PG's matching priority.

Open the KG INICIS (general) payment page as follows:
  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"
  });
Open the KG INICIS (subscription) payment page as follows:
  IMP.request_pay({
    pg : "html5_inicis.MID-b",  // KG INICIS subscription payment window (merchant ID: MID-b)
    amount : 1000,
    name : "Sample order",
    buyer_name : "Buyer",
    buyer_email : "buyer@iamport.kr"
  });