Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

Commit

Permalink
Adds credit card object
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Oct 21, 2016
1 parent 3708147 commit 9b45366
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions src/CreditCard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

namespace CraigPaul\Moneris;

/**
* CraigPaul\Moneris\CreditCard
*
* @property-read string $expiry
* @property-read string $number
*/
class CreditCard
{
use Gettable;

/**
* @var string
*/
protected $number;

/**
* @var string
*/
protected $expiry;

/**
* @var int
*/
protected $crypt;

/**
* Create a new CreditCard instance.
*
* @param string $number
* @param string $expiry
* @param int $crypt
*
* @return void
*/
public function __construct(string $number, string $expiry, int $crypt = 7)
{
$this->number = $number;
$this->expiry = $expiry;
$this->crypt = $crypt;
}

/**
* Create a new CreditCard instance.
*
* @param string $number
* @param string $expiry
* @param int $crypt
*
* @return $this
*/
public static function create(string $number, string $expiry, int $crypt = 7)
{
return new static($number, $expiry, $crypt);
}
}

0 comments on commit 9b45366

Please sign in to comment.