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 #1270

Merged
merged 3 commits into from
Apr 21, 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
1 change: 1 addition & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@
require __DIR__ . '/lib/Service/Terminal/ConnectionTokenService.php';
require __DIR__ . '/lib/Service/Terminal/LocationService.php';
require __DIR__ . '/lib/Service/Terminal/ReaderService.php';
require __DIR__ . '/lib/Service/TestHelpers/RefundService.php';
require __DIR__ . '/lib/Service/TestHelpers/Terminal/ReaderService.php';
require __DIR__ . '/lib/Service/TestHelpers/TestClockService.php';
require __DIR__ . '/lib/Service/TokenService.php';
Expand Down
2 changes: 1 addition & 1 deletion lib/BillingPortal/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property bool $active Whether the configuration is active and can be used to create portal sessions.
* @property null|string $application ID of the Connect Application that created the configuration.
* @property null|string|\Stripe\StripeObject $application ID of the Connect Application that created the configuration.
* @property \Stripe\StripeObject $business_profile
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property null|string $default_return_url The default URL to redirect customers to when they click on the portal's link to return to your website. This can be <a href="https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url">overriden</a> when creating the session.
Expand Down
2 changes: 1 addition & 1 deletion lib/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @property null|\Stripe\StripeObject $package_dimensions The dimensions of this product for shipping purposes.
* @property null|bool $shippable Whether this product is shipped (i.e., physical goods).
* @property null|string $statement_descriptor Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used.
* @property null|string|\Stripe\TaxCode $tax_code A <a href="https://stripe.com/docs/tax/tax-codes">tax code</a> ID.
* @property null|string|\Stripe\TaxCode $tax_code A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID.
* @property string $type The type of the product. The product is either of type <code>good</code>, which is eligible for use with Orders and SKUs, or <code>service</code>, which is eligible for use with Subscriptions and Plans.
* @property null|string $unit_label A label that represents units of this product in Stripe and on customers’ receipts and invoices. When set, this will be included in associated invoice line item descriptions.
* @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/CustomerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function createBalanceTransaction($parentId, $params = null, $opts = null
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\FundingInstructions
* @return \Stripe\Customer
*/
public function createFundingInstructions($id, $params = null, $opts = null)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/TaxCodeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class TaxCodeService extends \Stripe\Service\AbstractService
{
/**
* A list of <a href="https://stripe.com/docs/tax/tax-codes">all tax codes
* A list of <a href="https://stripe.com/docs/tax/tax-categories">all tax codes
* available</a> to add to Products in order to allow specific tax calculations.
*
* @param null|array $params
Expand Down
24 changes: 24 additions & 0 deletions lib/Service/TestHelpers/RefundService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\TestHelpers;

class RefundService extends \Stripe\Service\AbstractService
{
/**
* Expire a refund with a status of <code>requires_action</code>.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Refund
*/
public function expire($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/test_helpers/refunds/%s/expire', $id), $params, $opts);
}
}
2 changes: 2 additions & 0 deletions lib/Service/TestHelpers/TestHelpersServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/**
* Service factory class for API resources in the TestHelpers namespace.
*
* @property RefundService $refunds
* @property Terminal\TerminalServiceFactory $terminal
* @property TestClockService $testClocks
*/
Expand All @@ -16,6 +17,7 @@ class TestHelpersServiceFactory extends \Stripe\Service\AbstractServiceFactory
* @var array<string, string>
*/
private static $classMap = [
'refunds' => RefundService::class,
'terminal' => Terminal\TerminalServiceFactory::class,
'testClocks' => TestClockService::class,
];
Expand Down
2 changes: 1 addition & 1 deletion lib/ShippingRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @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 $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property null|string $tax_behavior Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of <code>inclusive</code>, <code>exclusive</code>, or <code>unspecified</code>.
* @property null|string|\Stripe\TaxCode $tax_code A <a href="https://stripe.com/docs/tax/tax-codes">tax code</a> ID. The Shipping tax code is <code>txcd_92010001</code>.
* @property null|string|\Stripe\TaxCode $tax_code A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. The Shipping tax code is <code>txcd_92010001</code>.
* @property string $type The type of calculation to use on the shipping rate. Can only be <code>fixed_amount</code> for now.
*/
class ShippingRate extends ApiResource
Expand Down
4 changes: 2 additions & 2 deletions lib/TaxCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Stripe;

/**
* <a href="https://stripe.com/docs/tax/tax-codes">Tax codes</a> classify goods and
* services for tax purposes.
* <a href="https://stripe.com/docs/tax/tax-categories">Tax codes</a> classify
* goods and services for tax purposes.
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
Expand Down
7 changes: 7 additions & 0 deletions tests/Stripe/GeneratedExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2815,4 +2815,11 @@ public function testDeleteConfiguration()
$result = $this->client->terminal->configurations->delete('uc_123', []);
static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result);
}

public function testExpireRefund()
{
$this->expectsRequest('post', '/v1/test_helpers/refunds/re_123/expire');
$result = $this->client->testHelpers->refunds->expire('re_123', []);
static::assertInstanceOf(\Stripe\Refund::class, $result);
}
}