feat(router): collect billing details from wallet connector based on the collect_billing_details_from_wallet_connector
field
#5065
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
We were always passing in some parameters in the wallet session token in order to collect the billing details form the wallet connectors (like google pay and apple pay) always. Instead of collecting it always this feature adds a field (
collect_billing_details_from_wallet_connector
) in the business profile which if set totrue
we will add some fields in the session token to collect the shipping details from the wallet connectors.Reference: #4601
Additional Changes
Motivation and Context
How did you test it?
-> Create a merchant connector account
-> Use the below curl to set the
collect_billing_details_from_wallet_connector
-> Create a payment with confirm false
-> Make a session call for the above payment id and client secret
In the above screenshots we can see that there is no billing details parameter for apple pay and for google pay its set to false as it is
collect_billing_details_from_wallet_connector
is set to false.-> Set the
![image](https://private-user-images.githubusercontent.com/83439957/341508089-07627b75-9162-4e8a-8350-09359a7281de.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ4ODE4NDUsIm5iZiI6MTcyNDg4MTU0NSwicGF0aCI6Ii84MzQzOTk1Ny8zNDE1MDgwODktMDc2MjdiNzUtOTE2Mi00ZThhLTgzNTAtMDkzNTlhNzI4MWRlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI4VDIxNDU0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk0OWU4M2QzNDI2OGQyZGM5MjFhZmQyYmNiNWNjMTZmYTkxMTgyNzg3MzIzYjg1ZDYzYjNlM2I2Mzk0ZTM4NjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.gECautsQOeIn7cfc0MOSLRxucCyOJAQj59rPXhvKJMc)
collect_billing_details_from_wallet_connector
to true-> Create a payment with confirm false and make a session call
![image](https://private-user-images.githubusercontent.com/83439957/341508815-adf90bce-bf83-44d7-9dde-81718c7b989e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ4ODE4NDUsIm5iZiI6MTcyNDg4MTU0NSwicGF0aCI6Ii84MzQzOTk1Ny8zNDE1MDg4MTUtYWRmOTBiY2UtYmY4My00NGQ3LTlkZGUtODE3MThjN2I5ODllLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI4VDIxNDU0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEzODdiNDFhYjJiNzBmZDU3NzkyYTAyYWQ5N2EwMWNmMTM1OTNhYjZiZTVhYTQ5MjhmMGFhZTQwNjhiOTIzNjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.TXGspavb_mcHBUJvC_OXgrj2wAH0fapOO4qzmuyVaRY)
![image](https://private-user-images.githubusercontent.com/83439957/341508924-62a0aa47-20ac-4e8e-a8d9-919f5ec15efe.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ4ODE4NDUsIm5iZiI6MTcyNDg4MTU0NSwicGF0aCI6Ii84MzQzOTk1Ny8zNDE1MDg5MjQtNjJhMGFhNDctMjBhYy00ZThlLWE4ZDktOTE5ZjVlYzE1ZWZlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI4VDIxNDU0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI2M2QzNTY1MWI1MjNkNWUwYzRkY2UxMTVhNDM3YjQ0ZjQyNGYyMTE1MWViNDExYzdjOWJmYTM0ZDk2ODM3MTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.7JhrzbunyzVTXbXhK1k3P4VuKQl2oG2ZOGClUOhW578)
Checklist
cargo +nightly fmt --all
cargo clippy