Fix change payment check to not conflict with Pay Now

This commit is contained in:
Alex P 2021-11-12 18:29:30 +02:00
parent ebe1e84907
commit 1f8b449e38

View file

@ -58,8 +58,8 @@ trait ProcessPaymentTrait {
* If customer has chosen a saved credit card payment.
*/
$saved_credit_card = filter_input( INPUT_POST, 'saved_credit_card', FILTER_SANITIZE_STRING );
$pay_for_order = filter_input( INPUT_GET, 'pay_for_order', FILTER_SANITIZE_STRING );
if ( $saved_credit_card && ! isset( $pay_for_order ) ) {
$change_payment = filter_input( INPUT_GET, 'woocommerce_change_payment', FILTER_SANITIZE_STRING );
if ( $saved_credit_card && ! isset( $change_payment ) ) {
$user_id = (int) $wc_order->get_customer_id();
$customer = new \WC_Customer( $user_id );