From 2d6fb36947be83ea5f5c87dc01aeae85b6e50c5c Mon Sep 17 00:00:00 2001 From: nbloomf Date: Wed, 30 Dec 2020 15:30:12 -0600 Subject: [PATCH] Remove siteId check from stored card prepurchase validation A siteId is indeed required by the transaction endpoint; however for siteless checkout the corresponding `no-site` id value is added in createTransactionEndpointRequestPayloadFromLineItems, _after_ this validation check happens. With this check in place, when the siteId is not set we throw an error before getting to the code that cleans up the transaction payload. --- .../checkout/composite-checkout/lib/existing-card-processor.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/my-sites/checkout/composite-checkout/lib/existing-card-processor.ts b/client/my-sites/checkout/composite-checkout/lib/existing-card-processor.ts index 66d1c110385c1b..686e855ff8e31f 100644 --- a/client/my-sites/checkout/composite-checkout/lib/existing-card-processor.ts +++ b/client/my-sites/checkout/composite-checkout/lib/existing-card-processor.ts @@ -76,9 +76,6 @@ function isValidTransactionData( // Validate data required for this payment method type. Some other data may // be required by the server but not required here since the server will give // a better localized error message than we can provide. - if ( ! data.siteId ) { - throw new Error( 'Transaction requires siteId and none was provided' ); - } if ( ! data.country ) { throw new Error( 'Transaction requires country code and none was provided' ); }