feat(core): populate connector raw response and connector_response_reference_id for razorpay#8499
feat(core): populate connector raw response and connector_response_reference_id for razorpay#8499Gnanasundari24 merged 9 commits intomainfrom
Conversation
crates/api_models/src/payments.rs
Outdated
| pub merchant_reference_id: Option<id_type::PaymentReferenceId>, | ||
|
|
||
| /// Contains whole connector response | ||
| pub whole_connector_response: Option<String>, |
There was a problem hiding this comment.
Wouldn't raw_connector_response be more appropriate name for this?
There was a problem hiding this comment.
Can we change this to be a Secret, if this would contain sensitive information?
crates/router/src/core/payments/operations/payment_confirm_intent.rs
Outdated
Show resolved
Hide resolved
crates/api_models/src/payments.rs
Outdated
| pub merchant_reference_id: Option<id_type::PaymentReferenceId>, | ||
|
|
||
| /// Contains whole connector response | ||
| pub whole_connector_response: Option<String>, |
There was a problem hiding this comment.
Can we change this to be a Secret, if this would contain sensitive information?
AnuthaDev
left a comment
There was a problem hiding this comment.
payment_method specific changes look fine
| pub merchant_connector_creds: common_utils::pii::SecretSerdeValue, | ||
| } | ||
|
|
||
| /// Connector Response Data that are required to be populated in response |
There was a problem hiding this comment.
| /// Connector Response Data that are required to be populated in response | |
| /// Connector Response Data that are required to be populated in response, but not persisted in DB. |
| token_details.get_connector_token_request_reference_id() | ||
| }), | ||
| ), | ||
|
|
There was a problem hiding this comment.
Why are we populating this in setup mandate flow?
| business_profile: &domain::Profile, | ||
| header_payload: hyperswitch_domain_models::payments::HeaderPayload, | ||
| all_keys_required: Option<bool>, | ||
| return_raw_connector_response: Option<bool>, |
There was a problem hiding this comment.
You can get this value from RouterData. ie Self.
There was a problem hiding this comment.
Can be taken up in a separate PR.
| .connector_request_reference_id | ||
| .clone(); | ||
|
|
||
| let connector_response_reference_id = payment_data |
There was a problem hiding this comment.
Can you please add a comment over this as to why this is being done.
There was a problem hiding this comment.
All these unresolved comments will be taken up in a separate PR.
#8565
Type of Change
Description
This PR populates raw_connector_response for Payments when return_raw_connector_response is set to True. It also changes Payments Create and Psync endpoint for Razorpay connector.
Additional Changes:
all_keys_requiredasreturn_raw_connector_response,get_all_keys_required()asshould_return_raw_response(),whole_connector_responseasraw_connector_response. This rename is applied only on v2 Api and core flows to retain backward compatibility at v1.get_whole_connector_response()andget_all_keys_required()at OperationSessionGetters are marked under v1 featureconnector_response_reference_idis updated in Payment_attempt at both update_trackers and post_update_trackers for v2. This is included in update_trackers in cases where Authorize flow is not performed at Connector EndAdditional Changes
Motivation and Context
How did you test it?
Response
Response
Checklist
cargo +nightly fmt --allcargo clippy