1. Go to this page and download the library: Download siren/sdk 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/ */
siren / sdk example snippets
use Siren\Sdk\Siren;
$siren = new Siren(['apiKey' => 'sk_live_...']);
$result = $siren->events->sale([
'source' => 'stripe', // your commerce source
'externalId' => 'cs_test_a1b2c3', // your order id — used to match refunds later
'total' => 49.99, // major units: 49.99 = $49.99
'trackingId' => 4021, // opportunity id from the Siren tracking cookie
'currency' => 'USD', // optional, defaults to USD
'items' => [ // optional; omit to treat total as one line
['name' => 'Pro Plan (annual)', 'amount' => 49.99, 'quantity' => 1],
],
]);
echo $result->getOpportunityId(); // read from the X-Siren-OID response header