An electronic device associated with a customer for facilitating a transaction between the customer and a merchant, the electronic device comprising at least one processor and memory storing instructions that, when executed by the at least one processor, cause a client-side application executing on the electronic device to:
- display a payment form on the electronic device, wherein the payment form comprises one or more fields configured to receive payment information from the customer;
- establish a secure communication tunnel to a third-party server for cross-origin communication, wherein the secure communication tunnel is established when the payment form is loaded for display on the electronic device;
- intercept, via an event handler associated with the payment form, submission of the payment form at the electronic device;
- send, through the secure communication tunnel to the third-party server, the payment information from the one or more fields for conversion into a token;
- receive, through the secure communication tunnel from the third-party server, the token configured to serve as a proxy for the payment information;
- and
- send, to a server-side application of the merchant, data from the payment form, including the token and excluding the payment information, for processing the transaction between the customer and the merchant.