From ae2f99a2a401853a9170b019228048fd46326374 Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Thu, 20 Jun 2019 14:49:23 -0700 Subject: [PATCH] Enable request latency telemetry by default --- README.md | 19 +++++++++++++++++-- lib/Stripe.php | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8dca764d7..7d1b681c0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,11 @@ [![License](https://poser.pugx.org/stripe/stripe-php/license.svg)](https://packagist.org/packages/stripe/stripe-php) [![Code Coverage](https://coveralls.io/repos/stripe/stripe-php/badge.svg?branch=master)](https://coveralls.io/r/stripe/stripe-php?branch=master) -You can sign up for a Stripe account at https://stripe.com. +The Stripe PHP library provides convenient access to the Stripe API from +applications written in the PHP language. It includes a pre-defined set of +classes for API resources that initialize themselves dynamically from API +responses which makes it compatible with a wide range of versions of the Stripe +API. ## Requirements @@ -56,7 +60,7 @@ echo $charge; ## Documentation -Please see https://stripe.com/docs/api for up-to-date documentation. +See the [PHP API docs](https://stripe.com/docs/api/php#intro). ## Legacy Version Support @@ -179,6 +183,17 @@ an intermittent network problem: [Idempotency keys][idempotency-keys] are added to requests to guarantee that retries are safe. +### Request latency telemetry + +By default, the library sends request latency telemetry to Stripe. These +numbers help Stripe improve the overall latency of its API for all users. + +You can disable this behavior if you prefer: + +```php +\Stripe\Stripe::setEnableTelemetry(false); +``` + ## Development Get [Composer][composer]. For example, on Mac OS: diff --git a/lib/Stripe.php b/lib/Stripe.php index b115ad628..dedda6fe5 100644 --- a/lib/Stripe.php +++ b/lib/Stripe.php @@ -47,7 +47,7 @@ class Stripe public static $maxNetworkRetries = 0; // @var boolean Whether client telemetry is enabled. Defaults to false. - public static $enableTelemetry = false; + public static $enableTelemetry = true; // @var float Maximum delay between retries, in seconds private static $maxNetworkRetryDelay = 2.0;