/**
* Update existing billing agreement at paypal
* @param $agreementId
* @param array $params
* @return bool
* @internal param object $createdAgreement Agreement
*/
function update($agreementId, $params)
{
$patch = new Patch();
$patch->setOp('replace')->setPath('/')->setValue($params);
$patchRequest = new PatchRequest();
$patchRequest->addPatch($patch);
try {
$agreement = Agreement::get($agreementId, $this->getAdapter()->getApiContext());
$agreement->update($patchRequest, $this->getAdapter()->getApiContext());
} catch (\Exception $ex) {
//@todo add some logging
}
return true;
}