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-11638 Add wallet path param for logging #3768

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

stephencdaly
Copy link
Contributor

@stephencdaly stephencdaly commented Nov 13, 2023

Relying on getting the wallet_type from the charge when handling the authorisation result isn't reliable - as connector can return a response before it has completed authorisation, in which case the wallet_type is not present.

So stop logging the wallet from the wallet_type on the charge from connector, as we can't rely on it consistently being there.

Instead, add the wallet type as a path parameter for the /handle-payment-response/:chargeId path, and pass in this wallet type when passing the redirect URL back to the client-side JS in payment-auth-request.controller.js. We will use this for logging in handle-auth-response.controller.js.

For now, also support the old URL without the wallet as a path parameter so we don't break in-flight payments. Support for this will be removed as a follow-up commit. We will also the logging of the wallet type in this follow-up commit. We can't add this yet, as the path parameter will not be present for in-flight payments when this change is deployed.

Rename some path params from provider -> wallet to avoid confusion with payment provider.

Notes for reviewer

I have manually tested this locally to be sure that an in-flight walley payment that sends the user to the old /handle-payment-response/:chargeId route will still work, as well as a payment sending the user to the new /handle-payment-response/:wallet/:chargeId route

Relying on getting the wallet_type from the charge when handling the
authorisation result isn't reliable - as connector can return a
response before it has completed authorisation, in which case the
wallet_type is not present.

So stop logging the `wallet` from the `wallet_type` on the charge from
connector, as we can't rely on it consistently being there.

Instead, add the wallet type as a path parameter for the
/handle-payment-response/:chargeId path, and pass in this wallet type
when passing the redirect URL back to the client-side JS in
`payment-auth-request.controller.js`. We will use this for logging in
`handle-auth-response.controller.js`.

For now, also support the old URL without the wallet as a path
parameter so we don't break in-flight payments. Support for this will
be removed as a follow-up commit. We will also the logging of the
wallet type in this follow-up commit. We can't add this yet, as the
path parameter will not be present for in-flight payments when this
change is deployed.

Rename some path params from `provider` -> `wallet` to avoid confusion
with payment provider.
Copy link
Contributor

@james-peacock-gds james-peacock-gds left a comment

Choose a reason for hiding this comment

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

LGTM

@stephencdaly stephencdaly merged commit c4ca3a4 into master Nov 14, 2023
@stephencdaly stephencdaly deleted the PP-11638-add-new-path-with-wallet-path-param branch November 14, 2023 11:53
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