PHP code example of zero-to-prod / spapi-rdt
1. Go to this page and download the library: Download zero-to-prod/spapi-rdt library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zero-to-prod / spapi-rdt example snippets
use Zerotoprod\SpapiRdt\SpapiRdt;
$response = SpapiRdt::from('access_token', 'targetApplication')
->orders()
->getOrders('123-1234567-1234567');
$restrictedDataToken = $response['response']['restrictedDataToken']
use Zerotoprod\SpapiRdt\SpapiRdt;
use Zerotoprod\SpapiRdt\Support\Testing\SpapiRdtFake;
use Zerotoprod\SpapiRdt\Support\Testing\SpapiRdtResponseFactory;
SpapiRdtFake::fake(
SpapiRdtResponseFactory::factory()->make()
);
$response = SpapiRdt::from('access_token', 'targetApplication')
->orders()
->getOrders();