<?php

namespace Ezypay\Object;

/**
 * Class Payment
 * @package Ezypay\Object
 */
class Payment
{
    /**
     * @var $paymentNumber integer The running number of the payment.
     */
    private $paymentNumber;
    /**
     * @var  $paymentMethod  array PaymentMethodResult The payment method of the invoice
     */
    private $paymentMethod;
    /**
     * @var $paymentDate string The date payment is made.
     */
    private $paymentDate;
    /**
     * @var $amount number The amount made in this payment.
     */
    private $amount;
    /**
     * @var $status string The status of this payment.
     */
    private $status;
    /**
     * @var $failedPaymentReason array FailedPaymentReasonResult The reason for failed payment made if any.
     */
    private $failedPaymentReason;
    /**
     * @var $transactionType string To identify if the transaction is meant for collecting a payment or making a refund to the customer. returns Refund or Payment
     */
    private $transactionType;
    /**
     * @var $invoiceNumber integer The running number of the invoice.
     */
    private $invoiceNumber;
    /**
     * @var $invoiceId string The ID of the invoice. A unique identifier generated by the system.
     */
    private $invoiceId;
    /**
     * @var $customerId string The ID of the customer.
     */
    private $customerId;
    /**
     * @var $paymentSource string The source of this payment. Can be DirectDebit or PayMeToday or ImmediatePayment or OfflinePayment
     */
    private $paymentSource;
    /**
     * @var $createdOn string Date record is created.
     */
    private  $createdOn;

    /**
     * Payment constructor.
     * @param $data array
     */
    public function __construct($data)
    {
        foreach ( $data as $key => $value ){
            $this->$key = $value;
        }
    }

}
