🪟Iframe method
Process the payment result in a typical PC environment using an iframe.
Last updated
Process the payment result in a typical PC environment using an iframe.
Last updated
What is an iframe? It is a nested browser that effectively embeds another HTML page into the current page. By using the iframe element, other pages can be loaded and inserted into a web page without any restrictions.
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.
The following sample code processes the response to a payment request in a typical PC environment where the payment window is loaded as iframe.
Based on the the payment result (sucess/fail) in the response object (rsp) 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.
The final payment result logic processing must be handled stably by using a webhook. If you don't set up a webhook, you may fail to receive the payment result.