-
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(payment_methods): pass required shipping details field for wallets session call based on business_profile
config
#4616
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…/juspay/hyperswitch into apple_pay/billing-dynamic-fields
…/juspay/hyperswitch into apple_pay/shipping-dynamic-fields
ShankarSinghC
changed the title
feat(payment_methods): pass field in apple pay session call based on
feat(payment_methods): pass required shipping details field for wallets session call based on May 10, 2024
business_profile
configbusiness_profile
config
…l based on business_profile config
…m/juspay/hyperswitch into apple_pay/shipping-dynamic-fields
…usiness profile config
…/juspay/hyperswitch into apple_pay/billing-dynamic-fields
…ng-dynamic-fields
…ng-dynamic-fields
…le_pay/billing-dynamic-fields
…ng-dynamic-fields
…m/juspay/hyperswitch into apple_pay/shipping-dynamic-fields
Comment on lines
+2240
to
+2256
// Remove shipping fields from required fields based on business profile configuration | ||
if should_send_shipping_details != Some(true) { | ||
let shipping_variants = | ||
api_enums::FieldType::get_shipping_variants(); | ||
|
||
let keys_to_be_removed = required_fields_hs | ||
.iter() | ||
.filter(|(_key, value)| { | ||
shipping_variants.contains(&value.field_type) | ||
}) | ||
.map(|(key, _value)| key.to_string()) | ||
.collect::<Vec<_>>(); | ||
|
||
keys_to_be_removed.iter().for_each(|key_to_be_removed| { | ||
required_fields_hs.remove(key_to_be_removed); | ||
}); | ||
} |
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.
instead of removing the fields, we can extend the required fields based on the config
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, I will take this up in next pr.
Narayanbhat166
approved these changes
May 14, 2024
prajjwalkumar17
approved these changes
May 14, 2024
srujanchikke
approved these changes
May 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
This change is required as part of the one click checkout where in which we expect apple pay to collect the shipping details from the customer and pass it in the confirm call with the payment_data.
In order for apple pay to collect the shipping details from customer we need to pass
"requiredShippingContactFields": ["postalAddress", "phone", "email"]
in the/session
call. Hence we need to have a validation in the backend that checks for the business profile config (collect_shipping_details_from_wallet_connector
) fields and pass therequired_shipping_contact_fields
to sdk.Similarly for google_pay we need to pass the below fields for shipping details.
Additional Changes
-> Create a MCA for cybersource enable
google_pay
andapple_pay
-> Update a field in
business_profile
-> Apple pay payment create with confirm false
-> Make a
/session
callRequired shipping details set for
apple_pay
in the session callRequired shipping details set for
google_pay
in the session callList payment method list for merchant
Motivation and Context
How did you test it?
Checklist
cargo +nightly fmt --all
cargo clippy