Apply wc_sanitize_phone_number in WC_Gateway_Paypal_Request

This commit is contained in:
Claudio Sanches 2019-03-07 14:08:40 -03:00
parent 82aeb2a7f4
commit e5e64d1618
1 changed files with 1 additions and 1 deletions

View File

@ -216,7 +216,7 @@ class WC_Gateway_Paypal_Request {
* @return array
*/
protected function get_phone_number_args( $order ) {
$phone_number = str_replace( array( '(', '-', ' ', ')', '.' ), '', $order->get_billing_phone() );
$phone_number = wc_sanitize_phone_number( $order->get_billing_phone() );
if ( in_array( $order->get_billing_country(), array( 'US', 'CA' ), true ) ) {
$phone_number = ltrim( $phone_number, '+1' );