From fcfe659b3b944e5c0defafe28dc36438eb9278dd Mon Sep 17 00:00:00 2001 From: James Mendez Date: Thu, 25 Jul 2024 17:09:19 -0400 Subject: [PATCH] Sc 74533/trustedform v4 verify language approved (#117) * fixed verify language nesting to solve appended data issue * changed parsing to be nested under verify * added testing * removed mocha requirement * updated v4 integration response to append language approved and ensure it is a boolean value * adjusted based on comments from last pr --- CHANGELOG.md | 4 ++++ lib/trustedform.js | 2 +- test/trustedform_spec.js | 6 +----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96190a7..91a81d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org) +## [2.4.1] - 2024-07-25 +### Added +- updated v4 integration response to append language approved and ensure it is a boolean value + ## [2.4.0] - 2024-04-10 ### Added - v4 integration now supports optional api key mapping diff --git a/lib/trustedform.js b/lib/trustedform.js index 6db5c43..3ab7390 100644 --- a/lib/trustedform.js +++ b/lib/trustedform.js @@ -256,7 +256,7 @@ response.variables = () => [ { name: 'page_url', type: 'string', description: 'The URL of the page hosting TrustedForm Certify.' }, { name: 'parent_page_url', type: 'string', description: 'The parent URL of the page hosting TrustedForm Certify, if framed.' }, { name: 'verify.languages', type: 'array', description: 'A list of the consent languages detected within the certificate' }, - { name: 'verify.language_approved', type: 'string', description: 'A boolean indicating if any of the consent languages found have been approved in your account\'s consent language manager.' }, + { name: 'verify.language_approved', type: 'boolean', description: 'A boolean indicating if any of the consent languages found have been approved in your account\'s consent language manager.' }, { name: 'verify.success', type: 'boolean', description: 'A boolean indicating if any of the consent languages found meet the success criteria defined for your account.' }, ]; diff --git a/test/trustedform_spec.js b/test/trustedform_spec.js index 14d6a6b..106def7 100644 --- a/test/trustedform_spec.js +++ b/test/trustedform_spec.js @@ -498,11 +498,7 @@ describe('v4', () => { status: 200, body: JSON.stringify({ 'verify': { - 'languages': [ - { - 'text': 'By clicking on the "Get Rates" button below, I consent to be contacted' - } - ], + 'languages': [{'text': 'By clicking on the "Get Rates" button below, I consent to be contacted'}], 'result': { 'language_approved': false, 'success': false