@@ -339,7 +339,7 @@ Example using the configuration [above](#configuring-the-jwe-encryption):
339339``` js
340340const response = {};
341341response .request = { url: " /resource1" };
342- response .body =
342+ response .body = JSON . parse (
343343 " {" +
344344 ' "path": {' +
345345 ' "to": {' +
@@ -348,7 +348,7 @@ response.body =
348348 " }" +
349349 " }" +
350350 " }" +
351- " }" ;
351+ " }" ) ;
352352const jwe = new (require (" mastercard-client-encryption" ).JweEncryption )(config);
353353let responsePayload = jwe .decrypt (response);
354354```
@@ -398,11 +398,11 @@ const config = {
398398Example:
399399
400400``` js
401- const payload =
401+ const payload = JSON . parse (
402402 " {" +
403403 ' "sensitive": "this is a secret",' +
404404 ' "sensitive2": "this is a super secret!"' +
405- " }" ;
405+ " }" ) ;
406406const jwe = new (require (" mastercard-client-encryption" ).JweEncryption )(config);
407407// …
408408let responsePayload = jwe .encrypt (" /resource1" , header, payload);
@@ -446,10 +446,10 @@ const config = {
446446Example:
447447
448448``` js
449- const encryptedPayload =
449+ const encryptedPayload = JSON . parse (
450450 " {" +
451451 ' "encryptedData": "eyJraWQiOiI3NjFiMDAzYzFlYWRlM….Y+oPYKZEMTKyYcSIVEgtQw"' +
452- " }" ;
452+ " }" ) ;
453453const jwe = new (require (" mastercard-client-encryption" ).JweEncryption )(config);
454454let responsePayload = jwe .decrypt (encryptedPayload);
455455```
@@ -525,11 +525,11 @@ Example of decryption:
525525``` js
526526const response = {};
527527response .request = { url: " /resource1" };
528- response .body =
528+ response .body = JSON . parse (
529529 " {" +
530530 ' "encryptedData": "eyJraWQiOiI3NjFiMDAzYzFlYWRlM….Y+oPYKZEMTKyYcSIVEgtQw",' +
531531 ' "notSensitive": "not a secret"' +
532- " }" ;
532+ " }" ) ;
533533const jwe = new (require (" mastercard-client-encryption" ).JweEncryption )(config);
534534let responsePayload = jwe .decrypt (response);
535535```
0 commit comments