public function update($priceRuleId, DiscountCode &$discountCode)
    {
        $data = $discountCode->exportData();
        $endpoint = '/admin/price_rules/'.$priceRuleId.'/discount_codes/'.$discountCode->id.'.json';
        $response = $this->request($endpoint, 'PUT', array(
            'discount_code' => $data
        ));
        $discountCode->setData($response['discount_code']);
    }
public function update($priceRuleId, DiscountCode &$discountCode)
    {
        $data = $discountCode->exportData();
        $endpoint = '/admin/price_rules/'.$priceRuleId.'/discount_codes/'.$discountCode->id.'.json';
        $response = $this->request($endpoint, 'PUT', array(
            'discount_code' => $data
        ));
        $discountCode->setData($response['discount_code']);
    }
public function update ( $ priceRuleId , DiscountCode & $ discountCode ) { $ data = $ discountCode -> exportData ( ) ; $ endpoint = '/admin/price_rules/' . $ priceRuleId . '/discount_codes/' . $ discountCode -> id . '.json' ; $ response = $ this -> request ( $ endpoint , 'PUT' , array ( 'discount_code' => $ data ) ) ; $ discountCode -> setData ( $ response [ 'discount_code' ] ) ; }
Update a Discount Code
@param  integer       $priceRuleId
@param  DiscountCode $discountCode
@return void
Update a Discount Code