mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
Consolidate conditional
This commit is contained in:
parent
28d7e5d771
commit
03fa159b43
1 changed files with 8 additions and 8 deletions
|
@ -145,15 +145,15 @@ class VaultedCreditCardHandler {
|
|||
): WC_Order {
|
||||
|
||||
$change_payment = filter_input( INPUT_POST, 'woocommerce_change_payment', FILTER_SANITIZE_STRING );
|
||||
if ( $change_payment ) {
|
||||
if ( $this->subscription_helper->has_subscription( $wc_order->get_id() ) && $this->subscription_helper->is_subscription_change_payment() ) {
|
||||
if ( $saved_credit_card ) {
|
||||
if (
|
||||
$change_payment
|
||||
&& $this->subscription_helper->has_subscription( $wc_order->get_id() )
|
||||
&& $this->subscription_helper->is_subscription_change_payment()
|
||||
&& $saved_credit_card
|
||||
) {
|
||||
update_post_meta( $wc_order->get_id(), 'payment_token_id', $saved_credit_card );
|
||||
|
||||
return $wc_order;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tokens = $this->payment_token_repository->all_for_user_id( $wc_order->get_customer_id() );
|
||||
$selected_token = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue