Skip to content

Commit

Permalink
Set transaction details in abstract method customer - address - items
Browse files Browse the repository at this point in the history
  • Loading branch information
shabayekdes committed Dec 6, 2021
1 parent f1c66da commit 7dae66d
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions src/Drivers/Method.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace Shabayek\Payment\Drivers;

use Shabayek\Payment\Contracts\AddressContract;
use Shabayek\Payment\Contracts\CustomerContract;

/**
* Method abstract class
* @package Shabayek\Payment\Drivers
Expand All @@ -14,6 +17,30 @@ abstract class Method
* @var int|float
*/
protected $amount = 0;
/**
* Transaction id
*
* @var int
*/
protected $transaction_id;
/**
* Customer details
*
* @var CustomerContract
*/
protected $customer;
/**
* Address details
*
* @var AddressContract
*/
protected $address;
/**
* Items details
*
* @var array
*/
public $items = [];
/**
* payment config
*
Expand Down Expand Up @@ -51,6 +78,54 @@ public function amount($amount)

return $this;
}
/**
* Set transaction id.
*
* @param $transaction
* @return $this
*/
public function transaction($transaction)
{
$this->transaction_id = $transaction;

return $this;
}
/**
* Set customer details.
*
* @param CustomerContract $customer
* @return void
*/
public function customer(CustomerContract $customer)
{
$this->customer = $customer->customerDetails();

return $this;
}
/**
* Set address details.
*
* @param AddressContract $address
* @return void
*/
public function address(AddressContract $address)
{
$this->address = $address;

return $this;
}
/**
* Set items
*
* @param array $item
* @return void
*/
public function items(array $item)
{
$this->items[] = $item;

return $this;
}
/**
* @return mixed
*/
Expand Down

0 comments on commit 7dae66d

Please sign in to comment.