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
9 changes: 8 additions & 1 deletion Trustly/Api/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ public function verifyTrustlySignedNotification($notification) {
*
* @param bool $is_https Indicator wether the port on the API host expects
* https. NULL means do not change.
*
* @return void
*/
public function setHost($host=NULL, $port=NULL, $is_https=NULL) {
if(!isset($host)) {
Expand Down Expand Up @@ -279,7 +281,7 @@ public function setHost($host=NULL, $port=NULL, $is_https=NULL) {
*
* @param string $postdata The (optional) data to post.
*
* @return Array($body, $response_code)
* @return array{string, int} Array($body, $response_code)
*/
public function post($url=NULL, $postdata=NULL) {
/* Do note that that if you are going to POST JSON you need to set the
Expand Down Expand Up @@ -465,6 +467,7 @@ public function notificationResponse($request, $success=TRUE) {
*
* @param Trustly_Data_Request $request Outgoing data request.
*
* @return Trustly_Data_JSONRPCResponse
*/
public function call($request) {
if($this->insertCredentials($request) !== TRUE) {
Expand Down Expand Up @@ -524,6 +527,8 @@ abstract protected function urlPath($request=NULL);
* @param string $body The body recieved in response to the request
*
* @param integer $response_code the HTTP response code for the call
*
* @return Trustly_Data_JSONRPCResponse
*/
abstract protected function handleResponse($request, $body, $response_code);

Expand All @@ -535,6 +540,8 @@ abstract protected function handleResponse($request, $body, $response_code);
*
* @param Trustly_Data_Request $request Request to be used in the outgoing
* call
*
* @return bool
*/
abstract protected function insertCredentials($request);

Expand Down
2 changes: 2 additions & 0 deletions Trustly/Api/signed.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ protected function urlPath($request=NULL) {

/**
* Quirks mode implementation of clearing all pending openssl error messages.
*
* @return void
*/
private function clearOpenSSLError() {
/* Not really my favourite part of this library implementation. As
Expand Down
6 changes: 4 additions & 2 deletions Trustly/Data/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
class Trustly_Data {
/**
* Data payload
* @var array
* @var array<mixed>
*/
protected $payload = NULL;

Expand Down Expand Up @@ -179,7 +179,9 @@ public function json($pretty=FALSE) {
* pretty printer
*
* @param mixed $data Payload to sort. Will be sorted in place
* */
*
* @return void
*/
private function sortRecursive(&$data) {
if(is_array($data)) {
foreach($data as $k => $v) {
Expand Down
2 changes: 2 additions & 0 deletions Trustly/exceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public function __construct($message, $data=NULL) {
* Get the data that had an invalid signature. This is the only way to get
* data from anything with a bad signature. This should be used for
* DEBUGGING ONLY. You should NEVER rely on the contents.
*
* @return mixed
*/
public function getBadData() {
return $this->signature_data;
Expand Down