Skip to content

Commit

Permalink
Chore: Fix Sonarqube audit error
Browse files Browse the repository at this point in the history
  • Loading branch information
NghiaDTr committed Oct 2, 2024
1 parent fc677d6 commit 11af8f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions processor/src/validators/payment.validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const validateCardToken = (cardToken: string | undefined, ctPayment: CTPayment):
};

export const validateBanktransfer = (paymentCustomFields: any, ctPayment: CTPayment): void => {
if (!paymentCustomFields?.billingAddress || !paymentCustomFields?.billingAddress?.email) {
if (!paymentCustomFields?.billingAddress?.email) {
throwError(
'validateBanktransfer',
'email is required for payment method banktransfer. Please make sure you have sent it in billingAddress.email of the custom field.',
Expand Down Expand Up @@ -192,7 +192,7 @@ export const checkValidRefundTransactionForCreate = (ctPayment: CTPayment): bool
throwError('checkValidRefundTransactionForCreate', 'No initial refund transaction found.');
}

if (!initialRefundTransaction?.amount || !initialRefundTransaction?.amount.centAmount) {
if (!initialRefundTransaction?.amount?.centAmount) {
throwError(
'checkValidRefundTransactionForCreate',
`No amount found in initial refund transaction, CommerceTools Transaction ID: ${initialRefundTransaction?.id}.`,
Expand Down

0 comments on commit 11af8f6

Please sign in to comment.