Skip to content

Commit bee1a94

Browse files
committed
code styeling and set function on master class
1 parent 0212ef9 commit bee1a94

File tree

1 file changed

+55
-4
lines changed

1 file changed

+55
-4
lines changed

src/Signhost.php

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,37 @@ class Signhost
1616
*/
1717
private $client;
1818

19+
/**
20+
* Signhost constructor.
21+
*
22+
* @param $appName
23+
* @param $appKey
24+
* @param $apiKey
25+
* @param null $sharedSecret
26+
* @param string $environment
27+
*/
1928
public function __construct($appName, $appKey, $apiKey, $sharedSecret = null, $environment = 'production')
2029
{
2130
$this->client = new SignhostClient($appName, $appKey, $apiKey, $sharedSecret, $environment);
2231
}
2332

2433
/**
34+
* createTransaction
35+
*
2536
* @param $transaction
2637
* @return mixed
2738
* @throws SignHostException
2839
*/
29-
public function CreateTransaction($transaction)
40+
public function createTransaction($transaction)
3041
{
3142
$response = $this->client->execute("/transaction", "POST", $transaction);
3243

3344
return json_decode($response);
3445
}
3546

3647
/**
48+
* getTransaction
49+
*
3750
* @param $transactionId
3851
* @return mixed
3952
* @throws SignHostException
@@ -46,6 +59,8 @@ public function GetTransaction($transactionId)
4659
}
4760

4861
/**
62+
* deleteTransaction
63+
*
4964
* @param $transactionId
5065
* @return mixed
5166
* @throws SignHostException
@@ -58,6 +73,8 @@ public function DeleteTransaction($transactionId)
5873
}
5974

6075
/**
76+
* startTransaction
77+
*
6178
* @param $transactionId
6279
* @return mixed
6380
* @throws SignHostException
@@ -70,6 +87,8 @@ public function StartTransaction($transactionId)
7087
}
7188

7289
/**
90+
* addOrReplaceFile
91+
*
7392
* @param $transactionId
7493
* @param $fileId
7594
* @param $filePath
@@ -85,6 +104,8 @@ public function AddOrReplaceFile($transactionId, $fileId, $filePath)
85104
}
86105

87106
/**
107+
* addOrReplaceMetadata
108+
*
88109
* @param $transactionId
89110
* @param $fileId
90111
* @param $metadata
@@ -99,38 +120,44 @@ public function AddOrReplaceMetadata($transactionId, $fileId, $metadata)
99120
}
100121

101122
/**
123+
* getReceipt
124+
*
102125
* @param $transactionId
103126
* @return stream
104127
* @throws SignHostException
105128
*/
106-
public function GetReceipt($transactionId)
129+
public function getReceipt($transactionId)
107130
{
108131
$response = $this->client->execute("/file/receipt/" . $transactionId, "GET");
109132

110133
return $response;
111134
}
112135

113136
/**
137+
* getDocument
138+
*
114139
* @param $transactionId
115140
* @param $fileId
116141
* @return stream
117142
* @throws SignHostException
118143
*/
119-
public function GetDocument($transactionId, $fileId)
144+
public function getDocument($transactionId, $fileId)
120145
{
121146
$response = $this->execute("/transaction/" . $transactionId . "/file/" . rawurlencode($fileId), "GET");
122147

123148
return $response;
124149
}
125150

126151
/**
152+
* validateChecksum
153+
*
127154
* @param $masterTransactionId
128155
* @param $fileId
129156
* @param $status
130157
* @param $remoteChecksum
131158
* @return bool
132159
*/
133-
public function ValidateChecksum($masterTransactionId, $fileId, $status, $remoteChecksum)
160+
public function validateChecksum($masterTransactionId, $fileId, $status, $remoteChecksum)
134161
{
135162
$localChecksum = sha1($masterTransactionId . "|" . $fileId . "|" . $status . "|" . $this->SharedSecret);
136163

@@ -140,4 +167,28 @@ public function ValidateChecksum($masterTransactionId, $fileId, $status, $remote
140167

141168
return hash_equals($remoteChecksum, $localChecksum);
142169
}
170+
171+
/**
172+
* setIgnoreStatusCode
173+
*
174+
* @param $ignoreStatusCode
175+
* @return SignHost
176+
*/
177+
public function setIgnoreStatusCode($ignoreStatusCode)
178+
{
179+
$this->client->setIgnoreStatusCode($ignoreStatusCode);
180+
return $this;
181+
}
182+
183+
/**
184+
* setCaInfoPath
185+
*
186+
* @param $filePath
187+
* @return SignHost
188+
*/
189+
public function setCaInfoPath($filePath)
190+
{
191+
$this->client->setCaInfoPath($filePath);
192+
return $this;
193+
}
143194
}

0 commit comments

Comments
 (0)