Skip to content

when recipient is found in trolley, update referenceId #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/api/payment-providers/trolley.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ export class TrolleyService {
// make sure it's same email address
foundRecipient[0].email === user.email
) {
if (foundRecipient[0].referenceId !== user.id) {
await this.trolley.client.recipient.update(foundRecipient[0].id, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding error handling for the update method. If the update fails, it might be useful to log the error or handle it in some way to ensure the application can respond appropriately.

referenceId: user.id,
});
}

return foundRecipient[0];
}

Expand Down