SevenShores\Hubspot\Resources\Deals::update PHP Method

update() public method

public update ( integer $id, array $deal ) : mixed
$id integer The deal id.
$deal array The deal properties to update.
return mixed
    function update($id, array $deal)
    {
        $endpoint = "https://api.hubapi.com/deals/v1/deal/{$id}";
        $options['json'] = $deal;
        return $this->client->request('put', $endpoint, $options);
    }

Usage Example

Example #1
0
 /**
  * @test
  */
 public function update()
 {
     $response = $this->createDeal();
     $id = $response->dealId;
     $response = $this->deals->update($id, ["properties" => [["name" => "amount", "value" => "70000"]]]);
     $this->assertEquals(200, $response->getStatusCode());
     $this->assertSame('70000', $response['properties']['amount']['value']);
 }