From 2cb7aaff1cf8c1176cf5a19f500eff23391db779 Mon Sep 17 00:00:00 2001
From: Richard Marmorstein If - If - If duplicate
, fraudulent
, order_change
, or product_unsatisfactory
* @property null|string|\Stripe\Refund $refund Refund related to this credit note.
+ * @property null|\Stripe\StripeObject $shipping_cost The details of the cost of shipping, including the ShippingRate applied to the invoice.
* @property string $status Status of this credit note, one of issued
or void
. Learn more about voiding credit notes.
* @property int $subtotal The integer amount in %s representing the amount of the credit note, excluding exclusive tax and invoice level discounts.
* @property null|int $subtotal_excluding_tax The integer amount in %s representing the amount of the credit note, excluding all tax and invoice level discounts.
diff --git a/lib/CustomerCashBalanceTransaction.php b/lib/CustomerCashBalanceTransaction.php
index 143875a4f..f492bb623 100644
--- a/lib/CustomerCashBalanceTransaction.php
+++ b/lib/CustomerCashBalanceTransaction.php
@@ -34,6 +34,7 @@ class CustomerCashBalanceTransaction extends ApiResource
const TYPE_APPLIED_TO_PAYMENT = 'applied_to_payment';
const TYPE_FUNDED = 'funded';
+ const TYPE_FUNDING_REVERSED = 'funding_reversed';
const TYPE_REFUNDED_FROM_PAYMENT = 'refunded_from_payment';
const TYPE_RETURN_CANCELED = 'return_canceled';
const TYPE_RETURN_INITIATED = 'return_initiated';
diff --git a/lib/Event.php b/lib/Event.php
index 360943f61..51731d54c 100644
--- a/lib/Event.php
+++ b/lib/Event.php
@@ -109,8 +109,10 @@ class Event extends ApiResource
const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated';
const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created';
const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted';
+ const CUSTOMER_SUBSCRIPTION_PAUSED = 'customer.subscription.paused';
const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_APPLIED = 'customer.subscription.pending_update_applied';
const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_EXPIRED = 'customer.subscription.pending_update_expired';
+ const CUSTOMER_SUBSCRIPTION_RESUMED = 'customer.subscription.resumed';
const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end';
const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated';
const CUSTOMER_TAX_ID_CREATED = 'customer.tax_id.created';
diff --git a/lib/Invoice.php b/lib/Invoice.php
index 490724256..eb5aa469b 100644
--- a/lib/Invoice.php
+++ b/lib/Invoice.php
@@ -49,6 +49,7 @@
* @property int $amount_due Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due
may be 0. If there is a positive starting_balance
for the invoice (the customer owes money), the amount_due
will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due
.
* @property int $amount_paid The amount, in %s, that was paid.
* @property int $amount_remaining The difference between amount_due and amount_paid, in %s.
+ * @property int $amount_shipping This is the sum of all the shipping amounts.
* @property null|string|\Stripe\StripeObject $application ID of the Connect Application that created the invoice.
* @property null|int $application_fee_amount The fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid.
* @property int $attempt_count Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule.
@@ -100,6 +101,8 @@
* @property null|string|\Stripe\Quote $quote The quote this invoice was generated from.
* @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this invoice.
* @property null|\Stripe\StripeObject $rendering_options Options for invoice PDF rendering.
+ * @property null|\Stripe\StripeObject $shipping_cost The details of the cost of shipping, including the ShippingRate applied on the invoice.
+ * @property null|\Stripe\StripeObject $shipping_details Shipping details for the invoice. The Invoice PDF will use the shipping_details
value if it is set, otherwise the PDF will render the shipping address from the customer.
* @property int $starting_balance Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice.
* @property null|string $statement_descriptor Extra information about an invoice for the customer's credit card statement.
* @property null|string $status The status of the invoice, one of draft
, open
, paid
, uncollectible
, or void
. Learn more
diff --git a/lib/PaymentLink.php b/lib/PaymentLink.php
index 5c3462e69..eeeecc4ff 100644
--- a/lib/PaymentLink.php
+++ b/lib/PaymentLink.php
@@ -30,6 +30,7 @@
* @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency.
* @property \Stripe\StripeObject $custom_text
* @property string $customer_creation Configuration for Customer creation during checkout.
+ * @property null|\Stripe\StripeObject $invoice_creation Configuration for creating invoice for payment mode payment links.
* @property \Stripe\Collection<\Stripe\LineItem> $line_items The line items representing what is being sold.
* @property bool $livemode Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
* @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
diff --git a/lib/Service/SubscriptionService.php b/lib/Service/SubscriptionService.php
index f81310c11..dcbc8e648 100644
--- a/lib/Service/SubscriptionService.php
+++ b/lib/Service/SubscriptionService.php
@@ -97,6 +97,27 @@ public function deleteDiscount($id, $params = null, $opts = null)
return $this->request('delete', $this->buildPath('/v1/subscriptions/%s/discount', $id), $params, $opts);
}
+ /**
+ * Initiates resumption of a paused subscription, optionally resetting the billing
+ * cycle anchor and creating prorations. If a resumption invoice is generated, it
+ * must be paid or marked uncollectible before the subscription will be unpaused.
+ * If payment succeeds the subscription will become active
, and if
+ * payment fails the subscription will be past_due
. The resumption
+ * invoice will void automatically if not paid by the expiration date.
+ *
+ * @param string $id
+ * @param null|array $params
+ * @param null|array|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Subscription
+ */
+ public function resume($id, $params = null, $opts = null)
+ {
+ return $this->request('post', $this->buildPath('/v1/subscriptions/%s/resume', $id), $params, $opts);
+ }
+
/**
* Retrieves the subscription with the given ID.
*
diff --git a/lib/StripeClient.php b/lib/StripeClient.php
index 5ae09360c..73522abc7 100644
--- a/lib/StripeClient.php
+++ b/lib/StripeClient.php
@@ -72,27 +72,12 @@ class StripeClient extends BaseStripeClient
*/
private $coreServiceFactory;
- /**
- * @param $name
- *
- * @return null|Service\AbstractService|Service\AbstractServiceFactory
- */
public function __get($name)
- {
- return $this->getService($name);
- }
-
- /**
- * @param $name
- *
- * @return null|Service\AbstractService|Service\AbstractServiceFactory
- */
- public function getService($name)
{
if (null === $this->coreServiceFactory) {
$this->coreServiceFactory = new \Stripe\Service\CoreServiceFactory($this);
}
- return $this->coreServiceFactory->getService($name);
+ return $this->coreServiceFactory->__get($name);
}
}
diff --git a/lib/Subscription.php b/lib/Subscription.php
index 0c7a8209b..29dd681f9 100644
--- a/lib/Subscription.php
+++ b/lib/Subscription.php
@@ -51,6 +51,7 @@
* @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this subscription belongs to.
* @property null|\Stripe\StripeObject $transfer_data The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
* @property null|int $trial_end If the subscription has a trial, the end of that trial.
+ * @property null|\Stripe\StripeObject $trial_settings Settings related to subscription trials.
* @property null|int $trial_start If the subscription has a trial, the beginning of that trial.
*/
class Subscription extends ApiResource
@@ -77,6 +78,7 @@ class Subscription extends ApiResource
const STATUS_INCOMPLETE = 'incomplete';
const STATUS_INCOMPLETE_EXPIRED = 'incomplete_expired';
const STATUS_PAST_DUE = 'past_due';
+ const STATUS_PAUSED = 'paused';
const STATUS_TRIALING = 'trialing';
const STATUS_UNPAID = 'unpaid';
@@ -130,6 +132,23 @@ public function cancel($params = null, $opts = null)
return $this;
}
+ /**
+ * @param null|array $params
+ * @param null|array|string $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Subscription the resumed subscription
+ */
+ public function resume($params = null, $opts = null)
+ {
+ $url = $this->instanceUrl() . '/resume';
+ list($response, $opts) = $this->_request('post', $url, $params, $opts);
+ $this->refreshFrom($response, $opts);
+
+ return $this;
+ }
+
/**
* @param null|array $params
* @param null|array|string $opts
From 17446f7c0da8052b71bfec4f0f75b4e585e6e3b2 Mon Sep 17 00:00:00 2001
From: Richard Marmorstein subcategory
.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property null|string $display_name A human-readable name that has been assigned to this account, either by the account holder or by the institution.
+ * @property null|\Stripe\StripeObject $inferred_balances_refresh The state of the most recent attempt to refresh the account's inferred balance history.
* @property string $institution_name The name of the institution that holds this account.
* @property null|string $last4 The last 4 digits of the account number. If present, this will be 4 numeric characters.
* @property bool $livemode Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
@@ -24,13 +25,16 @@
* @property null|string[] $permissions The list of permissions granted by this account.
* @property string $status The status of the link to the account.
* @property string $subcategory category
is cash
, one of:checking
- savings
- other
category
is credit
, one of:mortgage
- line_of_credit
- credit_card
- other
category
is investment
or other
, this will be other
.
Each key is a three-letter ISO currency code, in lowercase.
Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder.
+ */ +class InferredBalance extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'financial_connections.account_inferred_balance'; + + use \Stripe\ApiOperations\All; +} diff --git a/lib/FinancialConnections/Session.php b/lib/FinancialConnections/Session.php index 8d55cd06e..b7fc15a48 100644 --- a/lib/FinancialConnections/Session.php +++ b/lib/FinancialConnections/Session.php @@ -15,8 +15,12 @@ * @property string $client_secret A value that will be passed to the client to launch the authentication flow. * @property \Stripe\StripeObject $filters * @property bool $livemode Has the valuetrue
if the object exists in live mode or the value false
if the object exists in test mode.
+ * @property \Stripe\StripeObject $manual_entry
* @property string[] $permissions Permissions requested for accounts collected during this session.
+ * @property null|string[] $prefetch Data features requested to be retrieved upon account creation.
* @property string $return_url For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
+ * @property string $status The current state of the session.
+ * @property \Stripe\StripeObject $status_details
*/
class Session extends \Stripe\ApiResource
{
@@ -24,4 +28,9 @@ class Session extends \Stripe\ApiResource
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;
+
+ const STATUS_CANCELLED = 'cancelled';
+ const STATUS_FAILED = 'failed';
+ const STATUS_PENDING = 'pending';
+ const STATUS_SUCCEEDED = 'succeeded';
}
diff --git a/lib/FinancialConnections/Transaction.php b/lib/FinancialConnections/Transaction.php
new file mode 100644
index 000000000..ca522ec6f
--- /dev/null
+++ b/lib/FinancialConnections/Transaction.php
@@ -0,0 +1,33 @@
+ISO currency code, in lowercase. Must be a supported currency.
+ * @property string $description The description of this transaction.
+ * @property bool $livemode Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
+ * @property string $status The status of the transaction.
+ * @property \Stripe\StripeObject $status_transitions
+ * @property int $transacted_at Time at which the transaction was transacted. Measured in seconds since the Unix epoch.
+ * @property string $transaction_refresh The transaction_refresh object that last updated or created this transaction.
+ * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
+ */
+class Transaction extends \Stripe\ApiResource
+{
+ const OBJECT_NAME = 'financial_connections.transaction';
+
+ use \Stripe\ApiOperations\All;
+
+ const STATUS_PENDING = 'pending';
+ const STATUS_POSTED = 'posted';
+ const STATUS_VOID = 'void';
+}
diff --git a/lib/Service/FinancialConnections/AccountService.php b/lib/Service/FinancialConnections/AccountService.php
index 213d17271..734b4ce0c 100644
--- a/lib/Service/FinancialConnections/AccountService.php
+++ b/lib/Service/FinancialConnections/AccountService.php
@@ -21,6 +21,23 @@ public function all($params = null, $opts = null)
return $this->requestCollection('get', '/v1/financial_connections/accounts', $params, $opts);
}
+ /**
+ * Lists the recorded inferred balances for a Financial Connections
+ * Account
.
+ *
+ * @param string $parentId
+ * @param null|array $params
+ * @param null|array|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Collection<\Stripe\FinancialConnections\InferredBalance>
+ */
+ public function allInferredBalances($parentId, $params = null, $opts = null)
+ {
+ return $this->requestCollection('get', $this->buildPath('/v1/financial_connections/accounts/%s/inferred_balances', $parentId), $params, $opts);
+ }
+
/**
* Lists all owners for a given Account
.
*
diff --git a/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php b/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php
index 7dd826341..5c24c3236 100644
--- a/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php
+++ b/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php
@@ -9,6 +9,7 @@
*
* @property AccountService $accounts
* @property SessionService $sessions
+ * @property TransactionService $transactions
*/
class FinancialConnectionsServiceFactory extends \Stripe\Service\AbstractServiceFactory
{
@@ -18,6 +19,7 @@ class FinancialConnectionsServiceFactory extends \Stripe\Service\AbstractService
private static $classMap = [
'accounts' => AccountService::class,
'sessions' => SessionService::class,
+ 'transactions' => TransactionService::class,
];
protected function getServiceClass($name)
diff --git a/lib/Service/FinancialConnections/TransactionService.php b/lib/Service/FinancialConnections/TransactionService.php
new file mode 100644
index 000000000..ee010ef07
--- /dev/null
+++ b/lib/Service/FinancialConnections/TransactionService.php
@@ -0,0 +1,23 @@
+Transaction objects.
+ *
+ * @param null|array $params
+ * @param null|array|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Collection<\Stripe\FinancialConnections\Transaction>
+ */
+ public function all($params = null, $opts = null)
+ {
+ return $this->requestCollection('get', '/v1/financial_connections/transactions', $params, $opts);
+ }
+}
diff --git a/lib/Util/ObjectTypes.php b/lib/Util/ObjectTypes.php
index b997eb82f..2e63d3c46 100644
--- a/lib/Util/ObjectTypes.php
+++ b/lib/Util/ObjectTypes.php
@@ -49,7 +49,9 @@ class ObjectTypes
\Stripe\FinancialConnections\Account::OBJECT_NAME => \Stripe\FinancialConnections\Account::class,
\Stripe\FinancialConnections\AccountOwner::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwner::class,
\Stripe\FinancialConnections\AccountOwnership::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwnership::class,
+ \Stripe\FinancialConnections\InferredBalance::OBJECT_NAME => \Stripe\FinancialConnections\InferredBalance::class,
\Stripe\FinancialConnections\Session::OBJECT_NAME => \Stripe\FinancialConnections\Session::class,
+ \Stripe\FinancialConnections\Transaction::OBJECT_NAME => \Stripe\FinancialConnections\Transaction::class,
\Stripe\FundingInstructions::OBJECT_NAME => \Stripe\FundingInstructions::class,
\Stripe\GiftCards\Card::OBJECT_NAME => \Stripe\GiftCards\Card::class,
\Stripe\GiftCards\Transaction::OBJECT_NAME => \Stripe\GiftCards\Transaction::class,