From 6e064ffe6baa358b9a00cc18fa51862a39b024e0 Mon Sep 17 00:00:00 2001 From: Nathan Bloomfield Date: Wed, 30 Dec 2020 18:10:33 -0600 Subject: [PATCH] Remove siteId check from stored card prepurchase validation (#48632) 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. Co-authored-by: nbloomf --- .../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 66d1c110385c1..686e855ff8e31 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' ); }