Slide 22
Slide 22 text
Demo: Money Transfer
class AccountActivity implements AccountInterface
{
public function deposit(string $accountId, string $referenceId, int $amountCents): void
{
$this->log(
"Withdraw to %s of %d cents requested. ReferenceId=%s\n",
$accountId,
$amountCents,
$referenceId
);
// throw new \RuntimeException("simulated"); // Uncomment to simulate failure
}
public function withdraw(string $accountId, string $referenceId, int $amountCents): void
{
$this->log(
"Deposit to %s of %d cents requested. ReferenceId=%s\n",
$accountId,
$amountCents,
$referenceId
);
}
}