Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
174 stars 69 forks source link

Set support phone number's initial value from onboarding phone number #9556

Open anu-rock opened 2 weeks ago

anu-rock commented 2 weeks ago

Description

The support phone number field on the Payment settings page defaults to empty for newly onboarded accounts. When the merchant does not provide its value, support requests are routed to the platform's support phone number which leads to issues described at pbUcTB-5ch-p2

Image

Acceptance criteria

Set this field using the phone number entered on the onboarding form.

Image

Dev notes

See my comment at pbUcTB-5ch-p2#comment-11620.

dpaun1985 commented 4 days ago

After checking it,it appears that we cannot use individual phone. When fetching the account, the individual field is available in very specific situations - when business_type is individual and controller.requirement_collection is application. In our case, requirement_collection is stripe

Information about the person represented by the account. This property is null unless business_type is set to individual. After you create an Account Link or Account Session, this property is only returned for accounts where controller.requirement_collection is application, which includes Custom accounts.

More details are available here

I think we can close this issue. cc @anu-rock

aheckler commented 4 days ago

I think we can close this issue.

IMHO we shouldn't do this without some sort of solution, or else the issues in pbUcTB-5ch-p2 will persist. :( We need to find a way to make it mandatory to add a support phone, even if we can't use the phone number new merchants are entering during onboarding.

dpaun1985 commented 4 days ago

as @timmy5685 mentioned in pbUcTB-5ch-p2#comment-11615 , an easy way to prevent merchants from saving changes to their settings until they provide that number. wdyt ? cc @timmy5685 @anu-rock

anu-rock commented 4 days ago

@dpaun1985 Are you proposing to make the support phone field on the Settings page mandatory? It would seem that was @timmy5685's suggestion in case his preferred solution didn't work out.

dpaun1985 commented 3 days ago

@dpaun1985 Are you proposing to make the support phone field on the Settings page mandatory? It would seem that was @timmy5685's suggestion in case his preferred solution didn't work out.

Indeed. I would go with @timmy5685's suggestion, to make the support phone field mandatory.

timmy5685 commented 3 days ago

@dpaun1985 - looking at the docs - it appears that each business type object has a phone number. Can we detect the type and pull the phone number from the relevant object? i.e. if individual - use individual.phone, if company - use company.phone

I would still suggest making the phone number mandatory in settings so they can't remove it (or if for some reason they are missing a phone number on their respective object) but would be great if we could implement conditional logic based on business type.

dpaun1985 commented 2 days ago

@dpaun1985 - looking at the docs - it appears that each business type object has a phone number. Can we detect the type and pull the phone number from the relevant object? i.e. if individual - use individual.phone, if company - use company.phone

According to the docs, company or individual fields are returned only if controller.requirement_collection is set to application . In our case, requirement_collection is set to stripe. controller.requirement_collection - indicates responsibility for collecting requirements on this account.