PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / trunk
GiveWP – Donation Plugin and Fundraising Platform vtrunk
4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / vendor / stripe / stripe-php / lib / Stripe.php
give / vendor / stripe / stripe-php / lib Last commit date
ApiOperations 2 years ago BillingPortal 2 years ago Checkout 2 years ago Exception 4 years ago FinancialConnections 2 years ago HttpClient 2 years ago Identity 2 years ago Issuing 2 years ago Radar 2 years ago Reporting 4 years ago Service 2 years ago Sigma 4 years ago Terminal 2 years ago TestHelpers 2 years ago Util 2 years ago Account.php 2 years ago AccountLink.php 4 years ago AlipayAccount.php 4 years ago ApiRequestor.php 2 years ago ApiResource.php 2 years ago ApiResponse.php 4 years ago ApplePayDomain.php 4 years ago ApplicationFee.php 2 years ago ApplicationFeeRefund.php 4 years ago Balance.php 4 years ago BalanceTransaction.php 4 years ago BankAccount.php 4 years ago BaseStripeClient.php 2 years ago BaseStripeClientInterface.php 4 years ago BitcoinReceiver.php 2 years ago BitcoinTransaction.php 4 years ago Capability.php 4 years ago Card.php 2 years ago CashBalance.php 2 years ago Charge.php 2 years ago Collection.php 2 years ago CountrySpec.php 4 years ago Coupon.php 2 years ago CreditNote.php 2 years ago CreditNoteLineItem.php 4 years ago Customer.php 2 years ago CustomerBalanceTransaction.php 4 years ago Discount.php 2 years ago Dispute.php 4 years ago EphemeralKey.php 4 years ago ErrorObject.php 4 years ago Event.php 2 years ago ExchangeRate.php 4 years ago File.php 2 years ago FileLink.php 4 years ago FundingInstructions.php 2 years ago Invoice.php 2 years ago InvoiceItem.php 2 years ago InvoiceLineItem.php 2 years ago LineItem.php 4 years ago LoginLink.php 4 years ago Mandate.php 4 years ago OAuth.php 4 years ago OAuthErrorObject.php 4 years ago Order.php 2 years ago OrderItem.php 4 years ago OrderReturn.php 4 years ago PaymentIntent.php 2 years ago PaymentLink.php 2 years ago PaymentMethod.php 2 years ago Payout.php 4 years ago Person.php 2 years ago Plan.php 2 years ago Price.php 2 years ago Product.php 2 years ago PromotionCode.php 2 years ago Quote.php 2 years ago Recipient.php 2 years ago RecipientTransfer.php 4 years ago Refund.php 2 years ago RequestTelemetry.php 4 years ago Review.php 4 years ago SKU.php 2 years ago SearchResult.php 2 years ago SetupAttempt.php 4 years ago SetupIntent.php 2 years ago ShippingRate.php 2 years ago SingletonApiResource.php 2 years ago Source.php 4 years ago SourceTransaction.php 4 years ago Stripe.php 2 years ago StripeClient.php 2 years ago StripeClientInterface.php 4 years ago StripeObject.php 2 years ago StripeStreamingClientInterface.php 4 years ago Subscription.php 2 years ago SubscriptionItem.php 2 years ago SubscriptionSchedule.php 2 years ago TaxCode.php 2 years ago TaxId.php 2 years ago TaxRate.php 4 years ago ThreeDSecure.php 4 years ago Token.php 4 years ago Topup.php 4 years ago Transfer.php 2 years ago TransferReversal.php 4 years ago UsageRecord.php 4 years ago UsageRecordSummary.php 4 years ago Webhook.php 4 years ago WebhookEndpoint.php 4 years ago WebhookSignature.php 4 years ago
Stripe.php
279 lines
1 <?php
2
3 namespace Stripe;
4
5 /**
6 * Class Stripe.
7 */
8 class Stripe
9 {
10 /** @var string The Stripe API key to be used for requests. */
11 public static $apiKey;
12
13 /** @var string The Stripe client_id to be used for Connect requests. */
14 public static $clientId;
15
16 /** @var string The base URL for the Stripe API. */
17 public static $apiBase = 'https://api.stripe.com';
18
19 /** @var string The base URL for the OAuth API. */
20 public static $connectBase = 'https://connect.stripe.com';
21
22 /** @var string The base URL for the Stripe API uploads endpoint. */
23 public static $apiUploadBase = 'https://files.stripe.com';
24
25 /** @var null|string The version of the Stripe API to use for requests. */
26 public static $apiVersion = null;
27
28 /** @var null|string The account ID for connected accounts requests. */
29 public static $accountId = null;
30
31 /** @var string Path to the CA bundle used to verify SSL certificates */
32 public static $caBundlePath = null;
33
34 /** @var bool Defaults to true. */
35 public static $verifySslCerts = true;
36
37 /** @var array The application's information (name, version, URL) */
38 public static $appInfo = null;
39
40 /**
41 * @var null|Util\LoggerInterface the logger to which the library will
42 * produce messages
43 */
44 public static $logger = null;
45
46 /** @var int Maximum number of request retries */
47 public static $maxNetworkRetries = 0;
48
49 /** @var bool Whether client telemetry is enabled. Defaults to true. */
50 public static $enableTelemetry = true;
51
52 /** @var float Maximum delay between retries, in seconds */
53 private static $maxNetworkRetryDelay = 2.0;
54
55 /** @var float Maximum delay between retries, in seconds, that will be respected from the Stripe API */
56 private static $maxRetryAfter = 60.0;
57
58 /** @var float Initial delay between retries, in seconds */
59 private static $initialNetworkRetryDelay = 0.5;
60
61 const VERSION = '7.128.0';
62
63 /**
64 * @return string the API key used for requests
65 */
66 public static function getApiKey()
67 {
68 return self::$apiKey;
69 }
70
71 /**
72 * @return string the client_id used for Connect requests
73 */
74 public static function getClientId()
75 {
76 return self::$clientId;
77 }
78
79 /**
80 * @return Util\LoggerInterface the logger to which the library will
81 * produce messages
82 */
83 public static function getLogger()
84 {
85 if (null === self::$logger) {
86 return new Util\DefaultLogger();
87 }
88
89 return self::$logger;
90 }
91
92 /**
93 * @param Util\LoggerInterface $logger the logger to which the library
94 * will produce messages
95 */
96 public static function setLogger($logger)
97 {
98 self::$logger = $logger;
99 }
100
101 /**
102 * Sets the API key to be used for requests.
103 *
104 * @param string $apiKey
105 */
106 public static function setApiKey($apiKey)
107 {
108 self::$apiKey = $apiKey;
109 }
110
111 /**
112 * Sets the client_id to be used for Connect requests.
113 *
114 * @param string $clientId
115 */
116 public static function setClientId($clientId)
117 {
118 self::$clientId = $clientId;
119 }
120
121 /**
122 * @return string The API version used for requests. null if we're using the
123 * latest version.
124 */
125 public static function getApiVersion()
126 {
127 return self::$apiVersion;
128 }
129
130 /**
131 * @param string $apiVersion the API version to use for requests
132 */
133 public static function setApiVersion($apiVersion)
134 {
135 self::$apiVersion = $apiVersion;
136 }
137
138 /**
139 * @return string
140 */
141 private static function getDefaultCABundlePath()
142 {
143 return \realpath(__DIR__ . '/../data/ca-certificates.crt');
144 }
145
146 /**
147 * @return string
148 */
149 public static function getCABundlePath()
150 {
151 return self::$caBundlePath ?: self::getDefaultCABundlePath();
152 }
153
154 /**
155 * @param string $caBundlePath
156 */
157 public static function setCABundlePath($caBundlePath)
158 {
159 self::$caBundlePath = $caBundlePath;
160 }
161
162 /**
163 * @return bool
164 */
165 public static function getVerifySslCerts()
166 {
167 return self::$verifySslCerts;
168 }
169
170 /**
171 * @param bool $verify
172 */
173 public static function setVerifySslCerts($verify)
174 {
175 self::$verifySslCerts = $verify;
176 }
177
178 /**
179 * @return null|string The Stripe account ID for connected account
180 * requests
181 */
182 public static function getAccountId()
183 {
184 return self::$accountId;
185 }
186
187 /**
188 * @param string $accountId the Stripe account ID to set for connected
189 * account requests
190 */
191 public static function setAccountId($accountId)
192 {
193 self::$accountId = $accountId;
194 }
195
196 /**
197 * @return null|array The application's information
198 */
199 public static function getAppInfo()
200 {
201 return self::$appInfo;
202 }
203
204 /**
205 * @param string $appName The application's name
206 * @param null|string $appVersion The application's version
207 * @param null|string $appUrl The application's URL
208 * @param null|string $appPartnerId The application's partner ID
209 */
210 public static function setAppInfo($appName, $appVersion = null, $appUrl = null, $appPartnerId = null)
211 {
212 self::$appInfo = self::$appInfo ?: [];
213 self::$appInfo['name'] = $appName;
214 self::$appInfo['partner_id'] = $appPartnerId;
215 self::$appInfo['url'] = $appUrl;
216 self::$appInfo['version'] = $appVersion;
217 }
218
219 /**
220 * @return int Maximum number of request retries
221 */
222 public static function getMaxNetworkRetries()
223 {
224 return self::$maxNetworkRetries;
225 }
226
227 /**
228 * @param int $maxNetworkRetries Maximum number of request retries
229 */
230 public static function setMaxNetworkRetries($maxNetworkRetries)
231 {
232 self::$maxNetworkRetries = $maxNetworkRetries;
233 }
234
235 /**
236 * @return float Maximum delay between retries, in seconds
237 */
238 public static function getMaxNetworkRetryDelay()
239 {
240 return self::$maxNetworkRetryDelay;
241 }
242
243 /**
244 * @return float Maximum delay between retries, in seconds, that will be respected from the Stripe API
245 */
246 public static function getMaxRetryAfter()
247 {
248 return self::$maxRetryAfter;
249 }
250
251 /**
252 * @return float Initial delay between retries, in seconds
253 */
254 public static function getInitialNetworkRetryDelay()
255 {
256 return self::$initialNetworkRetryDelay;
257 }
258
259 /**
260 * @return bool Whether client telemetry is enabled
261 */
262 public static function getEnableTelemetry()
263 {
264 return self::$enableTelemetry;
265 }
266
267 /**
268 * @param bool $enableTelemetry Enables client telemetry.
269 *
270 * Client telemetry enables timing and request metrics to be sent back to Stripe as an HTTP Header
271 * with the current request. This enables Stripe to do latency and metrics analysis without adding extra
272 * overhead (such as extra network calls) on the client.
273 */
274 public static function setEnableTelemetry($enableTelemetry)
275 {
276 self::$enableTelemetry = $enableTelemetry;
277 }
278 }
279