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 #29 from CarltonSoftware/develop
Browse files Browse the repository at this point in the history
13/3 release
  • Loading branch information
Alex Wyett authored Mar 13, 2019
2 parents 2043b0f + 83229a8 commit 8f81052
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ examples/template/copycontactmethodlanguages.php
examples/template/copytemplate.php
examples/template/copytemplatetargetsources.php
examples/template/copytextitems.php
examples/sandbox.php
examples/sandbox.php
build/logs/
.phpunit.result.cache
2 changes: 1 addition & 1 deletion examples/webhooks/subscribing-to-webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
try {
// Subscribe to all notifications about bookings. Additional groups are
// property, actor and admin.
\tabs\apiclient\WebHook::subscribe($public_endpoint_url, 'booking');
\tabs\apiclient\WebHook::subscribe($public_endpoint_url, 'property', 'MA');
} catch (Exception $ex) {
echo $ex->getMessage();
}
Expand Down
2 changes: 1 addition & 1 deletion src/tabs/apiclient/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,8 @@ function($ele) use ($fromDate, $days) {
try {
$to = clone $fromDate;
for ($i = 0; $i < $weeks; $i++) {
$to->add(new \DateInterval('P7D'));
$getPrice($prices, $availablebreaksprices, $to, 7);
$to->add(new \DateInterval('P7D'));
}

if ($to && $add > 0) {
Expand Down
14 changes: 10 additions & 4 deletions src/tabs/apiclient/WebHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,20 @@ class WebHook extends Base
*
* @return void
*/
public static function subscribe($url, $type = 'property')
public static function subscribe($url, $type = 'property', $marketingBrandCode = null)
{
try {
$args = array(
'url' => $url
);

if ($marketingBrandCode) {
$args['brandcode'] = $marketingBrandCode;
}

$res = \tabs\apiclient\client\Client::getClient()->get(
'webhook/subscribe/' . strtolower($type),
array(
'url' => $url
)
$args
);

if ($res->getStatusCode() != 200) {
Expand Down
4 changes: 3 additions & 1 deletion src/tabs/apiclient/contact/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function toArray()
'reference' => $this->getReference(),
'contactdetailid' => $this->getContactdetail()->getId(),
'contactdetailvalue' => $this->getContactdetailvalue(),
'perform_send' => $this->getPerformsend() === true ? 'true' : 'false'
'perform_send' => $this->getPerformsend() === true ? 'true' : 'false',
);

if ($this->getCreatedbyactor()) {
Expand All @@ -181,6 +181,8 @@ public function toArray()
);
}

//var_dump($arr); die;

return $arr;
}

Expand Down
10 changes: 5 additions & 5 deletions src/tabs/apiclient/property/Branding.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
* @method Branding setShowpricingonwebuntil(\DateTime $var) Sets the showpricingonwebuntil
*
* @method Branding setConvertpotentialstoprovisionals(boolean $var) Sets the convertpotentialstoprovisionals
* @method Branding setConvertpotentialstoprovisionals(string $var) Sets the convertpotentialstoprovisionals
*
* @method Collection|ChangeDayTemplate[] getChangedaytemplates Returns the change day templates
* @method Collection|Pricing[] getExtraprices() Returns the property extra prices
Expand Down Expand Up @@ -127,7 +127,7 @@ class Branding extends Builder
protected $showpricingonwebuntil;

/**
* @var boolean
* @var string
*/
protected $convertpotentialstoprovisionals;

Expand Down Expand Up @@ -471,9 +471,9 @@ public function toArray()
);

if ($this->getConvertpotentialstoprovisionals()) {
$arr['convertpotentialstoprovisionals'] = true;
$arr['convertpotentialstoprovisionals'] = $this->getConvertpotentialstoprovisionals();
}

return $arr;
}

Expand Down Expand Up @@ -574,7 +574,7 @@ public function getShowpricingonwebuntil()
/**
* Returns the convertpotentialstoprovisionals
*
* @return boolean
* @return string
*/
public function getConvertpotentialstoprovisionals()
{
Expand Down
5 changes: 0 additions & 5 deletions tests/AvailableBreaksPriceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ public function testPrices($fromDate, $days, $price)
public function pricesProvider()
{
return array(
array(
new \DateTime('2018-12-04'),
15,
1310
),
array(
new \DateTime('2018-12-04'),
7,
Expand Down

0 comments on commit 8f81052

Please sign in to comment.