Commit f3d0b443 authored by mattwire's avatar mattwire

Update Stripe library, API version

parent ced4e293
......@@ -14,7 +14,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
*
* @var string
*/
const API_VERSION = '2019-05-16';
const API_VERSION = '2019-08-14';
/**
* Mode of operation: live or test.
......
......@@ -8,16 +8,16 @@
"packages": [
{
"name": "stripe/stripe-php",
"version": "v6.40.0",
"version": "v6.43.1",
"source": {
"type": "git",
"url": "https://github.com/stripe/stripe-php.git",
"reference": "9c22ffab790ef4dae0f371929de50e8b53c9ec8d"
"reference": "42fcdaf99c44bb26937223f8eae1f263491d5ab8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/9c22ffab790ef4dae0f371929de50e8b53c9ec8d",
"reference": "9c22ffab790ef4dae0f371929de50e8b53c9ec8d",
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/42fcdaf99c44bb26937223f8eae1f263491d5ab8",
"reference": "42fcdaf99c44bb26937223f8eae1f263491d5ab8",
"shasum": ""
},
"require": {
......@@ -60,7 +60,7 @@
"payment processing",
"stripe"
],
"time": "2019-06-27T23:24:51+00:00"
"time": "2019-08-29T16:56:12+00:00"
}
],
"packages-dev": [],
......
[
{
"name": "stripe/stripe-php",
"version": "v6.40.0",
"version_normalized": "6.40.0.0",
"version": "v6.43.1",
"version_normalized": "6.43.1.0",
"source": {
"type": "git",
"url": "https://github.com/stripe/stripe-php.git",
"reference": "9c22ffab790ef4dae0f371929de50e8b53c9ec8d"
"reference": "42fcdaf99c44bb26937223f8eae1f263491d5ab8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/9c22ffab790ef4dae0f371929de50e8b53c9ec8d",
"reference": "9c22ffab790ef4dae0f371929de50e8b53c9ec8d",
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/42fcdaf99c44bb26937223f8eae1f263491d5ab8",
"reference": "42fcdaf99c44bb26937223f8eae1f263491d5ab8",
"shasum": ""
},
"require": {
......@@ -26,7 +26,7 @@
"squizlabs/php_codesniffer": "~2.0",
"symfony/process": "~2.8"
},
"time": "2019-06-27T23:24:51+00:00",
"time": "2019-08-29T16:56:12+00:00",
"type": "library",
"extra": {
"branch-alias": {
......
# Changelog
## 6.43.1 - 2019-08-29
* [#722](https://github.com/stripe/stripe-php/pull/722) Make `LoggerInterface::error` compatible with its PSR-3 counterpart
* [#714](https://github.com/stripe/stripe-php/pull/714) Add `pending_setup_intent` property in `Subscription`
* [#713](https://github.com/stripe/stripe-php/pull/713) Add typehint to `ApiResponse`
* [#712](https://github.com/stripe/stripe-php/pull/712) Fix comment
* [#701](https://github.com/stripe/stripe-php/pull/701) Start testing PHP 7.3
## 6.43.0 - 2019-08-09
* [#694](https://github.com/stripe/stripe-php/pull/694) Add `SubscriptionItem::createUsageRecord` method
## 6.42.0 - 2019-08-09
* [#688](https://github.com/stripe/stripe-php/pull/688) Remove `SubscriptionScheduleRevision`
* Note that this is technically a breaking change, however we've chosen to release it as a minor version in light of the fact that this resource and its API methods were virtually unused.
## 6.41.0 - 2019-07-31
* [#683](https://github.com/stripe/stripe-php/pull/683) Move the List Balance History API to `/v1/balance_transactions`
## 6.40.0 - 2019-06-27
* [#675](https://github.com/stripe/stripe-php/pull/675) Add support for `SetupIntent` resource and APIs
......@@ -57,7 +74,7 @@
* [#642](https://github.com/stripe/stripe-php/pull/642) Fix an issue where existing idempotency keys would be overwritten when using automatic retries
## 6.34.1 - 2019-04-25
* [#640](https://github.com/stripe/stripe-php/pull/640) Add missing phpdocs
* [#640](https://github.com/stripe/stripe-php/pull/640) Add missing phpdocs
## 6.34.0 - 2019-04-24
* [#626](https://github.com/stripe/stripe-php/pull/626) Add support for the `TaxRate` resource and APIs
......@@ -145,7 +162,7 @@
* [#564](https://github.com/stripe/stripe-php/pull/564) Add event name constants for subscription schedule aborted/expiring
## 6.23.0 - 2018-11-27
* [#542](https://github.com/stripe/stripe-php/pull/542) Add support for `ValueList` and `ValueListItem` for Radar
* [#542](https://github.com/stripe/stripe-php/pull/542) Add support for `ValueList` and `ValueListItem` for Radar
## 6.22.1 - 2018-11-20
* [#561](https://github.com/stripe/stripe-php/pull/561) Add cast and some docs to telemetry introduced in 6.22.0/#549
......@@ -399,7 +416,7 @@ Pull requests included in this release:
* Add support for payouts and recipient transfers
## 4.6.0 - 2017-04-06
* Please see 4.7.0 instead (no-op release)
* Please see 4.7.0 instead (no-op release)
## 4.5.1 - 2017-03-22
* Remove hard dependency on cURL
......
......@@ -122,7 +122,6 @@ require(dirname(__FILE__) . '/lib/SourceTransaction.php');
require(dirname(__FILE__) . '/lib/Subscription.php');
require(dirname(__FILE__) . '/lib/SubscriptionItem.php');
require(dirname(__FILE__) . '/lib/SubscriptionSchedule.php');
require(dirname(__FILE__) . '/lib/SubscriptionScheduleRevision.php');
require(dirname(__FILE__) . '/lib/TaxId.php');
require(dirname(__FILE__) . '/lib/TaxRate.php');
require(dirname(__FILE__) . '/lib/Terminal/ConnectionToken.php');
......
......@@ -30,7 +30,6 @@ namespace Stripe;
*/
class Account extends ApiResource
{
const OBJECT_NAME = "account";
use ApiOperations\All;
......
......@@ -14,7 +14,6 @@ namespace Stripe;
*/
class AccountLink extends ApiResource
{
const OBJECT_NAME = "account_link";
use ApiOperations\Create;
......
......@@ -12,7 +12,6 @@ namespace Stripe;
*/
class AlipayAccount extends ApiResource
{
const OBJECT_NAME = "alipay_account";
use ApiOperations\Delete;
......
......@@ -205,7 +205,7 @@ class ApiRequestor
return new Error\Idempotency($msg, $rcode, $rbody, $resp, $rheaders);
}
// intentional fall-through
// no break
case 404:
return new Error\InvalidRequest($msg, $param, $rcode, $rbody, $resp, $rheaders);
case 401:
......
......@@ -2,6 +2,8 @@
namespace Stripe;
use Stripe\Util\CaseInsensitiveArray;
/**
* Class ApiResponse
*
......@@ -17,7 +19,7 @@ class ApiResponse
/**
* @param string $body
* @param integer $code
* @param array|null $headers
* @param array|CaseInsensitiveArray|null $headers
* @param array|null $json
*
* @return obj An APIResponse
......
......@@ -9,7 +9,6 @@ namespace Stripe;
*/
class ApplePayDomain extends ApiResource
{
const OBJECT_NAME = "apple_pay_domain";
use ApiOperations\All;
......
......@@ -24,7 +24,6 @@ namespace Stripe;
*/
class ApplicationFee extends ApiResource
{
const OBJECT_NAME = "application_fee";
use ApiOperations\All;
......
......@@ -18,7 +18,6 @@ namespace Stripe;
*/
class ApplicationFeeRefund extends ApiResource
{
const OBJECT_NAME = "fee_refund";
use ApiOperations\Update {
......
......@@ -15,7 +15,6 @@ namespace Stripe;
*/
class Balance extends SingletonApiResource
{
const OBJECT_NAME = "balance";
/**
......
......@@ -24,7 +24,6 @@ namespace Stripe;
*/
class BalanceTransaction extends ApiResource
{
const OBJECT_NAME = "balance_transaction";
use ApiOperations\All;
......@@ -63,13 +62,4 @@ class BalanceTransaction extends ApiResource
const TYPE_TRANSFER_CANCEL = 'transfer_cancel';
const TYPE_TRANSFER_FAILURE = 'transfer_failure';
const TYPE_TRANSFER_REFUND = 'transfer_refund';
/**
* @return string The class URL for this resource. It needs to be special
* cased because it doesn't fit into the standard resource pattern.
*/
public static function classUrl()
{
return "/v1/balance/history";
}
}
......@@ -25,7 +25,6 @@ namespace Stripe;
*/
class BankAccount extends ApiResource
{
const OBJECT_NAME = "bank_account";
use ApiOperations\Delete;
......@@ -93,12 +92,12 @@ class BankAccount extends ApiResource
throw new Error\InvalidRequest($msg, null);
}
/**
* @param array|null $params
* @param array|string|null $options
*
* @return BankAccount The verified bank account.
*/
/**
* @param array|null $params
* @param array|string|null $options
*
* @return BankAccount The verified bank account.
*/
public function verify($params = null, $options = null)
{
$url = $this->instanceUrl() . '/verify';
......
......@@ -12,7 +12,6 @@ namespace Stripe;
*/
class BitcoinReceiver extends ApiResource
{
const OBJECT_NAME = "bitcoin_receiver";
use ApiOperations\All;
......
......@@ -9,6 +9,5 @@ namespace Stripe;
*/
class BitcoinTransaction extends ApiResource
{
const OBJECT_NAME = "bitcoin_transaction";
}
......@@ -17,7 +17,6 @@ namespace Stripe;
*/
class Capability extends ApiResource
{
const OBJECT_NAME = "capability";
use ApiOperations\Update;
......
......@@ -38,7 +38,6 @@ namespace Stripe;
*/
class Card extends ApiResource
{
const OBJECT_NAME = "card";
use ApiOperations\Delete;
......
......@@ -53,7 +53,6 @@ namespace Stripe;
*/
class Charge extends ApiResource
{
const OBJECT_NAME = "charge";
use ApiOperations\All;
......
......@@ -23,7 +23,6 @@ namespace Stripe\Checkout;
*/
class Session extends \Stripe\ApiResource
{
const OBJECT_NAME = "checkout.session";
use \Stripe\ApiOperations\Create;
......
......@@ -14,7 +14,6 @@ namespace Stripe;
*/
class Collection extends StripeObject implements \IteratorAggregate
{
const OBJECT_NAME = "list";
use ApiOperations\Request;
......
......@@ -18,7 +18,6 @@ namespace Stripe;
*/
class CountrySpec extends ApiResource
{
const OBJECT_NAME = "country_spec";
use ApiOperations\All;
......
......@@ -25,7 +25,6 @@ namespace Stripe;
*/
class Coupon extends ApiResource
{
const OBJECT_NAME = "coupon";
use ApiOperations\All;
......
......@@ -27,7 +27,6 @@ namespace Stripe;
*/
class CreditNote extends ApiResource
{
const OBJECT_NAME = "credit_note";
use ApiOperations\All;
......
......@@ -33,7 +33,6 @@ namespace Stripe;
*/
class Customer extends ApiResource
{
const OBJECT_NAME = "customer";
use ApiOperations\All;
......
......@@ -16,6 +16,5 @@ namespace Stripe;
*/
class Discount extends StripeObject
{
const OBJECT_NAME = "discount";
}
......@@ -24,7 +24,6 @@ namespace Stripe;
*/
class Dispute extends ApiResource
{
const OBJECT_NAME = "dispute";
use ApiOperations\All;
......
......@@ -17,7 +17,6 @@ namespace Stripe;
*/
class EphemeralKey extends ApiResource
{
const OBJECT_NAME = "ephemeral_key";
use ApiOperations\Create {
......
......@@ -20,7 +20,6 @@ namespace Stripe;
*/
class Event extends ApiResource
{
const OBJECT_NAME = "event";
/**
......
......@@ -9,7 +9,6 @@ namespace Stripe;
*/
class ExchangeRate extends ApiResource
{
const OBJECT_NAME = "exchange_rate";
use ApiOperations\All;
......
......@@ -19,7 +19,6 @@ namespace Stripe;
*/
class FileLink extends ApiResource
{
const OBJECT_NAME = "file_link";
use ApiOperations\All;
......
......@@ -70,7 +70,6 @@ namespace Stripe;
*/
class Invoice extends ApiResource
{
const OBJECT_NAME = "invoice";
use ApiOperations\All;
......
......@@ -29,7 +29,6 @@ namespace Stripe;
*/
class InvoiceItem extends ApiResource
{
const OBJECT_NAME = "invoiceitem";
use ApiOperations\All;
......
......@@ -17,7 +17,6 @@ namespace Stripe;
*/
class IssuerFraudRecord extends ApiResource
{
const OBJECT_NAME = "issuer_fraud_record";
use ApiOperations\All;
......
......@@ -13,6 +13,5 @@ namespace Stripe;
*/
class LoginLink extends ApiResource
{
const OBJECT_NAME = "login_link";
}
......@@ -33,7 +33,6 @@ namespace Stripe;
*/
class Order extends ApiResource
{
const OBJECT_NAME = "order";
use ApiOperations\All;
......
......@@ -17,6 +17,5 @@ namespace Stripe;
*/
class OrderItem extends StripeObject
{
const OBJECT_NAME = "order_item";
}
......@@ -19,7 +19,6 @@ namespace Stripe;
*/
class OrderReturn extends ApiResource
{
const OBJECT_NAME = "order_return";
use ApiOperations\All;
......
......@@ -42,7 +42,6 @@ namespace Stripe;
*/
class PaymentIntent extends ApiResource
{
const OBJECT_NAME = "payment_intent";
use ApiOperations\All;
......
......@@ -22,7 +22,6 @@ namespace Stripe;
*/
class PaymentMethod extends ApiResource
{
const OBJECT_NAME = "payment_method";
use ApiOperations\All;
......
......@@ -30,7 +30,6 @@ namespace Stripe;
*/
class Payout extends ApiResource
{
const OBJECT_NAME = "payout";
use ApiOperations\All;
......
......@@ -35,7 +35,6 @@ namespace Stripe;
*/
class Person extends ApiResource
{
const OBJECT_NAME = "person";
use ApiOperations\Delete;
......
......@@ -29,7 +29,6 @@ namespace Stripe;
*/
class Plan extends ApiResource
{
const OBJECT_NAME = "plan";
use ApiOperations\All;
......
......@@ -29,7 +29,6 @@ namespace Stripe;
*/
class Product extends ApiResource
{
const OBJECT_NAME = "product";
use ApiOperations\All;
......
......@@ -24,7 +24,6 @@ namespace Stripe;
*/
class Recipient extends ApiResource
{
const OBJECT_NAME = "recipient";
use ApiOperations\All;
......
......@@ -34,6 +34,5 @@ namespace Stripe;
*/
class RecipientTransfer extends ApiResource
{
const OBJECT_NAME = "recipient_transfer";
}
......@@ -26,7 +26,6 @@ namespace Stripe;
*/
class Refund extends ApiResource
{
const OBJECT_NAME = "refund";
use ApiOperations\All;
......
......@@ -24,7 +24,6 @@ namespace Stripe;
*/
class SKU extends ApiResource
{
const OBJECT_NAME = "sku";
use ApiOperations\All;
......
......@@ -25,7 +25,6 @@ namespace Stripe;
*/
class SetupIntent extends ApiResource
{
const OBJECT_NAME = "setup_intent";
use ApiOperations\All;
......
......@@ -43,7 +43,6 @@ namespace Stripe;
*/
class Source extends ApiResource
{
const OBJECT_NAME = "source";
use ApiOperations\Create;
......
......@@ -18,6 +18,5 @@ namespace Stripe;
*/
class SourceTransaction extends ApiResource
{
const OBJECT_NAME = "source_transaction";
}
......@@ -46,7 +46,7 @@ class Stripe
// @var int Maximum number of request retries
public static $maxNetworkRetries = 0;
// @var boolean Whether client telemetry is enabled. Defaults to false.
// @var boolean Whether client telemetry is enabled. Defaults to true.
public static $enableTelemetry = true;
// @var float Maximum delay between retries, in seconds
......@@ -55,7 +55,7 @@ class Stripe
// @var float Initial delay between retries, in seconds
private static $initialNetworkRetryDelay = 0.5;
const VERSION = '6.40.0';
const VERSION = '6.43.1';
/**
* @return string The API key used for requests.
......
......@@ -153,7 +153,7 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable
$nullval = null;
if (!empty($this->_values) && array_key_exists($k, $this->_values)) {
return $this->_values[$k];
} else if (!empty($this->_transientValues) && $this->_transientValues->includes($k)) {
} elseif (!empty($this->_transientValues) && $this->_transientValues->includes($k)) {
$class = get_class($this);
$attrs = join(', ', array_keys($this->_values));
$message = "Stripe Notice: Undefined property of $class instance: $k. "
......
......@@ -28,6 +28,7 @@ namespace Stripe;
* @property string $latest_invoice
* @property boolean $livemode
* @property StripeObject $metadata
* @property string $pending_setup_intent
* @property Plan $plan
* @property int $quantity
* @property SubscriptionSchedule $schedule
......@@ -42,7 +43,6 @@ namespace Stripe;
*/
class Subscription extends ApiResource
{
const OBJECT_NAME = "subscription";
use ApiOperations\All;
......
......@@ -19,20 +19,34 @@ namespace Stripe;
*/
class SubscriptionItem extends ApiResource
{
const OBJECT_NAME = "subscription_item";
const PATH_USAGE_RECORDS = '/usage_records';
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\NestedResource;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* @param string|null $id The ID of the subscription item on which to create the usage record.
* @param array|null $params
* @param array|string|null $opts
*
* @return ApiResource
*/
public static function createUsageRecord($id, $params = null, $opts = null)
{
return self::_createNestedResource($id, static::PATH_USAGE_RECORDS, $params, $opts);
}
/**
* @param array|null $params
* @param array|string|null $options
*
* @return Collection The list of source transactions.
* @return Collection The list of usage record summaries.
*/
public function usageRecordSummaries($params = null, $options = null)
{
......
......@@ -30,7 +30,6 @@ namespace Stripe;
*/
class SubscriptionSchedule extends ApiResource