-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(core): added customer phone_number and email to session token response for click to pay #6863
base: main
Are you sure you want to change the base?
feat(core): added customer phone_number and email to session token response for click to pay #6863
Conversation
…sponse for click to pay
Changed Files
|
crates/router/src/core/payments.rs
Outdated
customer_details.phone_country_code.as_ref(), | ||
) { | ||
(Some(_), Some(_)) => Ok(()), | ||
(None, None) => Err(errors::ApiErrorResponse::MissingRequiredFields { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we should be mentioning in the error that, either email or phone number is required for ctp flow. So, that merchant would do the integration accordingly right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, will add another level of error check
…se' of https://github.com/juspay/hyperswitch into 7863-add-email-and-phone-number-to-session-token-response
crates/api_models/src/payments.rs
Outdated
@@ -6997,6 +6997,10 @@ pub struct ClickToPaySessionResponse { | |||
pub transaction_amount: StringMajorUnit, | |||
#[schema(value_type = Currency)] | |||
pub transaction_currency_code: common_enums::Currency, | |||
pub phone_number: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we wrap this within a Secret
?
.customer_details | ||
.as_ref() | ||
.map(|details| { | ||
serde_json::from_value::<CustomerData>(details.clone().into_inner().expose()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: We can call parse_value()
here.
Type of Change
Description
Add customer phone_number and email to session token response for click to pay
How did you test it?
Add Ctp_mastercard as a connector and send relevant details to ctp in connector metadata
update business profile with
Do payments create with customer details
Look for customer details in click to pay session response
Response
Checklist
cargo +nightly fmt --all
cargo clippy