Developers
V1
V2

Integrating Multiple PGs

Learn how to set up and use multiple PGs.

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)

Go to iโ€™mport Admin Console > System Settings > PG Settings tab > Default PG tab to set the default PG that is used as the default param.pg value when you call IMP.request_pay to open the payment window. The default value is used when the pg value is missing or invalid.

Configure authenticated payment (general)
Configure authenticated payment (general)

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.

Add new PG page
Add new PG page

3. Add PG for simple payment (Kakao Pay)

Repeat step 2 to add PG setting for Kakao Pay.

Add simple payment Kakao Pay
Add simple payment Kakao Pay

Open PGโ€™s payment window

To open a PGโ€™s payment window, call JavaScript SDK IMP.request_pay by specifying the PG that is already configured in Admin console in the param.pg property.

The pg value can have the following format:

  • { PG code }
  • { PG code }.{ PG Merchant ID }

Assume that we have 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

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:

client-side
IMP.request_pay({ pg: "kakaopay", //Open Kakao Pay payment page amount: 1000, name: "Sample order", buyer_name: "Buyer", buyer_email: "buyer@iamport.kr", });

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
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" });

Matching priority for PG

IMP.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.