Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ChannelClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct(string $landlord_id, string $channel_id, string $dis

protected function authQuery(RequestInterface $request): array{
$timestamp = time();
$auth = $this->generateAuth((string)$timestamp);
$auth = $this->generateAuth((string)$request->getBody(), (string)$timestamp);

return [
'auth' => $auth,
Expand All @@ -27,7 +27,7 @@ protected function authQuery(RequestInterface $request): array{
];
}

private function generateAuth(string $timestamp): string{
return hash_hmac('sha256', $timestamp, $this->display_key) ?: '';
private function generateAuth(string $json, string $timestamp): string{
return hash_hmac('sha256', $json.$timestamp, $this->display_key) ?: '';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now channel has an inbound endpoint, need to include body in auth hash

}
}
292 changes: 292 additions & 0 deletions src/Models/EnquiryCreation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,292 @@
<?php
namespace SturentsLib\Api\Models;

/**
* ** This file was generated automatically, you might want to avoid editing it **
*/
class EnquiryCreation extends SwaggerModel
{
/**
* Plain (non-hashed) house id
* @var int
* @required
*/
protected $property_id;

/**
* Hashed availability id
* @var string
* @required
*/
protected $contract_id;

/**
* @var string
* @required
*/
protected $first_name;

/**
* @var string
* @required
*/
protected $last_name;

/**
* @var string
* @required
*/
protected $email;

/**
* @var string
* @required
*/
protected $phone;

/**
* @var string
* @required
*/
protected $tenant_type;

/**
* @var string
* @required
*/
protected $enquiry_method;

/**
* @var string
* @required
*/
protected $enquiry_type;

/**
* Optional free-text message; used as the enquiry subject if provided,
* otherwise a label derived from enquiry_type is used
*
* @var string
*/
protected $message = '';


/**
* @return int
*/
public function getPropertyId()
{
return $this->property_id;
}


/**
* @param int $property_id
*
* @return $this
*/
public function setPropertyId($property_id)
{
$this->property_id = $property_id;

return $this;
}


/**
* @return string
*/
public function getContractId()
{
return $this->contract_id;
}


/**
* @param string $contract_id
*
* @return $this
*/
public function setContractId($contract_id)
{
$this->contract_id = $contract_id;

return $this;
}


/**
* @return string
*/
public function getFirstName()
{
return $this->first_name;
}


/**
* @param string $first_name
*
* @return $this
*/
public function setFirstName($first_name)
{
$this->first_name = $first_name;

return $this;
}


/**
* @return string
*/
public function getLastName()
{
return $this->last_name;
}


/**
* @param string $last_name
*
* @return $this
*/
public function setLastName($last_name)
{
$this->last_name = $last_name;

return $this;
}


/**
* @return string
*/
public function getEmail()
{
return $this->email;
}


/**
* @param string $email
*
* @return $this
*/
public function setEmail($email)
{
$this->email = $email;

return $this;
}


/**
* @return string
*/
public function getPhone()
{
return $this->phone;
}


/**
* @param string $phone
*
* @return $this
*/
public function setPhone($phone)
{
$this->phone = $phone;

return $this;
}


/**
* @return string
*/
public function getTenantType()
{
return $this->tenant_type;
}


/**
* @param string $tenant_type
*
* @return $this
*/
public function setTenantType($tenant_type)
{
$this->tenant_type = $tenant_type;

return $this;
}


/**
* @return string
*/
public function getEnquiryMethod()
{
return $this->enquiry_method;
}


/**
* @param string $enquiry_method
*
* @return $this
*/
public function setEnquiryMethod($enquiry_method)
{
$this->enquiry_method = $enquiry_method;

return $this;
}


/**
* @return string
*/
public function getEnquiryType()
{
return $this->enquiry_type;
}


/**
* @param string $enquiry_type
*
* @return $this
*/
public function setEnquiryType($enquiry_type)
{
$this->enquiry_type = $enquiry_type;

return $this;
}


/**
* @return string
*/
public function getMessage()
{
return $this->message;
}


/**
* @param string $message
*
* @return $this
*/
public function setMessage($message)
{
$this->message = $message;

return $this;
}
}
36 changes: 36 additions & 0 deletions src/Models/EnquirySaved.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
namespace SturentsLib\Api\Models;

/**
* ** This file was generated automatically, you might want to avoid editing it **
*/
class EnquirySaved extends SwaggerModel
{
/**
* Hashed id of the created enquiry
* @var string
*/
protected $enquiry_id = '';


/**
* @return string
*/
public function getEnquiryId()
{
return $this->enquiry_id;
}


/**
* @param string $enquiry_id
*
* @return $this
*/
public function setEnquiryId($enquiry_id)
{
$this->enquiry_id = $enquiry_id;

return $this;
}
}
30 changes: 30 additions & 0 deletions src/Models/PropertyManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ class PropertyManager extends SwaggerModel
*/
protected $company = '';

/**
* True if the landlord has given the channel permission to send
* enquiries for their listings (e.g. via POST /enquiry)
*
* @var bool
*/
protected $can_send_enquiries = false;


/**
* @return string
Expand Down Expand Up @@ -121,4 +129,26 @@ public function setCompany($company)

return $this;
}


/**
* @return bool
*/
public function getCanSendEnquiries()
{
return $this->can_send_enquiries;
}


/**
* @param bool $can_send_enquiries
*
* @return $this
*/
public function setCanSendEnquiries($can_send_enquiries)
{
$this->can_send_enquiries = $can_send_enquiries;

return $this;
}
}
Loading