How to include SDK in a Project

I am trying to include a php sdk into my project (The sdk is Veryfi OCR Receipt scanner) and I was wondering what would be the most efficient way to do this. The files containing the sdk is generated through a composer, so would it be through an external library?

Here is also a link to the sdk.

Any help would be appreciated.

ths is a guide to use composer in Scriptcase

https://medium.com/scriptcase-master/tutorial-how-to-use-composer-in-scriptcase-abe096716666

however you cannot use the use syntax in the SC code, even in the blank applications, so read this

This is my code. I am still unsure how to do this without using the use command.

sc_include_library(“prj”,“vendor”, “vendor/autoload.php”);

use veryfi\Client;

$client_id = ‘HIDING FOR SECURITY REASONS’;
$client_secret = ‘HIDING FOR SECURITY REASONS’;
$username = ‘HIDING FOR SECURITY REASONS’;
$api_key = ‘HIDING FOR SECURITY REASONS’;

$veryfi_client = new Client($client_id, $client_secret, $username, $api_key);
$categories = array(‘Advertising & Marketing’, ‘Automotive’);
$file = {Receipt};
$return_associative = true;
$delete_after_processing = true;
$json_response = json_decode($veryfi_client->process_document($file, $categories, $delete_after_processing), $return_associative);

print_r($json_response);
print($json_response[‘total’]);
print($json_response[‘vendor’][‘raw_name’])

remove the row

use veryfi\Client;

and change this row

$veryfi_client = new veryfi\Client($client_id, $client_secret, $username, $api_key);

should work

1 Like

yes I ended up trying that and it worked. Thank you for the help