Skip to content
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

PP-11681 Replace 'base-client' with 'axios-base-client' in 'ledger.client' #4187

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

JFSGDS
Copy link
Contributor

@JFSGDS JFSGDS commented Feb 29, 2024

https://payments-platform.atlassian.net/browse/PP-11681

WHAT

  • Change ‘ledger.client’ methods to use ‘axios-base-client’.
  • Refactor call parameters initialisation.
  • Use ‘async/await’ syntax.

HOW

All automated tests should pass without the need to be amended.
Existing functionality should remain unaffected.

@JFSGDS JFSGDS marked this pull request as ready for review March 4, 2024 14:02
Copy link
Contributor

@iqbalgds iqbalgds left a comment

Choose a reason for hiding this comment

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

Looks really - just some minor comments

app/services/clients/ledger.client.js Show resolved Hide resolved
app/services/clients/ledger.client.js Show resolved Hide resolved
@JFSGDS JFSGDS requested a review from iqbalgds March 11, 2024 08:20
}, defaultOptions, options)
return baseClient.get(configuration)
const transactionWithAccountOverride = async function transactionWithAccountOverride (id, options = {}) {
const url = urlJoin(defaultOptions.baseUrl,'/v1/transaction', id)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to add a check as per line 24?
Check if the baseUrl is the default URL / coming from options object.

await ledgerClient.transactionWithAccountOverride('id', { baseUrl: 'https://example.com' })

expect(configureSpy.getCall(0).args[0]).to.equal('http://127.0.0.1:8006/v1/transaction/id?override_account_id_restriction=true')
// expect(configureSpy.getCall(0).args[0]).to.equal('https://example.com/v1/transaction/id?override_account_id_restriction=true')
Copy link
Contributor

Choose a reason for hiding this comment

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

Commented out test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uncommented as suggested.

@JFSGDS JFSGDS marked this pull request as draft March 12, 2024 14:18
iqbalgds
iqbalgds previously approved these changes Mar 12, 2024
Copy link
Contributor

@iqbalgds iqbalgds left a comment

Choose a reason for hiding this comment

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

Good work - would be good to get another set of eyes to check one of these PRs.

Copy link
Contributor

@iqbalgds iqbalgds left a comment

Choose a reason for hiding this comment

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

LGTM - just need to squash commits.

@JFSGDS JFSGDS marked this pull request as ready for review March 27, 2024 11:52
@JFSGDS JFSGDS force-pushed the PP-11681_replace_request_with_axios_ledger_client branch from 4ef4230 to 64a4848 Compare March 27, 2024 12:31
@JFSGDS JFSGDS marked this pull request as draft March 27, 2024 13:23
@JFSGDS JFSGDS force-pushed the PP-11681_replace_request_with_axios_ledger_client branch from 64a4848 to e961cf6 Compare March 27, 2024 13:25
- Change ‘ledger.client’ methods to use ‘axios-base-client’.
- Refactor call parameters initialisation.
- Use ‘async/await’ syntax.
- Use baseUrl from options parameter if present otherwise use default envvar.
@JFSGDS JFSGDS force-pushed the PP-11681_replace_request_with_axios_ledger_client branch from e961cf6 to 4488478 Compare March 27, 2024 13:47
@JFSGDS JFSGDS marked this pull request as ready for review March 27, 2024 14:06
@JFSGDS JFSGDS merged commit 20deff7 into master Mar 27, 2024
12 checks passed
@JFSGDS JFSGDS deleted the PP-11681_replace_request_with_axios_ledger_client branch March 27, 2024 14:07
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.

2 participants