iamport-manual icon indicating copy to clipboard operation
iamport-manual copied to clipboard

When using (구) 토스페이먼츠 test PG and cancel Payment window, callback is not executed.

Open benderillo opened this issue 1 year ago • 0 comments

Environment

  • React application on PC
  • jQuery: 1.12.4
  • iamport sdk: 1.1.8 (https://cdn.iamport.kr/js/iamport.payment-1.1.8.js)

Description When trying to make payments in test mode our code calls iamport method (IMP.request_pay()) but if we cancel the payment window (or close it), the iamport iframe does not disappear and the callback is not called.

Here is how we call it:

  const params = {
        pg: 'uplus.testmuid',
        pay_method: 'card',
        merchant_uid: "order001",
        name: `test product`,
        amount: 10000,
        currency: 'krw',
        buyer_email: "[email protected]",
        buyer_name: "John Doe",
        language: 'ko',
       company: "Super store"
  };

  IMP.request_pay(params, (rsp) => {
    console.log("callback is called!");
  });

When we use nicepay PG in the test mode, we don't have this issue. The iframe is removed and the callback is properly called.

Actual behaviour The payment window iframe does not disappear when the payment window is closed/cancelled. It leaves semi-transparent overlay over the entire browser viewport. The callback is not called to notify our app that the payment was cancelled.

** Expected behaviour** Closing payment window should remove the iframe and the callback should be called.

benderillo avatar Sep 02 '22 09:09 benderillo