Edit in JSFiddle

// step 0 - load
var worker = new encrypter({
    mode: 'NORENDER',
    key: {
        contents: '-----BEGIN PUBLIC KEY-----MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA13PTo+cgJMtUc68br9CDO1+yX9L20QcBCv3HfA1lCkO9cLfi27wZ+scwISTpNXOM8MLRq3iTTHFF7JYLrk0ztU6E3fCqut7M/0YyHqwHbOZaw/msFBRkkfmvWq0UXNwksi7T26Yn7OHAVMyHuMFidz+ggQxsIW9UVryHwvkWA+qdqcMxRy+kdw+UyFGWuSJgDEIjChffICmHiU2T+NEXQp9ChjxLhvCVj6YdRlsM+EbZynPFReoIbLyI9FjBIQ1kIgBoJtgEm1X4j5l6XhKJ2gwJB4blWStGKjbrTkPG4tqd4ZjtiapQliMuYhz3B5kWvCKimCHZmbB3OM3bWteVGQIdJ3a8ScO3MmxnCLhHknth+a2pFcIOULGfR3LZr31ihFN/uzODDMU+z7AyrH9L4F1/3UJuUtfpz0xDPMK9zhOe0j6JQJrlLEMKSuX2CONTv39dbUqQVW9hOFpYkjZw70zlHCiJbi53Qpwjqt355QnUDlcxZQgmpF916ZmBMsRcyZykFEdhZXFVhCRqJ6exx/428RSe0yC1mbIqm7Pmogjhwn9yKa5yIA7FaaLFQtJfzKQx4reK8+qtBJ6Wl3tNZa9zjzsY8HRvjmtJHfGswGvoBNEP+hWh1eAgEh7MrEKqqdU4KBwbJv7OUBIUGjm/QiqrQzRQzETXTdTonbnodpkCAwEAAQ==-----END PUBLIC KEY-----',
        identifier: 'public-key-0001'
    }
});

// step 1 - init and fill with defaults
var fields = worker.getCurrentPaymentMethod().getFields();
var details = {}; // will be filled

for (var i in fields) {
    var fieldItem = fields[i];
    details[i] = fieldItem.getDefaultValue();
}

// step 2 - fill data
details.RecurringEnabled = false;
details.Country = "Romania";
details.HolderName = "Test S";
details.CardType = "visa";
details.CardNumber = "4111111111111111";
details.CCID = "123";
details.ExpirationMonth = 11;
details.ExpirationYear = 2017;

console.log("Unencrypted", details);

// step 3 - encrypt
var encryptedDetails = worker.getEncryptedDetails(JSON.stringify(details));

console.log("Encrypted results", encryptedDetails);

// step 4 - assemble a placeOrder call
/*
{
    "Items": [
        {
            "Code": "SERVICE_TT",
            "Quantity": 1
        }
    ],
    "BillingDetails": {
        "FirstName": "Shopper",
        "LastName": "Test",
        "Email": "shopper@test.dev",
        "Address": "DP",
        "City": "Bucharest",
        "PostalCode": 74001,
        "CountryCode": "ro",
        "State": "Sector 2"
    },
    "PaymentDetails": {
        "Type": "ENCRYPTED_PAYMENT_DATA",
        "Currency": "usd",
        "PaymentMethod": {
            "Type": "CC",
            "Contents": "amdoKq2u6PtUY0KZQcVm1cmuAUMVCOb6j00…",
            "Identifier": "public-key-0001"
        }
    }
}

*/