Re-add stripe php library v 10.5.0, git errored because it had it's own git folder

This commit is contained in:
Marcus Hill
2023-02-07 21:34:50 +00:00
parent 23b482e172
commit 068737c7d3
276 changed files with 25857 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace Stripe\ApiOperations;
/**
* Trait for retrievable singleton resources. Adds a `retrieve()` static method to the
* class.
*
* This trait should only be applied to classes that derive from SingletonApiResource.
*/
trait SingletonRetrieve
{
/**
* @param array|string $id the ID of the API resource to retrieve,
* or an options array containing an `id` key
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return static
*/
public static function retrieve($opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static(null, $opts);
$instance->refresh();
return $instance;
}
}