{"title":"Migrating from Secured Fields v1.1.4 to 1.3.0","category":"default","creationDate":1796385375,"content":"<p>Use these guidelines to update your integration with Adyen when you are migrating from Secured Fields 1.1.4 to 1.3.0 or later.<\/p>\n<h2 id=\"step-1-update-the-secured-fields-version\">Step 1: Update the Secured Fields version<\/h2>\n<p>Update the script version in the\u00a0<code>&lt;head&gt;<\/code>\u00a0element of your payments page. The latest version is 1.5.2.<\/p>\n<pre><code class=\"language-js\">&lt;script type=\"text\/javascript\" src=\"https:\/\/checkoutshopper-test.adyen.com\/checkoutshopper\/assets\/js\/sdk\/checkoutSecuredFields.1.5.2.min.js\"&gt;&lt;\/script&gt;<\/code><\/pre>\n<h2 id=\"step-2-update-secured-fields-elements\">Step 2: Update Secured Fields elements<\/h2>\n<p>Remove\u00a0<code>data-hosted-id<\/code>\u00a0in the\u00a0<code>&lt;div&gt;<\/code>\u00a0in the\u00a0<code>&lt;body&gt;<\/code>\u00a0of your payments page. The <code>data-cse<\/code>\u00a0attribute is now used to identify the holder for secured iframes.<\/p>\n<pre><code class=\"language-xml\">&lt;label class=\"pm-form-label\"&gt;\n  &lt;span class=\"pm-form-label__text\"&gt;Card number:&lt;\/span&gt;\n  &lt;span class=\"pm-input-field\" data-hosted-id=\"hostedCardNumberField\" data-cse=\"encryptedCardNumber\" \/&gt;\n&lt;\/label&gt;<\/code><\/pre>\n<pre><code class=\"language-xml\">&lt;label class=\"pm-form-label\"&gt;\n  &lt;span class=\"pm-form-label__text\"&gt;Card number:&lt;\/span&gt;\n  &lt;span class=\"pm-input-field\" data-cse=\"encryptedCardNumber\" \/&gt;\n&lt;\/label&gt;<\/code><\/pre>\n<h2 id=\"step-3-review-and-update-secured-fields-configuration\">Step 3: Review and update Secured Fields configuration<\/h2>\n<p>Check the configuration object at the bottom of the <code>&lt;body&gt;<\/code> and add properties if applicable.<\/p>\n<pre><code class=\"language-js\">   &lt;script type=\"text\/javascript\"&gt;\n   var csfSetupObj = {\n      rootNode: '.cards-div',\n      configObject : {\n        originKey : \"[ORIGIN KEY]\",\n        cardGroupTypes: ['maestro','visa','amex'] \/\/ OPTIONAL\n        },\n      allowedDOMAccess : false, \/\/ OPTIONAL  - Defaults to true\n      showWarnings : true,\/\/ OPTIONAL  - Defaults to false\n   };\n   var securedFields = csf(csfSetupObj);\n  &lt;\/script&gt;<\/code><\/pre>\n<ul>\n<li><code>originKey<\/code>: Required. The Origin Key\u00a0of your website. To find out how to generate one, see <a href=\"\/development-resources\/how-to-get-an-origin-key\">How to get an origin key<\/a>.<\/li>\n<li><code>cardGroupTypes<\/code>: Optional. Configure supported card types. If card types are not provided, the configuration defaults to ['<code>mc<\/code>','<code>visa<\/code>','<code>amex<\/code>'].<\/li>\n<li><code>allowedDOMAccess<\/code>: Optional.\u00a0Defaults to\u00a0<span translate=\"no\"><strong>true<\/strong><\/span>.\u00a0If\u00a0<code>allowedDOMAccess<\/code>\u00a0is set to\u00a0<span translate=\"no\"><strong>true<\/strong><\/span>,\u00a0Secured Fields adds encrypted values to hidden\u00a0<code>&lt;input&gt;<\/code>\u00a0fields in the\u00a0<code>&lt;div&gt;<\/code>\u00a0that holds the\u00a0<code>data-cse<\/code>\u00a0elements.\u00a0<br \/>\nIf you do not want Secured Fields to\u00a0automatically add hidden input fields,\u00a0set\u00a0<code>allowedDOMAccess<\/code>\u00a0to\u00a0<span translate=\"no\"><strong>false<\/strong><\/span>.\u00a0To get the encrypted card details when\u00a0<code>allowedDOMAccess<\/code>\u00a0is set to\u00a0<span translate=\"no\"><strong>false<\/strong><\/span>, use the values from the\u00a0<code>blob<\/code>\u00a0property on the\u00a0<code>onFieldValid<\/code>\u00a0callback object. This callback is invoked as a specific field is validated and encrypted. See <a href=\"\/payment-methods\/cards\/secured-fields-standalone#callbacks\">Secured Field callbacks<\/a> for more information.<\/li>\n<li><code>showWarnings<\/code>: Optional. From Secured Fields version 1.3.1 and later, this configuration defaults to\u00a0<span translate=\"no\"><strong>false<\/strong><\/span>. To continue receiving warnings for origin and data mismatches, set the value to\u00a0<span translate=\"no\"><strong>true<\/strong><\/span>.<\/li>\n<\/ul>\n<p>Next, if you are adding\u00a0<a href=\"\/payment-methods\/cards\/secured-fields-standalone#styling\">placeholder values<\/a> in your configuration,\u00a0replace the field names with\u00a0<code>encryptedCardNumber<\/code>,\u00a0<code>encryptedExpiryDate<\/code>,\u00a0<code>encryptedExpiryMonth<\/code>,\u00a0<code>encryptedExpiryYear<\/code>, and\u00a0<code>encryptedSecurityCode<\/code>.<\/p>\n<p>Lastly, review your\u00a0callback\u00a0implementation.\u00a0We introduced the\u00a0<code>onBinValue<\/code>\u00a0callback and changed\u00a0object values\u00a0in version 1.3.0.\u00a0<\/p>\n<h3 id=\"callback-changes-in-1-3-0\">Callback changes in 1.3.0<\/h3>\n<p>For a complete description of the callbacks, see\u00a0<a href=\"\/payment-methods\/cards\/secured-fields-standalone#callbacks\">Secured Field callbacks<\/a>\u00a0page.<\/p>\n<h4 id=\"onallvalid\">onAllValid<\/h4>\n<pre><code class=\"language-js\">{\n  allValid: false,\n  type: \"card\"\n}<\/code><\/pre>\n<h4 id=\"onfieldvalid\">onFieldValid<\/h4>\n<pre><code class=\"language-js\">{\n  blob: \"adyenjs_0_1_22$IGaNbdJNru...\",\n  encryptedFieldName: \"encryptedExpiryMonth\",\n  fieldType: \"encryptedExpiryDate\",\n  uid: \"card-encrypted-month\",\n  valid: true,\n  txVariant: \"card\",\n  markerNode: [HTML Node],\n  type: \"month\"\n}<\/code><\/pre>\n<div class=\"sc-notice note\"><div>\n<p>** If you are upgrading from version 1.2.0, update <code>type:\"card\"<\/code> to <code>txVariant:\"card\"<\/code> and <code>originalFieldType:\"month\"<\/code> to <code>type:\"month\"<\/code>.<\/p>\n<\/div><\/div>\n<h4 id=\"onfocus\">onFocus<\/h4>\n<pre><code class=\"language-js\">{\n  action: \"focus\",\n  focus: true,\n  fieldType: \"encryptedCardNumber\",\n  txVariant: \"card\",\n  markerNode: [HTML Node]\n}<\/code><\/pre>\n<h4 id=\"onbinvalue\">onBinValue<\/h4>\n<p>This callback is available from version 1.3.1.<\/p>\n<pre><code class=\"language-js\">{\n  binValue: \"411111\",\n  txVariant: \"card\"\n}<\/code><\/pre>","url":"https:\/\/docs.adyen.com\/migrating-from-secured-fields-v114-to-130","articleFields":{"id":"42840197","robots":"noindex,nofollow","type":"page","_expandable":{"operations":""},"status":"current","last_edit_on":"26-04-2019 12:57"},"algolia":{"url":"https:\/\/docs.adyen.com\/migrating-from-secured-fields-v114-to-130","title":"Migrating from Secured Fields v1.1.4 to 1.3.0","content":"Use these guidelines to update your integration with Adyen when you are migrating from Secured Fields 1.1.4 to 1.3.0 or later.\nStep 1: Update the Secured Fields version\nUpdate the script version in the\u00a0&lt;head&gt;\u00a0element of your payments page. The latest version is 1.5.2.\n&lt;script type=\"text\/javascript\" src=\"https:\/\/checkoutshopper-test.adyen.com\/checkoutshopper\/assets\/js\/sdk\/checkoutSecuredFields.1.5.2.min.js\"&gt;&lt;\/script&gt;\nStep 2: Update Secured Fields elements\nRemove\u00a0data-hosted-id\u00a0in the\u00a0&lt;div&gt;\u00a0in the\u00a0&lt;body&gt;\u00a0of your payments page. The data-cse\u00a0attribute is now used to identify the holder for secured iframes.\n&lt;label class=\"pm-form-label\"&gt;\n  &lt;span class=\"pm-form-label__text\"&gt;Card number:&lt;\/span&gt;\n  &lt;span class=\"pm-input-field\" data-hosted-id=\"hostedCardNumberField\" data-cse=\"encryptedCardNumber\" \/&gt;\n&lt;\/label&gt;\n&lt;label class=\"pm-form-label\"&gt;\n  &lt;span class=\"pm-form-label__text\"&gt;Card number:&lt;\/span&gt;\n  &lt;span class=\"pm-input-field\" data-cse=\"encryptedCardNumber\" \/&gt;\n&lt;\/label&gt;\nStep 3: Review and update Secured Fields configuration\nCheck the configuration object at the bottom of the &lt;body&gt; and add properties if applicable.\n   &lt;script type=\"text\/javascript\"&gt;\n   var csfSetupObj = {\n      rootNode: '.cards-div',\n      configObject : {\n        originKey : \"[ORIGIN KEY]\",\n        cardGroupTypes: ['maestro','visa','amex'] \/\/ OPTIONAL\n        },\n      allowedDOMAccess : false, \/\/ OPTIONAL  - Defaults to true\n      showWarnings : true,\/\/ OPTIONAL  - Defaults to false\n   };\n   var securedFields = csf(csfSetupObj);\n  &lt;\/script&gt;\n\noriginKey: Required. The Origin Key\u00a0of your website. To find out how to generate one, see How to get an origin key.\ncardGroupTypes: Optional. Configure supported card types. If card types are not provided, the configuration defaults to ['mc','visa','amex'].\nallowedDOMAccess: Optional.\u00a0Defaults to\u00a0true.\u00a0If\u00a0allowedDOMAccess\u00a0is set to\u00a0true,\u00a0Secured Fields adds encrypted values to hidden\u00a0&lt;input&gt;\u00a0fields in the\u00a0&lt;div&gt;\u00a0that holds the\u00a0data-cse\u00a0elements.\u00a0\nIf you do not want Secured Fields to\u00a0automatically add hidden input fields,\u00a0set\u00a0allowedDOMAccess\u00a0to\u00a0false.\u00a0To get the encrypted card details when\u00a0allowedDOMAccess\u00a0is set to\u00a0false, use the values from the\u00a0blob\u00a0property on the\u00a0onFieldValid\u00a0callback object. This callback is invoked as a specific field is validated and encrypted. See Secured Field callbacks for more information.\nshowWarnings: Optional. From Secured Fields version 1.3.1 and later, this configuration defaults to\u00a0false. To continue receiving warnings for origin and data mismatches, set the value to\u00a0true.\n\nNext, if you are adding\u00a0placeholder values in your configuration,\u00a0replace the field names with\u00a0encryptedCardNumber,\u00a0encryptedExpiryDate,\u00a0encryptedExpiryMonth,\u00a0encryptedExpiryYear, and\u00a0encryptedSecurityCode.\nLastly, review your\u00a0callback\u00a0implementation.\u00a0We introduced the\u00a0onBinValue\u00a0callback and changed\u00a0object values\u00a0in version 1.3.0.\u00a0\nCallback changes in 1.3.0\nFor a complete description of the callbacks, see\u00a0Secured Field callbacks\u00a0page.\nonAllValid\n{\n  allValid: false,\n  type: \"card\"\n}\nonFieldValid\n{\n  blob: \"adyenjs_0_1_22$IGaNbdJNru...\",\n  encryptedFieldName: \"encryptedExpiryMonth\",\n  fieldType: \"encryptedExpiryDate\",\n  uid: \"card-encrypted-month\",\n  valid: true,\n  txVariant: \"card\",\n  markerNode: [HTML Node],\n  type: \"month\"\n}\n\n** If you are upgrading from version 1.2.0, update type:\"card\" to txVariant:\"card\" and originalFieldType:\"month\" to type:\"month\".\n\nonFocus\n{\n  action: \"focus\",\n  focus: true,\n  fieldType: \"encryptedCardNumber\",\n  txVariant: \"card\",\n  markerNode: [HTML Node]\n}\nonBinValue\nThis callback is available from version 1.3.1.\n{\n  binValue: \"411111\",\n  txVariant: \"card\"\n}","type":"page","locale":"en","boost":19,"hierarchy":{"lvl0":"Home","lvl1":"Migrating from Secured Fields v1.1.4 to 1.3.0"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"\/migrating-from-secured-fields-v114-to-130"},"levels":2,"category":"","category_color":"","tags":["Migrating","Secured","Fields","v1.1.4","1.3.0"]}}
