Skip to content

Commit

Permalink
Merge pull request #95 from Adyen/fix/clientKey-check
Browse files Browse the repository at this point in the history
Check for clientKey and fallback to originKey on CSF
  • Loading branch information
marcperez authored Jul 8, 2020
2 parents 9606236 + e29e903 commit 1f2dba4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/components/internal/SecuredFields/lib/core/initCSF.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@ const initCSF = (pSetupObj: SetupObject): CSFReturnObject => {
return null;
}

// TODO - enable once clientKey is documented & support/IM are aware of it
// if (falsy(setupObj.clientKey)) {
// logger.warn(
// 'WARNING: Checkout configuration object is missing a "clientKey" property.\nFor a transition period the originKey will be accepted instead but this will eventually be deprecated'
// );
// }

if (falsy(setupObj.originKey)) {
logger.error('ERROR: SecuredFields configuration object is missing an "originKey" property');
if (falsy(setupObj.clientKey) && falsy(setupObj.originKey)) {
logger.warn(
'WARNING: Checkout configuration object is missing a "clientKey" property.\nFor a transition period the originKey will be accepted instead but this will eventually be deprecated'
);
return null;
}

//----------------------------------------------------------------------------

// //////// 2. Find and store reference to the root DOM element //////////
Expand Down

0 comments on commit 1f2dba4

Please sign in to comment.