Skip to content

Commit

Permalink
Merge pull request #881 from woocommerce/fix/coupon-formatting
Browse files Browse the repository at this point in the history
Fix code redeeme methods.
  • Loading branch information
message-dimke authored Jan 11, 2024
2 parents d6b98b5 + 9408b52 commit 53f4ddf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/API/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}

Expand All @@ -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' );
}

Expand Down

0 comments on commit 53f4ddf

Please sign in to comment.