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

feat(router): send poll_config in next_action of confirm response for external 3ds flow #4443

Merged
merged 6 commits into from Apr 29, 2024

Conversation

sai-harsha-vardhan
Copy link
Contributor

@sai-harsha-vardhan sai-harsha-vardhan commented Apr 23, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

send poll_config in next_action of confirm response for external 3ds flow

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Tested Manually

  1. Next action block of confirm response for external 3ds flow would contain poll_config (default poll_config is given if it's not set for a connector)
    image

  2. Update the poll_config for a connector
    image

  3. Next action block of confirm response for external 3ds flow would contain updated poll_config
    image

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@sai-harsha-vardhan sai-harsha-vardhan added A-core Area: Core flows C-feature Category: Feature request or enhancement labels Apr 23, 2024
@sai-harsha-vardhan sai-harsha-vardhan added this to the April 2024 milestone Apr 23, 2024
@sai-harsha-vardhan sai-harsha-vardhan self-assigned this Apr 23, 2024
@sai-harsha-vardhan sai-harsha-vardhan requested review from a team as code owners April 23, 2024 14:33
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("The poll config was not found in the DB")?;
let poll_config =
serde_json::from_str::<Option<core_types::PollConfig>>(&poll_config.config)
Copy link
Member

Choose a reason for hiding this comment

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

can you use ParseStruct here? and in other places too where we are doing this for poll config

Narayanbhat166
Narayanbhat166 previously approved these changes Apr 26, 2024
let poll_config = state
.store
.find_config_by_key_unwrap_or(
&format!("poll_config_external_three_ds_{authentication_connector_name}"),
Copy link
Contributor

Choose a reason for hiding this comment

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

If PollConfig is a connector property, This logic can be moved into a impl function in PollConfig.

@@ -592,6 +594,7 @@ where
three_ds_method_data: None,
three_ds_method_url: None,
}),
poll_config: api_models::payments::PollConfigResponse {poll_id: request_poll_id, delay_in_secs: poll_config.delay_in_secs, frequency: poll_config.frequency},
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit pick.
PollConfigResponse can have function named new that would accept poll_id and poll_config and return the constructed PollConfigResponse.

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Apr 29, 2024
Merged via the queue into main with commit c3a1db1 Apr 29, 2024
10 of 12 checks passed
@Gnanasundari24 Gnanasundari24 deleted the send-poll-config-in-next-action-for-external-3ds branch April 29, 2024 06:17
pixincreate added a commit that referenced this pull request Apr 30, 2024
…to-env

* 'main' of github.com:juspay/hyperswitch:
  Refactor(core): remove payment_method_id from RouterData struct (#4485)
  fix(euclid_wasm): connector config wasm metadata update (#4460)
  chore(version): 2024.04.30.0
  feat(user): add single purpose token and auth (#4470)
  feat: stripe connect integration for payouts (#2041)
  feat(router): handle authorization for frictionless flow in external 3ds flow (#4471)
  feat(FRM): Revise post FRM core flows (#4394)
  feat(router): send poll_config in next_action of confirm response for external 3ds flow (#4443)
  chore(version): 2024.04.29.0
  feat(connector): [CRYPTOPAY]  Report underpaid/overpaid amount in outgoing webhooks (#4468)
  feat(users): use cookie for auth (#4434)
  refactor(scheduler): join frequency and count in `RetryMapping` (#4313)
  refactor(required_fields): change required fields for billing address (#4258)
  refactor(access_token): use `merchant_connector_id` for storing access token (#4462)
  chore(version): 2024.04.26.0
  chore(postman): update Postman collection files
pixincreate added a commit that referenced this pull request Apr 30, 2024
* 'main' of github.com:juspay/hyperswitch:
  refactor(cypress): read creds from env instead of hardcoding the path  (#4430)
  ci: fix paypal postman tests (#4501)
  Refactor(core): remove payment_method_id from RouterData struct (#4485)
  fix(euclid_wasm): connector config wasm metadata update (#4460)
  chore(version): 2024.04.30.0
  feat(user): add single purpose token and auth (#4470)
  feat: stripe connect integration for payouts (#2041)
  feat(router): handle authorization for frictionless flow in external 3ds flow (#4471)
  feat(FRM): Revise post FRM core flows (#4394)
  feat(router): send poll_config in next_action of confirm response for external 3ds flow (#4443)
  chore(version): 2024.04.29.0
  feat(connector): [CRYPTOPAY]  Report underpaid/overpaid amount in outgoing webhooks (#4468)
  feat(users): use cookie for auth (#4434)
  refactor(scheduler): join frequency and count in `RetryMapping` (#4313)
  refactor(required_fields): change required fields for billing address (#4258)
  refactor(access_token): use `merchant_connector_id` for storing access token (#4462)
  chore(version): 2024.04.26.0
  chore(postman): update Postman collection files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants