83 - Promoting Charges to Objects

This commit is contained in:
Adam Wathan
2017-03-17 12:19:35 -04:00
parent 442cc3f240
commit 6e983c593c
4 changed files with 50 additions and 8 deletions

23
app/Billing/Charge.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
namespace App\Billing;
class Charge
{
private $data;
public function __construct($data)
{
$this->data = $data;
}
public function amount()
{
return $this->data['amount'];
}
public function cardLastFour()
{
return $this->data['card_last_four'];
}
}