Connect

The connect feature empowers seamless integration of the Open Elements JavaScript with pre-existing elements on your website essential for facilitating payment transactions. For instance, if your webpage includes input elements designated for consumer billing address details, connect allows effortless linkage of these elements to Open Elements, enabling automatic synchronization with any alterations made within these fields.

Example JS

        let oe = new openElements('Mg2KYmzEEPn2Q4Kf', {
            total: 100,
            currency: "USD",
            orderId: 'order001'
        });

        oe.connect({
            billing: {
                address1: "billToAddress",
                address2: "billToAddress2",
                city: "billToCity",
                state: "billToState",
                postalCode: "billToZip",
                country: "bill-to-country",
                firstname: "billToFirstName",
                lastname: "billToLastName"
            }
        });