Update Stripe API to 6.35
This commit is contained in:
parent
ced2c7383a
commit
fa5c5a3336
@ -35,7 +35,7 @@ Restler 3.0.0RC6 LGPL-3+ Yes
|
|||||||
TCPDF 6.2.25 LGPL-3+ Yes PDF generation
|
TCPDF 6.2.25 LGPL-3+ Yes PDF generation
|
||||||
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
||||||
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
|
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
|
||||||
Stripe 4.7.0 MIT licence Yes Library for Stripe module
|
Stripe 6.34.5 MIT licence Yes Library for Stripe module
|
||||||
|
|
||||||
JS libraries:
|
JS libraries:
|
||||||
jQuery 3.3.1 MIT License Yes JS library
|
jQuery 3.3.1 MIT License Yes JS library
|
||||||
|
|||||||
@ -1,5 +1,17 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 6.35.0 - 2019-05-14
|
||||||
|
* [#651](https://github.com/stripe/stripe-php/pull/651) Add support for the Capability resource and APIs
|
||||||
|
|
||||||
|
## 6.34.6 - 2019-05-13
|
||||||
|
* [#654](https://github.com/stripe/stripe-php/pull/654) Fix typo in definition of `Event::PAYMENT_METHOD_ATTACHED` constant
|
||||||
|
|
||||||
|
## 6.34.5 - 2019-05-06
|
||||||
|
* [#647](https://github.com/stripe/stripe-php/pull/647) Set the return type to static for more operations
|
||||||
|
|
||||||
|
## 6.34.4 - 2019-05-06
|
||||||
|
* [#650](https://github.com/stripe/stripe-php/pull/650) Add missing constants for Event types
|
||||||
|
|
||||||
## 6.34.3 - 2019-05-01
|
## 6.34.3 - 2019-05-01
|
||||||
* [#644](https://github.com/stripe/stripe-php/pull/644) Update return type to `static` to improve static analysis
|
* [#644](https://github.com/stripe/stripe-php/pull/644) Update return type to `static` to improve static analysis
|
||||||
* [#645](https://github.com/stripe/stripe-php/pull/645) Fix constant for `payment_intent.payment_failed`
|
* [#645](https://github.com/stripe/stripe-php/pull/645) Fix constant for `payment_intent.payment_failed`
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
6.34.3
|
6.35.0
|
||||||
|
|||||||
@ -67,6 +67,7 @@ require(dirname(__FILE__) . '/lib/BalanceTransaction.php');
|
|||||||
require(dirname(__FILE__) . '/lib/BankAccount.php');
|
require(dirname(__FILE__) . '/lib/BankAccount.php');
|
||||||
require(dirname(__FILE__) . '/lib/BitcoinReceiver.php');
|
require(dirname(__FILE__) . '/lib/BitcoinReceiver.php');
|
||||||
require(dirname(__FILE__) . '/lib/BitcoinTransaction.php');
|
require(dirname(__FILE__) . '/lib/BitcoinTransaction.php');
|
||||||
|
require(dirname(__FILE__) . '/lib/Capability.php');
|
||||||
require(dirname(__FILE__) . '/lib/Card.php');
|
require(dirname(__FILE__) . '/lib/Card.php');
|
||||||
require(dirname(__FILE__) . '/lib/Charge.php');
|
require(dirname(__FILE__) . '/lib/Charge.php');
|
||||||
require(dirname(__FILE__) . '/lib/Checkout/Session.php');
|
require(dirname(__FILE__) . '/lib/Checkout/Session.php');
|
||||||
|
|||||||
@ -85,6 +85,7 @@ class Account extends ApiResource
|
|||||||
return $savedNestedResources;
|
return $savedNestedResources;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const PATH_CAPABILITIES = '/capabilities';
|
||||||
const PATH_EXTERNAL_ACCOUNTS = '/external_accounts';
|
const PATH_EXTERNAL_ACCOUNTS = '/external_accounts';
|
||||||
const PATH_LOGIN_LINKS = '/login_links';
|
const PATH_LOGIN_LINKS = '/login_links';
|
||||||
const PATH_PERSONS = '/persons';
|
const PATH_PERSONS = '/persons';
|
||||||
@ -128,21 +129,6 @@ class Account extends ApiResource
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array|null $params
|
|
||||||
* @param array|string|null $options
|
|
||||||
*
|
|
||||||
* @return Collection The list of persons.
|
|
||||||
*/
|
|
||||||
public function persons($params = null, $options = null)
|
|
||||||
{
|
|
||||||
$url = $this->instanceUrl() . '/persons';
|
|
||||||
list($response, $opts) = $this->_request('get', $url, $params, $options);
|
|
||||||
$obj = Util\Util::convertToStripeObject($response, $opts);
|
|
||||||
$obj->setLastResponse($response);
|
|
||||||
return $obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array|null $clientId
|
* @param array|null $clientId
|
||||||
* @param array|string|null $opts
|
* @param array|string|null $opts
|
||||||
@ -158,6 +144,51 @@ class Account extends ApiResource
|
|||||||
return OAuth::deauthorize($params, $opts);
|
return OAuth::deauthorize($params, $opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Capabilities methods
|
||||||
|
* We can not add the capabilities() method today as the Account object already has a
|
||||||
|
* capabilities property which is a hash and not the sub-list of capabilities.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string|null $id The ID of the account to which the capability belongs.
|
||||||
|
* @param string|null $capabilityId The ID of the capability to retrieve.
|
||||||
|
* @param array|null $params
|
||||||
|
* @param array|string|null $opts
|
||||||
|
*
|
||||||
|
* @return Capability
|
||||||
|
*/
|
||||||
|
public static function retrieveCapability($id, $capabilityId, $params = null, $opts = null)
|
||||||
|
{
|
||||||
|
return self::_retrieveNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string|null $id The ID of the account to which the capability belongs.
|
||||||
|
* @param string|null $capabilityId The ID of the capability to update.
|
||||||
|
* @param array|null $params
|
||||||
|
* @param array|string|null $opts
|
||||||
|
*
|
||||||
|
* @return Capability
|
||||||
|
*/
|
||||||
|
public static function updateCapability($id, $capabilityId, $params = null, $opts = null)
|
||||||
|
{
|
||||||
|
return self::_updateNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string|null $id The ID of the account on which to retrieve the capabilities.
|
||||||
|
* @param array|null $params
|
||||||
|
* @param array|string|null $opts
|
||||||
|
*
|
||||||
|
* @return Collection The list of capabilities.
|
||||||
|
*/
|
||||||
|
public static function allCapabilities($id, $params = null, $opts = null)
|
||||||
|
{
|
||||||
|
return self::_allNestedResources($id, static::PATH_CAPABILITIES, $params, $opts);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|null $id The ID of the account on which to create the external account.
|
* @param string|null $id The ID of the account on which to create the external account.
|
||||||
* @param array|null $params
|
* @param array|null $params
|
||||||
@ -233,6 +264,21 @@ class Account extends ApiResource
|
|||||||
return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts);
|
return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array|null $params
|
||||||
|
* @param array|string|null $options
|
||||||
|
*
|
||||||
|
* @return Collection The list of persons.
|
||||||
|
*/
|
||||||
|
public function persons($params = null, $options = null)
|
||||||
|
{
|
||||||
|
$url = $this->instanceUrl() . '/persons';
|
||||||
|
list($response, $opts) = $this->_request('get', $url, $params, $options);
|
||||||
|
$obj = Util\Util::convertToStripeObject($response, $opts);
|
||||||
|
$obj->setLastResponse($response);
|
||||||
|
return $obj;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|null $id The ID of the account on which to create the person.
|
* @param string|null $id The ID of the account on which to create the person.
|
||||||
* @param array|null $params
|
* @param array|null $params
|
||||||
|
|||||||
@ -13,7 +13,7 @@ trait Create
|
|||||||
* @param array|null $params
|
* @param array|null $params
|
||||||
* @param array|string|null $options
|
* @param array|string|null $options
|
||||||
*
|
*
|
||||||
* @return \Stripe\ApiResource The created resource.
|
* @return static The created resource.
|
||||||
*/
|
*/
|
||||||
public static function create($params = null, $options = null)
|
public static function create($params = null, $options = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -13,7 +13,7 @@ trait Delete
|
|||||||
* @param array|null $params
|
* @param array|null $params
|
||||||
* @param array|string|null $opts
|
* @param array|string|null $opts
|
||||||
*
|
*
|
||||||
* @return \Stripe\ApiResource The deleted resource.
|
* @return static The deleted resource.
|
||||||
*/
|
*/
|
||||||
public function delete($params = null, $opts = null)
|
public function delete($params = null, $opts = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -15,7 +15,7 @@ trait Update
|
|||||||
* @param array|null $params
|
* @param array|null $params
|
||||||
* @param array|string|null $opts
|
* @param array|string|null $opts
|
||||||
*
|
*
|
||||||
* @return \Stripe\ApiResource The updated resource.
|
* @return static The updated resource.
|
||||||
*/
|
*/
|
||||||
public static function update($id, $params = null, $opts = null)
|
public static function update($id, $params = null, $opts = null)
|
||||||
{
|
{
|
||||||
@ -31,7 +31,7 @@ trait Update
|
|||||||
/**
|
/**
|
||||||
* @param array|string|null $opts
|
* @param array|string|null $opts
|
||||||
*
|
*
|
||||||
* @return \Stripe\ApiResource The saved resource.
|
* @return static The saved resource.
|
||||||
*/
|
*/
|
||||||
public function save($opts = null)
|
public function save($opts = null)
|
||||||
{
|
{
|
||||||
|
|||||||
83
htdocs/includes/stripe/lib/Capability.php
Normal file
83
htdocs/includes/stripe/lib/Capability.php
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Stripe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Capability
|
||||||
|
*
|
||||||
|
* @package Stripe
|
||||||
|
*
|
||||||
|
* @property string $id
|
||||||
|
* @property string $object
|
||||||
|
* @property string $account
|
||||||
|
* @property bool $requested
|
||||||
|
* @property int $requested_at
|
||||||
|
* @property mixed $requirements
|
||||||
|
* @property string $status
|
||||||
|
*/
|
||||||
|
class Capability extends ApiResource
|
||||||
|
{
|
||||||
|
|
||||||
|
const OBJECT_NAME = "capability";
|
||||||
|
|
||||||
|
use ApiOperations\Update;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Possible string representations of a capability's status.
|
||||||
|
* @link https://stripe.com/docs/api/capabilities/object#capability_object-status
|
||||||
|
*/
|
||||||
|
const STATUS_ACTIVE = 'active';
|
||||||
|
const STATUS_INACTIVE = 'inactive';
|
||||||
|
const STATUS_PENDING = 'pending';
|
||||||
|
const STATUS_UNREQUESTED = 'unrequested';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string The API URL for this Stripe account reversal.
|
||||||
|
*/
|
||||||
|
public function instanceUrl()
|
||||||
|
{
|
||||||
|
$id = $this['id'];
|
||||||
|
$account = $this['account'];
|
||||||
|
if (!$id) {
|
||||||
|
throw new Error\InvalidRequest(
|
||||||
|
"Could not determine which URL to request: " .
|
||||||
|
"class instance has invalid ID: $id",
|
||||||
|
null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$id = Util\Util::utf8($id);
|
||||||
|
$account = Util\Util::utf8($account);
|
||||||
|
|
||||||
|
$base = Account::classUrl();
|
||||||
|
$accountExtn = urlencode($account);
|
||||||
|
$extn = urlencode($id);
|
||||||
|
return "$base/$accountExtn/capabilities/$extn";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array|string $_id
|
||||||
|
* @param array|string|null $_opts
|
||||||
|
*
|
||||||
|
* @throws \Stripe\Error\InvalidRequest
|
||||||
|
*/
|
||||||
|
public static function retrieve($_id, $_opts = null)
|
||||||
|
{
|
||||||
|
$msg = "Capabilities cannot be accessed without an account ID. " .
|
||||||
|
"Retrieve a Capability using \$account->retrieveCapability('acap_123') instead.";
|
||||||
|
throw new Error\InvalidRequest($msg, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $_id
|
||||||
|
* @param array|null $_params
|
||||||
|
* @param array|string|null $_options
|
||||||
|
*
|
||||||
|
* @throws \Stripe\Error\InvalidRequest
|
||||||
|
*/
|
||||||
|
public static function update($_id, $_params = null, $_options = null)
|
||||||
|
{
|
||||||
|
$msg = "Capabilities cannot be accessed without an account ID. " .
|
||||||
|
"Update a Capability using \$account->updateCapability('acap_123') instead.";
|
||||||
|
throw new Error\InvalidRequest($msg, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -50,6 +50,7 @@ class Event extends ApiResource
|
|||||||
const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn';
|
const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn';
|
||||||
const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated';
|
const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated';
|
||||||
const CHARGE_REFUND_UPDATED = 'charge.refund.updated';
|
const CHARGE_REFUND_UPDATED = 'charge.refund.updated';
|
||||||
|
const CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed';
|
||||||
const COUPON_CREATED = 'coupon.created';
|
const COUPON_CREATED = 'coupon.created';
|
||||||
const COUPON_DELETED = 'coupon.deleted';
|
const COUPON_DELETED = 'coupon.deleted';
|
||||||
const COUPON_UPDATED = 'coupon.updated';
|
const COUPON_UPDATED = 'coupon.updated';
|
||||||
@ -75,6 +76,7 @@ class Event extends ApiResource
|
|||||||
const INVOICE_DELETED = 'invoice.deleted';
|
const INVOICE_DELETED = 'invoice.deleted';
|
||||||
const INVOICE_FINALIZED = 'invoice.finalized';
|
const INVOICE_FINALIZED = 'invoice.finalized';
|
||||||
const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible';
|
const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible';
|
||||||
|
const INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required';
|
||||||
const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed';
|
const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed';
|
||||||
const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded';
|
const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded';
|
||||||
const INVOICE_SENT = 'invoice.sent';
|
const INVOICE_SENT = 'invoice.sent';
|
||||||
@ -86,11 +88,14 @@ class Event extends ApiResource
|
|||||||
const INVOICEITEM_UPDATED = 'invoiceitem.updated';
|
const INVOICEITEM_UPDATED = 'invoiceitem.updated';
|
||||||
const ISSUER_FRAUD_RECORD_CREATED = 'issuer_fraud_record.created';
|
const ISSUER_FRAUD_RECORD_CREATED = 'issuer_fraud_record.created';
|
||||||
const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created';
|
const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created';
|
||||||
|
const ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request';
|
||||||
const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated';
|
const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated';
|
||||||
const ISSUING_CARD_CREATED = 'issuing_card.created';
|
const ISSUING_CARD_CREATED = 'issuing_card.created';
|
||||||
const ISSUING_CARD_UPDATED = 'issuing_card.updated';
|
const ISSUING_CARD_UPDATED = 'issuing_card.updated';
|
||||||
const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created';
|
const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created';
|
||||||
const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated';
|
const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated';
|
||||||
|
const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created';
|
||||||
|
const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated';
|
||||||
const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created';
|
const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created';
|
||||||
const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated';
|
const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated';
|
||||||
const ORDER_CREATED = 'order.created';
|
const ORDER_CREATED = 'order.created';
|
||||||
@ -102,6 +107,10 @@ class Event extends ApiResource
|
|||||||
const PAYMENT_INTENT_CREATED = 'payment_intent.created';
|
const PAYMENT_INTENT_CREATED = 'payment_intent.created';
|
||||||
const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed';
|
const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed';
|
||||||
const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded';
|
const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded';
|
||||||
|
const PAYMENT_METHOD_ATTACHED = 'payment_method.attached';
|
||||||
|
const PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED = 'payment_method.card_automatically_updated';
|
||||||
|
const PAYMENT_METHOD_DETACHED = 'payment_method.detached';
|
||||||
|
const PAYMENT_METHOD_UPDATED = 'payment_method.updated';
|
||||||
const PAYOUT_CANCELED = 'payout.canceled';
|
const PAYOUT_CANCELED = 'payout.canceled';
|
||||||
const PAYOUT_CREATED = 'payout.created';
|
const PAYOUT_CREATED = 'payout.created';
|
||||||
const PAYOUT_FAILED = 'payout.failed';
|
const PAYOUT_FAILED = 'payout.failed';
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class Stripe
|
|||||||
// @var float Initial delay between retries, in seconds
|
// @var float Initial delay between retries, in seconds
|
||||||
private static $initialNetworkRetryDelay = 0.5;
|
private static $initialNetworkRetryDelay = 0.5;
|
||||||
|
|
||||||
const VERSION = '6.34.3';
|
const VERSION = '6.35.0';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string The API key used for requests.
|
* @return string The API key used for requests.
|
||||||
|
|||||||
@ -80,6 +80,7 @@ abstract class Util
|
|||||||
\Stripe\BankAccount::OBJECT_NAME => 'Stripe\\BankAccount',
|
\Stripe\BankAccount::OBJECT_NAME => 'Stripe\\BankAccount',
|
||||||
\Stripe\BitcoinReceiver::OBJECT_NAME => 'Stripe\\BitcoinReceiver',
|
\Stripe\BitcoinReceiver::OBJECT_NAME => 'Stripe\\BitcoinReceiver',
|
||||||
\Stripe\BitcoinTransaction::OBJECT_NAME => 'Stripe\\BitcoinTransaction',
|
\Stripe\BitcoinTransaction::OBJECT_NAME => 'Stripe\\BitcoinTransaction',
|
||||||
|
\Stripe\Capability::OBJECT_NAME => 'Stripe\\Capability',
|
||||||
\Stripe\Card::OBJECT_NAME => 'Stripe\\Card',
|
\Stripe\Card::OBJECT_NAME => 'Stripe\\Card',
|
||||||
\Stripe\Charge::OBJECT_NAME => 'Stripe\\Charge',
|
\Stripe\Charge::OBJECT_NAME => 'Stripe\\Charge',
|
||||||
\Stripe\Checkout\Session::OBJECT_NAME => 'Stripe\\Checkout\\Session',
|
\Stripe\Checkout\Session::OBJECT_NAME => 'Stripe\\Checkout\\Session',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user