refactor(required_fields): change required fields for billing address
Type of Change
- [x] Refactoring
Description
This PR changes the dynamic fields to collect card_holder_name as payment_method_data.billing.first_name and payment_method_data.billing.last_name. Backwards compatibility has been provided, so if card_holder_name is passed, then it will override the payment_method_data.billing.first_name and payment_method_data.billing.last_name passed in billing details.
All the required fields for billing details are changed to be collected as payment_method_data.billing
Additional Changes
- [x] This PR modifies the API contract
The billing details will now be collected in payment_method_billing.
Motivation and Context
Standardise the way in which to collect billing details.
How did you test it?
-
Create a payment via sdk ( use bambora connector, as
card_holder_nameis a required field ) -
Check the /confirm call and confirm if card holder name is passed in billing details along with other billing fields.
Checklist
- [x] I formatted the code
cargo +nightly fmt --all - [x] I addressed lints thrown by
cargo clippy - [x] I reviewed the submitted code