🎨 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,20 +78,18 @@ class PartnerReferralsData {
__( 'Return to your shop.', 'woocommerce-paypal-payments' )
);
/**
* Returns the partners referrals data.
*/
return apply_filters(
'ppcp_partner_referrals_data',
array(
$first_party_features = array(
'PAYMENT',
'FUTURE_PAYMENT',
'REFUND',
'ADVANCED_TRANSACTIONS_SEARCH',
'VAULT',
'TRACKING_SHIPMENT_READWRITE',
);
$payload = array(
'partner_config_override' => array(
/**
* Returns the URL which will be opened at the end of onboarding.
*/
'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,
),
@ -110,21 +108,18 @@ class PartnerReferralsData {
'integration_method' => 'PAYPAL',
'integration_type' => 'FIRST_PARTY',
'first_party_details' => array(
'features' => array(
'PAYMENT',
'FUTURE_PAYMENT',
'REFUND',
'ADVANCED_TRANSACTIONS_SEARCH',
'VAULT',
'TRACKING_SHIPMENT_READWRITE',
),
'features' => $first_party_features,
'seller_nonce' => $this->nonce(),
),
),
),
),
),
)
);
/**
* Returns the partners referrals data.
*/
return apply_filters( 'ppcp_partner_referrals_data', $payload );
}
}