Skip to content

Commit fcafe4c

Browse files
Add multiple credit type support
1 parent 2d4777f commit fcafe4c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Tabscanner/Api.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@ public function __construct($api_key, $api_url = 'https://api.tabscanner.com/')
1515
$this->api_url = $api_url;
1616
}
1717

18-
public function upload($file)
18+
public function upload($file, $credit = 0)
1919
{
2020
$client = new Client();
21-
$api_upload_url = $this->api_url . $this->api_key . '/process';
21+
$api_upload_url = $this->api_url . $this->api_key . '/process';
2222
$file_type = gettype($file);
2323
$validate = $this->validate($file);
2424

25+
if ($credit) {
26+
$api_upload_url = $this->api_url . $this->api_key . '/process/' . $credit;
27+
}
28+
2529
if ($validate['error']) {
2630
$response = [
2731
'message' => $validate['message'],

0 commit comments

Comments
 (0)