From 05b4baec15c36da3c68621b96c32e6e1ef18a424 Mon Sep 17 00:00:00 2001
From: Philipp Stracker
Date: Wed, 5 Mar 2025 17:26:43 +0100
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20the=20partner-referral=20p?=
=?UTF-8?q?ayload=20to=20pass=20tests?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ppcp-api-client/src/Repository/PartnerReferralsData.php | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/modules/ppcp-api-client/src/Repository/PartnerReferralsData.php b/modules/ppcp-api-client/src/Repository/PartnerReferralsData.php
index 4ed43b2ee..01a91f9b6 100644
--- a/modules/ppcp-api-client/src/Repository/PartnerReferralsData.php
+++ b/modules/ppcp-api-client/src/Repository/PartnerReferralsData.php
@@ -142,6 +142,11 @@ class PartnerReferralsData {
*/
$payload = apply_filters( 'ppcp_partner_referrals_data', $payload );
+ // An empty array is not permitted.
+ if ( isset( $payload['capabilities'] ) && ! $payload['capabilities'] ) {
+ unset( $payload['capabilities'] );
+ }
+
// Add the nonce in the end, to maintain backwards compatibility of filters.
$payload['partner_config_override']['return_url'] = add_query_arg(
array( 'ppcpToken' => $onboarding_token ),