mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
Consolidate conditional
This commit is contained in:
parent
3b639233e3
commit
d3b319ab11
1 changed files with 21 additions and 21 deletions
|
@ -101,9 +101,11 @@ class SubscriptionModule implements ModuleInterface {
|
|||
'ppcp_create_order_request_body_data',
|
||||
function( array $data ) use ( $c ) {
|
||||
$wc_order_action = filter_input( INPUT_POST, 'wc_order_action', FILTER_SANITIZE_STRING ) ?? '';
|
||||
if ( $wc_order_action === 'wcs_process_renewal' ) {
|
||||
if ( isset( $data['payment_source']['token'] ) && $data['payment_source']['token']['type'] === 'PAYMENT_METHOD_TOKEN' ) {
|
||||
if ( isset( $data['payment_source']['token']['source']->card ) ) {
|
||||
if (
|
||||
$wc_order_action === 'wcs_process_renewal'
|
||||
&& isset( $data['payment_source']['token'] ) && $data['payment_source']['token']['type'] === 'PAYMENT_METHOD_TOKEN'
|
||||
&& isset( $data['payment_source']['token']['source']->card )
|
||||
) {
|
||||
$renewal_order_id = absint( $data['purchase_units'][0]['custom_id'] );
|
||||
$subscriptions = wcs_get_subscriptions_for_renewal_order( $renewal_order_id );
|
||||
$subscriptions_values = array_values( $subscriptions );
|
||||
|
@ -124,8 +126,6 @@ class SubscriptionModule implements ModuleInterface {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue