PHP code example of marotpam / zipkin-instrumentation-stripe-php
1. Go to this page and download the library: Download marotpam/zipkin-instrumentation-stripe-php 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/ */
marotpam / zipkin-instrumentation-stripe-php example snippets
use Stripe\ApiRequestor;
use Stripe\HttpClient\CurlClient;
use Stripe\Stripe;
use Zipkin\Tracer;
use ZipkinStripe\HttpClient;
/**
* @param string $stripeSecretKey Stripe API key
* @param Tracer $tracer Zipkin tracer used across your application
*/
public function initialiseStripeClient(string $stripeSecretKey, Tracer $tracer)
{
Stripe::setApiKey($stripeSecretKey);
$instrumentedStripeClient = new HttpClient(CurlClient::instance(), $tracer);
ApiRequestor::setHttpClient($instrumentedStripeClient);
}