Skip to content

Conversation

@xlisachan
Copy link
Contributor

Because

  • PaypalCustomerMultipleRecordsError was being thrown if there were multiple records when it should only throw if there are multiple active records

This pull request

  • returns the billing agreement ID of the active record and throws when there are multiple active records

Issue that this pull request solves

Closes: FXA-11772

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.

@xlisachan xlisachan requested a review from a team as a code owner June 3, 2025 15:11
const paypalCustomer =
await this.paypalCustomerManager.fetchPaypalCustomersByUid(uid);
const firstRecord = paypalCustomer.at(0);
const activeRecords: ResultPaypalCustomer[] = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

this feels like a good place for filtering the original list const activeRecords = paypalCustomer.filter(customer => record.status === 'active')

Copy link
Contributor

@david1alvarez david1alvarez left a comment

Choose a reason for hiding this comment

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

r+wc, non-blocking

…heir saved PayPal account

Because
- PaypalCustomerMultipleRecordsError was being thrown if there were multiple records when it should only throw if there are multiple active records

This pull request
- returns the billing agreement ID of the active record and throws when there are multiple active records

Closes: FXA-11772
@xlisachan xlisachan merged commit eed4b3c into main Jun 3, 2025
19 checks passed
@xlisachan xlisachan deleted the FXA-11772 branch June 3, 2025 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants