Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Updates for beta branch #1320

Merged
merged 7 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 8.10.0 - 2022-07-07
* [#1319](https://github.com/stripe/stripe-php/pull/1319) API Updates
* Add support for `currency_options` on `Coupon` and `Price`
* Add support for `currency` on `Subscription`
* [#1318](https://github.com/stripe/stripe-php/pull/1318) API Updates
* Add support for new values financial_connections.account.created, financial_connections.account.deactivated, financial_connections.account.disconnected, financial_connections.account.reactivated, and financial_connections.account.refreshed_balance on `Event`.

## 8.9.0 - 2022-06-29
* [#1316](https://github.com/stripe/stripe-php/pull/1316) API Updates
* Add support for `deliver_card`, `fail_card`, `return_card`, and `ship_card` test helper methods on resource `Issuing.Card`
Expand All @@ -9,7 +16,7 @@
* Change type of `PaymentLink.payment_method_types[]` from `literal('card')` to `enum`
* Add support for `promptpay` on `PaymentMethod`
* Add support for new value `promptpay` on enum `PaymentMethod.type`
* Add support for `hosted_regulatory_receipt_url` and `reversal_details` on `Treasury.ReceivedCredit` and `Treasury.ReceivedDebit`
* Add support for `hosted_regulatory_receipt_url` and `reversal_details` on `Treasury.ReceivedCredit` and `Treasury.ReceivedDebit`

## 8.8.0 - 2022-06-23
* [#1302](https://github.com/stripe/stripe-php/pull/1302) API Updates
Expand Down Expand Up @@ -47,7 +54,6 @@
* Add support for `id_number_secondary_provided` on `Person`
* [#1295](https://github.com/stripe/stripe-php/pull/1295) API Updates


## 8.3.0 - 2022-05-23
* [#1294](https://github.com/stripe/stripe-php/pull/1294) API Updates
* Add support for new resource `Apps.Secret`
Expand Down Expand Up @@ -87,7 +93,6 @@
* Add support for `default_price` on `Product`
* Add support for `instructions_email` on `Refund`


## 7.127.0 - 2022-05-05
* [#1281](https://github.com/stripe/stripe-php/pull/1281) API Updates
* Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session`
Expand Down Expand Up @@ -118,7 +123,6 @@
* Add support for new value `customer_balance` on enum `PaymentMethod.type`
* Add support for `configuration_overrides` on `Terminal.Location`


## 7.123.0 - 2022-04-13
* [#1263](https://github.com/stripe/stripe-php/pull/1263) API Updates
* Add support for `increment_authorization` method on resource `PaymentIntent`
Expand Down Expand Up @@ -156,7 +160,6 @@
* Add support for new values `bg_uic`, `hu_tin`, and `si_tin` on enum `TaxId.type`
* Add `test_helpers.test_clock.advancing`, `test_helpers.test_clock.created`, `test_helpers.test_clock.deleted`, `test_helpers.test_clock.internal_failure`, and `test_helpers.test_clock.ready` events.


## 7.117.0 - 2022-03-18
* [#1254](https://github.com/stripe/stripe-php/pull/1254) API Updates
* Add support for `status` on `Card`
Expand All @@ -167,7 +170,6 @@
* [#1248](https://github.com/stripe/stripe-php/pull/1248) API Updates
* Add support for `proration_details` on `InvoiceLineItem`


## 7.115.0 - 2022-03-01
* [#1245](https://github.com/stripe/stripe-php/pull/1245) [#1247](https://github.com/stripe/stripe-php/pull/1247) API Updates
* Add support for new resource `TestHelpers.TestClock`
Expand All @@ -192,7 +194,6 @@
* Add support for `phone_number_collection` on `PaymentLink`
* Add support for new value `is_vat` on enum `TaxId.type`


## 7.111.0 - 2022-01-20
* [#1233](https://github.com/stripe/stripe-php/pull/1233) API Updates
* Add support for new resource `PaymentLink`
Expand Down Expand Up @@ -337,7 +338,6 @@
* [#1141](https://github.com/stripe/stripe-php/pull/1141) Update PHPDocs
* Add support for `url` on `Checkout\Session`


## 7.83.0 - 2021-06-07
* [#1140](https://github.com/stripe/stripe-php/pull/1140) API Updates
* Added support for `tax_id_collection` on `Checkout\Session` and `Checkout\Session#create`
Expand Down Expand Up @@ -405,7 +405,6 @@
* Add support for `nationality` on `Person`
* Add member `gb_vat` of `TaxID` enum


## 7.69.0 - 2021-01-21
* [#1079](https://github.com/stripe/stripe-php/pull/1079) Update PHPDocs

Expand Down Expand Up @@ -1727,3 +1726,4 @@ Pull requests included in this release:
- Add new Transfer resource
- Switch from using HTTP Basic auth to Bearer auth. (Note: Stripe will support Basic auth for the indefinite future, but recommends Bearer auth when possible going forward)
- Numerous test suite improvements

2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v161
v163
2 changes: 1 addition & 1 deletion lib/CashBalance.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* for payment and can eventually be paid out to your bank account.
*
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property null|\Stripe\StripeObject $available A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0.
* @property null|\Stripe\StripeObject $available A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
* @property string $customer The ID of the customer whose cash balance this object represents.
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
* @property \Stripe\StripeObject $settings
Expand Down
1 change: 1 addition & 0 deletions lib/Coupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* @property \Stripe\StripeObject $applies_to
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property null|string $currency If <code>amount_off</code> has been set, the three-letter <a href="https://stripe.com/docs/currencies">ISO code for the currency</a> of the amount to take off.
* @property \Stripe\StripeObject $currency_options Coupons defined in each available currency option. Each key must be a three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a> and a <a href="https://stripe.com/docs/currencies">supported currency</a>.
* @property string $duration One of <code>forever</code>, <code>once</code>, and <code>repeating</code>. Describes how long a customer who applies this coupon will get the discount.
* @property null|int $duration_in_months If <code>duration</code> is <code>repeating</code>, the number of months the coupon applies. Null if coupon <code>duration</code> is <code>forever</code> or <code>once</code>.
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
Expand Down
5 changes: 5 additions & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ class Event extends ApiResource
const CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated';
const CUSTOMER_UPDATED = 'customer.updated';
const FILE_CREATED = 'file.created';
const FINANCIAL_CONNECTIONS_ACCOUNT_CREATED = 'financial_connections.account.created';
const FINANCIAL_CONNECTIONS_ACCOUNT_DEACTIVATED = 'financial_connections.account.deactivated';
const FINANCIAL_CONNECTIONS_ACCOUNT_DISCONNECTED = 'financial_connections.account.disconnected';
const FINANCIAL_CONNECTIONS_ACCOUNT_REACTIVATED = 'financial_connections.account.reactivated';
const FINANCIAL_CONNECTIONS_ACCOUNT_REFRESHED_BALANCE = 'financial_connections.account.refreshed_balance';
const IDENTITY_VERIFICATION_SESSION_CANCELED = 'identity.verification_session.canceled';
const IDENTITY_VERIFICATION_SESSION_CREATED = 'identity.verification_session.created';
const IDENTITY_VERIFICATION_SESSION_PROCESSING = 'identity.verification_session.processing';
Expand Down
4 changes: 4 additions & 0 deletions lib/PaymentIntent.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
* @property null|\Stripe\StripeObject $processing If present, this property tells you about the processing state of the payment.
* @property null|string $receipt_email Email address that the receipt for the resulting payment will be sent to. If <code>receipt_email</code> is specified for a payment in live mode, a receipt will be sent regardless of your <a href="https://dashboard.stripe.com/account/emails">email settings</a>.
* @property null|string|\Stripe\Review $review ID of the review associated with this PaymentIntent, if any.
* @property string $secret_key_confirmation Indicates whether confirmation for this PaymentIntent using a secret key is <code>required</code> or <code>optional</code>.
* @property null|string $setup_future_usage <p>Indicates that you intend to make future payments with this PaymentIntent's payment method.</p><p>Providing this parameter will <a href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a> to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be <a href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after the transaction completes.</p><p>When processing card payments, Stripe also uses <code>setup_future_usage</code> to dynamically optimize your payment flow and comply with regional legislation and network rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.</p>
* @property null|\Stripe\StripeObject $shipping Shipping information for this PaymentIntent.
* @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied.
Expand All @@ -68,6 +69,9 @@ class PaymentIntent extends ApiResource
use ApiOperations\Search;
use ApiOperations\Update;

const SECRET_KEY_CONFIRMATION_OPTIONAL = 'optional';
const SECRET_KEY_CONFIRMATION_REQUIRED = 'required';

const STATUS_CANCELED = 'canceled';
const STATUS_PROCESSING = 'processing';
const STATUS_REQUIRES_ACTION = 'requires_action';
Expand Down
1 change: 1 addition & 0 deletions lib/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* @property string $billing_scheme Describes how to compute the price per period. Either <code>per_unit</code> or <code>tiered</code>. <code>per_unit</code> indicates that the fixed amount (specified in <code>unit_amount</code> or <code>unit_amount_decimal</code>) will be charged per unit in <code>quantity</code> (for prices with <code>usage_type=licensed</code>), or per unit of total usage (for prices with <code>usage_type=metered</code>). <code>tiered</code> indicates that the unit pricing will be computed using a tiering strategy as defined using the <code>tiers</code> and <code>tiers_mode</code> attributes.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
* @property \Stripe\StripeObject $currency_options Prices defined in each available currency option. Each key must be a three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a> and a <a href="https://stripe.com/docs/currencies">supported currency</a>.
* @property null|\Stripe\StripeObject $custom_unit_amount When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
* @property null|string $lookup_key A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/CustomerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public function updateBalanceTransaction($parentId, $id, $params = null, $opts =
}

/**
* Updates a customer’s cash balance.
* Changes the settings on a customer’s cash balance.
*
* @param string $parentId
* @param null|array $params
Expand Down
1 change: 1 addition & 0 deletions lib/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @property null|int $canceled_at If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with <code>cancel_at_period_end</code>, <code>canceled_at</code> will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
* @property string $collection_method Either <code>charge_automatically</code>, or <code>send_invoice</code>. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
* @property int $current_period_end End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.
* @property int $current_period_start Start of the current period that the subscription has been invoiced for.
* @property string|\Stripe\Customer $customer ID of the customer who owns the subscription.
Expand Down
2 changes: 1 addition & 1 deletion lib/Util/ApiVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

class ApiVersion
{
const CURRENT = '2020-08-27';
const CURRENT = '2020-08-27; server_side_confirmation_beta=v1';
}
29 changes: 28 additions & 1 deletion tests/Stripe/GeneratedExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ public function testRetrieveSession()
static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result);
}

public function testUpcomingInvoice()
{
$this->expectsRequest('get', '/v1/invoices/upcoming');
$result = $this->client->invoices->upcoming(
['customer' => 'cus_9utnxg47pWjV1e']
);
static::assertInstanceOf(\Stripe\Invoice::class, $result);
}

public function testCreateOrder()
{
$this->expectsRequest('post', '/v1/orders');
Expand Down Expand Up @@ -320,6 +329,24 @@ public function testListLineItemsPaymentLink()
static::assertInstanceOf(\Stripe\LineItem::class, $result->data[0]);
}

public function testCreatePrice()
{
$this->expectsRequest('post', '/v1/prices');
$result = $this->client->prices->create(
[
'unit_amount' => 2000,
'currency' => 'usd',
'currency_options' => [
'uah' => ['unit_amount' => 5000],
'eur' => ['unit_amount' => 1800],
],
'recurring' => ['interval' => 'month'],
'product' => 'prod_xxxxxxxxxxxxx',
]
);
static::assertInstanceOf(\Stripe\Price::class, $result);
}

public function testListSetupAttempt()
{
$this->expectsRequest('get', '/v1/setup_attempts');
Expand Down Expand Up @@ -2303,7 +2330,7 @@ public function testListPrice()
static::assertInstanceOf(\Stripe\Price::class, $result->data[0]);
}

public function testCreatePrice()
public function testCreatePrice2()
{
$this->expectsRequest('post', '/v1/prices');
$result = $this->client->prices->create(
Expand Down