Skip to content

Commit

Permalink
Merge pull request #15 from paynl/feature/PLUG-3869
Browse files Browse the repository at this point in the history
PLUG-3869 - Update to Static functions
  • Loading branch information
woutse authored Oct 16, 2024
2 parents 5ea1a3d + 91b1855 commit 77f6b04
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/DirectDebit.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,29 +102,23 @@ public static function info($mandateId, $referenceId = null)
return new Result\Get($result);
}

public function delete($mandateId)
public static function delete($mandateId)
{
$api = new Api\Delete();
$api->setMandateId($mandateId);

return $api->doRequest();
}

public function update($mandateId, $options)
public static function update($mandateId, $options)
{


if (empty($mandateId)) {
throw new Required('mandateId');
}



$api = new Api\Update();
$api->setMandateId($mandateId);



if (!empty($options['amount'])) {
$api->setAmount(round($options['amount'] * 100));
}
Expand Down Expand Up @@ -183,7 +177,7 @@ public function update($mandateId, $options)
if (!empty($options['extra3'])) {
$api->setExtra3($options['extra3']);
}

return $api->doRequest();
}
}

0 comments on commit 77f6b04

Please sign in to comment.