better-payment / bp-plugin-shopware6-api2

Shopware 6 Plugin for Better Payment API2
Other
0 stars 0 forks source link

[FIX] Do not collect and pass DOB and Gender when customer is commercial #42

Closed gadimbaylisahil closed 1 year ago

gadimbaylisahil commented 1 year ago

Description

When the payer is commercial/company, Gender and Birth Date should NOT be passed to the API. It should not be collected from the customers as well.

Problems

When we turn on collect DOB in the configuration settings, we mutate the global flag. We have to find a way/workaround for this to control this in checkout page.

Same for gender...

hasanzade-hasan commented 1 year ago

This will be handled using JS DOM elements. Since Gender is custom field added by us, it is easier to handle as no backend validation exists. But in birthday field when we require birthday using global system flag it also enables backend validation. Bypassing front-end validation by removing element and making it not required is not enough. I suggest not to enable birthday required flag at all. During registration when it is selected Private as account type, we make it appear in DOM and be required using JS.

@gadimbaylisahil if you agree, I change implementation that way.

gadimbaylisahil commented 1 year ago

@hasanzade-hasan

Sounds good 👍🏻