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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxMDcyNTksIm5iZiI6MTcyMDEwNjk1OSwicGF0aCI6Ii84MzQzOTk1Ny8zNDE1MDgwODktMDc2MjdiNzUtOTE2Mi00ZThhLTgzNTAtMDkzNTlhNzI4MWRlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA0VDE1MjkxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRlYzY3MTNlY2ZiM2RjZTdhODk0ODVmMGI1MjJmMTQwNTFlZWQwZWE2YWY4ZjA4MDNjZTI1ZDFhM2U0Yjk5OGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.d2Rv6IPfGLfpE3jTimkwQRnf86WlWfnBLoytu42P-7E)
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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxMDcyNTksIm5iZiI6MTcyMDEwNjk1OSwicGF0aCI6Ii84MzQzOTk1Ny8zNDE1MDg4MTUtYWRmOTBiY2UtYmY4My00NGQ3LTlkZGUtODE3MThjN2I5ODllLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA0VDE1MjkxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE5YWE5NWViYWNmZDk1NDAzNmE1MjFiNzZlZDZlYTM1YWMyMjJmOWY2ZGFhMzM3ZTUwMTIzMzg5NmE3M2MzZTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.I5TQ4-v4XKUmBU-tqxKF4FX5AxYaedIu5bzMBHv4KkA)
![image](https://private-user-images.githubusercontent.com/83439957/341508924-62a0aa47-20ac-4e8e-a8d9-919f5ec15efe.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxMDcyNTksIm5iZiI6MTcyMDEwNjk1OSwicGF0aCI6Ii84MzQzOTk1Ny8zNDE1MDg5MjQtNjJhMGFhNDctMjBhYy00ZThlLWE4ZDktOTE5ZjVlYzE1ZWZlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA0VDE1MjkxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEzYmY1NDQyYWVlMDFiMjU2NTc0NmFjY2ZiNDZmMjExYTk1YmQ2MmY3YzVlMTgxNjdmYzNiOTk0YWFjZGQ0MzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.8Tug72Sk5CmSaioK4Thf7wQdxYyqzNrZozBo5HCx8B4)
Checklist
cargo +nightly fmt --all
cargo clippy