🎨 Reduce nesting-depth of code

This commit is contained in:
Philipp Stracker 2025-03-05 15:23:25 +01:00
parent 29ad91f515
commit 8cb66440d3
No known key found for this signature in database

View file

@ -78,53 +78,48 @@ class PartnerReferralsData {
__( 'Return to your shop.', 'woocommerce-paypal-payments' ) __( 'Return to your shop.', 'woocommerce-paypal-payments' )
); );
/** $first_party_features = array(
* Returns the partners referrals data. 'PAYMENT',
*/ 'FUTURE_PAYMENT',
return apply_filters( 'REFUND',
'ppcp_partner_referrals_data', 'ADVANCED_TRANSACTIONS_SEARCH',
array( 'VAULT',
'partner_config_override' => array( 'TRACKING_SHIPMENT_READWRITE',
/** );
* Returns the URL which will be opened at the end of onboarding.
*/ $payload = array(
'return_url' => $return_url, 'partner_config_override' => array(
/** 'return_url' => $return_url,
* Returns the description of the URL which will be opened at the end of onboarding. 'return_url_description' => $return_url_label,
*/ 'show_add_credit_card' => true,
'return_url_description' => $return_url_label, ),
'show_add_credit_card' => true, 'products' => $products,
'legal_consents' => array(
array(
'type' => 'SHARE_DATA_CONSENT',
'granted' => true,
), ),
'products' => $products, ),
'legal_consents' => array( 'operations' => array(
array( array(
'type' => 'SHARE_DATA_CONSENT', 'operation' => 'API_INTEGRATION',
'granted' => true, 'api_integration_preference' => array(
), 'rest_api_integration' => array(
), 'integration_method' => 'PAYPAL',
'operations' => array( 'integration_type' => 'FIRST_PARTY',
array( 'first_party_details' => array(
'operation' => 'API_INTEGRATION', 'features' => $first_party_features,
'api_integration_preference' => array( 'seller_nonce' => $this->nonce(),
'rest_api_integration' => array(
'integration_method' => 'PAYPAL',
'integration_type' => 'FIRST_PARTY',
'first_party_details' => array(
'features' => array(
'PAYMENT',
'FUTURE_PAYMENT',
'REFUND',
'ADVANCED_TRANSACTIONS_SEARCH',
'VAULT',
'TRACKING_SHIPMENT_READWRITE',
),
'seller_nonce' => $this->nonce(),
),
), ),
), ),
), ),
), ),
) ),
); );
/**
* Returns the partners referrals data.
*/
return apply_filters( 'ppcp_partner_referrals_data', $payload );
} }
} }