From 9408b5290612fa7149ea4a32e8a91c77ec80a578 Mon Sep 17 00:00:00 2001 From: Bartosz Budzanowski Date: Thu, 11 Jan 2024 19:43:02 +0100 Subject: [PATCH] Fix code redeme methods. --- src/API/Base.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/API/Base.php b/src/API/Base.php index d2a0d03ee..376b95ec1 100644 --- a/src/API/Base.php +++ b/src/API/Base.php @@ -785,8 +785,7 @@ public static function get_advertiser_billing_profile( $advertiser_id ) { * @return mixed */ public static function redeem_ads_offer_code( $advertiser_id, $offer_code ) { - $request_url = "advertisers/{$advertiser_id}/marketing_offer/{$offer_code}/redeem"; - $request_url = add_query_arg( 'is_encoded', 'true', $request_url ); + $request_url = "advertisers/{$advertiser_id}/marketing_offer/{$offer_code}/redeem?is_encoded=true"; return self::make_request( $request_url, 'POST', array(), 'ads' ); } @@ -799,9 +798,7 @@ public static function redeem_ads_offer_code( $advertiser_id, $offer_code ) { * @return mixed */ public static function validate_ads_offer_code( $advertiser_id, $offer_code ) { - $url = "advertisers/{$advertiser_id}/marketing_offer/{$offer_code}/redeem"; - $url = add_query_arg( 'validate_only', 'true', $url ); - + $url = "advertisers/{$advertiser_id}/marketing_offer/{$offer_code}/redeem?validate_only=true"; return self::make_request( $url, 'POST', array(), 'ads' ); }