2
0
forked from Wavyzz/dolibarr

NEW Upgrade of Stripe lib to 6.4.1

This commit is contained in:
Laurent Destailleur
2018-03-07 19:26:06 +01:00
parent b9f1695b34
commit 8c03fdd51f
69 changed files with 5502 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace Stripe\ApiOperations;
/**
* Trait for creatable resources. Adds a `create()` static method to the class.
*
* This trait should only be applied to classes that derive from StripeObject.
*/
trait Create
{
/**
* @param array|null $params
* @param array|string|null $options
*
* @return \Stripe\ApiResource The created resource.
*/
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
}
}