Skip to content

Commit

Permalink
Remove siteId check from stored card prepurchase validation (#48632)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nbloomf and nbloomf authored Dec 31, 2020
1 parent 6bee36c commit 6e064ff
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}
Expand Down

0 comments on commit 6e064ff

Please sign in to comment.