diff --git a/processor/src/services/adyen-payment.service.ts b/processor/src/services/adyen-payment.service.ts index a7c8a2c..08c186a 100644 --- a/processor/src/services/adyen-payment.service.ts +++ b/processor/src/services/adyen-payment.service.ts @@ -176,9 +176,10 @@ export class AdyenPaymentService extends AbstractPaymentService { id: ctCart.customerId, }, }), - ...(ctCart.anonymousId && { - anonymousId: ctCart.anonymousId, - }), + ...(!ctCart.customerId && + ctCart.anonymousId && { + anonymousId: ctCart.anonymousId, + }), }); const updatedCart = await this.ctCartService.addPayment({ @@ -240,9 +241,10 @@ export class AdyenPaymentService extends AbstractPaymentService { id: ctCart.customerId, }, }), - ...(ctCart.anonymousId && { - anonymousId: ctCart.anonymousId, - }), + ...(!ctCart.customerId && + ctCart.anonymousId && { + anonymousId: ctCart.anonymousId, + }), }); ctCart = await this.ctCartService.addPayment({