<?php
namespace App\Amadeus\StructureParser\Types;

/**
 * A component used by \App\Amadeus\StructureParser\Types\FormOfPayment
 * @author Lucian Sirbu
 */
class FormOfPaymentComponentCC extends FormOfPaymentComponent
{
	public $companyIndicator = 	null;
	public $number = 			null;
	public $expiryDate = 		null;
	public $approvalCode = 		null;
	public $invoiceNo = 		null;

	/**
	 * Set ccExpiryDate
	 *
	 * @param string $ccExpiryDate
	 * @return $this
	 */
	public function setCcExpiryDate(?string $ccExpiryDate): self
	{
		if ($ccExpiryDate) {
			$this->expiryDate = \Engine\DateTime::createFromIsoDate($ccExpiryDate)->format("Y-m-t");
		}
		else {
			$this->expiryDate = null;
		}

		return $this;
	}

}
