Skip to content

Commit

Permalink
Merge pull request #116 from commercetools/dasanorct/SCC-2292_fix_ano…
Browse files Browse the repository at this point in the history
…nymous_id

fix(payments): solved issue when creating a payment from a cart that contains both a customer id and an anonymous id
  • Loading branch information
dasanorct authored May 6, 2024
2 parents 462ac7d + a3e0702 commit d1e18fe
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions processor/src/services/adyen-payment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit d1e18fe

Please sign in to comment.