Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #32 from CarltonSoftware/develop
Browse files Browse the repository at this point in the history
2/4 release
  • Loading branch information
Alex Wyett authored Apr 2, 2019
2 parents ea1ef24 + fa2df2a commit b2cec60
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/tabs/apiclient/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,8 @@ public function toArray()
$arr['address_county'] = $this->getAddress()->getCounty();
$arr['address_postcode'] = $this->getAddress()->getPostcode();
$arr['address_countryalpha2code'] = $this->getAddress()->getCountry()->getAlpha2();
$arr['address_latitude'] = $this->getAddress()->getLongitude();
$arr['address_longitude'] = $this->getAddress()->getLatitude();
$arr['address_latitude'] = $this->getAddress()->getLatitude();
$arr['address_longitude'] = $this->getAddress()->getLongitude();
}

return $arr;
Expand Down
2 changes: 1 addition & 1 deletion src/tabs/apiclient/SagePayPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public function create()
$id = self::getRequestId($req);
if ($id) {
$this->setId(
(integer) $id
$id
);
}

Expand Down
51 changes: 28 additions & 23 deletions src/tabs/apiclient/booking/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,69 +15,56 @@
* @version Release: 1
* @link http://www.carltonsoftware.co.uk
*
* @method Payment setAmount(float $var) Sets the amount
*
* @method Payment setType(string $var) Sets the type
*
* @method Payment setPaymentdatetime(\DateTime $var) Sets the paymentdatetime
*
* @method Payment setBookingamount(float $var) Sets the bookingamount
*
* @method Payment setAmount(float $var) Sets the amount
* @method Payment setType(string $var) Sets the type
* @method Payment setPaymentdatetime(\DateTime $var) Sets the paymentdatetime
* @method Payment setBookingamount(float $var) Sets the bookingamount
* @method Payment setSecuritydepositamount(float $var) Sets the securitydepositamount
*
* @method Payment setDonotconfirmbooking(boolean $var) Sets the donotconfirmbooking
*
* @method Actor getActor() Get the actor
*/
class Payment extends Builder
{
/**
* Amount
*
* @var float
*/
protected $amount = 0;

/**
* Type
*
* @var string
*/
protected $type = 'Booking';

/**
* Paymentdatetime
*
* @var \DateTime
*/
protected $paymentdatetime;

/**
* Bookingamount
*
* @var float
*/
protected $bookingamount;

/**
* Securitydepositamount
*
* @var float
*/
protected $securitydepositamount;

/**
* Transferbooking
*
* @var \tabs\apiclient\Booking
*/
protected $transferbooking;

/**
* Donotconfirmbooking
*
* @var boolean
*/
protected $donotconfirmbooking = false;

/**
* @var \tabs\apiclient\Actor
*/
protected $actor;

// -------------------- Public Functions -------------------- //

Expand All @@ -103,6 +90,20 @@ public function setTransferbooking($transferbooking)

return $this;
}

/**
* Set the actor paying responsible for paying for this booking
*
* @param \tabs\apiclient\Actor|array|\stdClass $actor Actor
*
* @return $this
*/
public function setActor($actor)
{
$this->actor = \tabs\apiclient\Actor::factory($actor);

return $this;
}

/**
* @inheritDoc
Expand All @@ -119,6 +120,10 @@ public function toArray()
$arr['transferbookingid'] = $this->getTransferbooking()->getId();
}

if ($this->getActor()) {
$arr['actorid'] = $this->getActor()->getId();
}

if ($this->getType() == 'BookingAndSecurityDeposit') {
$arr['bookingamount'] = $this->getBookingamount();
$arr['securitydepositamount'] = $this->getSecuritydepositamount();
Expand Down

0 comments on commit b2cec60

Please sign in to comment.