Set order phone number if exists in request

This commit is contained in:
dinamiko 2022-08-09 12:23:24 +02:00
parent b57567cf84
commit 93b483f9e1

View file

@ -215,6 +215,12 @@ class PayUponInvoiceGateway extends WC_Payment_Gateway {
}
}
$phone_number = filter_input( INPUT_POST, 'billing_phone', FILTER_SANITIZE_STRING ) ?? '';
if ( $phone_number ) {
$wc_order->set_billing_phone( $phone_number );
$wc_order->save();
}
$wc_order->update_status( 'on-hold', __( 'Awaiting Pay upon Invoice payment.', 'woocommerce-paypal-payments' ) );
$purchase_unit = $this->purchase_unit_factory->from_wc_order( $wc_order );
$payment_source = $this->payment_source_factory->from_wc_order( $wc_order, $birth_date );