Skip to content

Commit

Permalink
Merge pull request #1780 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
stripe-openapi[bot] authored Oct 29, 2024
2 parents e4291a9 + 887b07d commit 82fb944
Show file tree
Hide file tree
Showing 19 changed files with 349 additions and 12 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 16.2.0 - 2024-10-29
* [#1772](https://github.com/stripe/stripe-php/pull/1772) Update generated code
* Add support for new resource `V2.EventDestinations`
* Add support for `create`, `retrieve`, `update`, `list`, `delete`, `disable`, `enable` and `ping` methods on resource `V2.EventDestinations`
* Add support for `submit_card` test helper method on resource `Issuing.Card`
* Add support for `groups` on `Account`
* Add support for `enhanced_eligibility_types` on `Dispute`
* Add support for new values `issuing_transaction.purchase_details_receipt_updated` and `refund.failed` on enum `Event.type`
* Add support for `metadata` on `Forwarding.Request`
* Add support for new value `alma` on enum `PaymentLink.payment_method_types[]`
* Add support for `alma` on `PaymentMethodConfiguration` and `PaymentMethod`
* Add support for `kakao_pay`, `kr_card`, `naver_pay`, `payco`, and `samsung_pay` on `PaymentMethod`
* Add support for new values `alma`, `kakao_pay`, `kr_card`, `naver_pay`, `payco`, and `samsung_pay` on enum `PaymentMethod.type`
* Add support for `amazon_pay` on `PaymentMethodDomain`
* Add support for new values `by_tin`, `ma_vat`, `md_vat`, `tz_vat`, `uz_tin`, and `uz_vat` on enum `TaxId.type`
* Add support for `flat_amount` and `rate_type` on `TaxRate`
* Add support for new value `retail_delivery_fee` on enum `TaxRate.tax_type`

## 16.2.0-beta.3 - 2024-10-18
* [#1774](https://github.com/stripe/stripe-php/pull/1774) Update generated code for beta
* Remove support for value `expired` from enum `Issuing.Authorization.status`
Expand Down Expand Up @@ -30,6 +48,15 @@
* the http method as parameter instead of the dedicated methods in the `Preview` class
* an `apiMode` of `v1` instead of `standard` and `v2` instead of `preview`.

## 16.1.1 - 2024-10-18
* [#1775](https://github.com/stripe/stripe-php/pull/1775) Deserialize into correct v2 EventData types
* Fixes a bug where v2 EventData was not being deserialized into the appropriate type for `V1BillingMeterErrorReportTriggeredEvent` and `V1BillingMeterNoMeterFoundEvent`
* [#1776](https://github.com/stripe/stripe-php/pull/1776) update object tags for meter-related classes

- fixes a bug where the `object` property of the `MeterEvent`, `MeterEventAdjustment`, and `MeterEventSession` didn't match the server.
* [#1773](https://github.com/stripe/stripe-php/pull/1773) Clean up examples
* [#1771](https://github.com/stripe/stripe-php/pull/1771) Renamed example file names

## 16.1.0 - 2024-10-03
* [#1765](https://github.com/stripe/stripe-php/pull/1765) Update generated code
* Remove the support for resource `Margin` that was accidentally made public in the last release
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1314
v1319
2 changes: 2 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@
require __DIR__ . '/lib/Service/V2/Billing/MeterEventSessionService.php';
require __DIR__ . '/lib/Service/V2/Billing/MeterEventStreamService.php';
require __DIR__ . '/lib/Service/V2/Core/CoreServiceFactory.php';
require __DIR__ . '/lib/Service/V2/Core/EventDestinationService.php';
require __DIR__ . '/lib/Service/V2/Core/EventService.php';
require __DIR__ . '/lib/Service/V2/V2ServiceFactory.php';
require __DIR__ . '/lib/Service/WebhookEndpointService.php';
Expand Down Expand Up @@ -417,6 +418,7 @@
require __DIR__ . '/lib/V2/Billing/MeterEvent.php';
require __DIR__ . '/lib/V2/Billing/MeterEventAdjustment.php';
require __DIR__ . '/lib/V2/Billing/MeterEventSession.php';
require __DIR__ . '/lib/V2/EventDestination.php';
require __DIR__ . '/lib/WebhookEndpoint.php';

// The end of the section generated from our OpenAPI spec
Expand Down
2 changes: 1 addition & 1 deletion lib/Dispute.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @property string|\Stripe\Charge $charge ID of the charge that's disputed.
* @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 null|string[] $enhanced_eligibility_types List of eligibility types that are included in <code>enhanced_evidence</code>.
* @property string[] $enhanced_eligibility_types List of eligibility types that are included in <code>enhanced_evidence</code>.
* @property \Stripe\StripeObject $evidence
* @property \Stripe\StripeObject $evidence_details
* @property bool $is_charge_refundable If true, it's still possible to refund the disputed payment. After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute.
Expand Down
1 change: 0 additions & 1 deletion lib/ErrorObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ class ErrorObject extends StripeObject
const CODE_PAYMENT_METHOD_UNEXPECTED_STATE = 'payment_method_unexpected_state';
const CODE_PAYMENT_METHOD_UNSUPPORTED_TYPE = 'payment_method_unsupported_type';
const CODE_PAYOUT_RECONCILIATION_NOT_READY = 'payout_reconciliation_not_ready';
const CODE_PAYOUT_STATEMENT_DESCRIPTOR_PROFANITY = 'payout_statement_descriptor_profanity';
const CODE_PAYOUTS_LIMIT_EXCEEDED = 'payouts_limit_exceeded';
const CODE_PAYOUTS_NOT_ALLOWED = 'payouts_not_allowed';
const CODE_PLATFORM_ACCOUNT_REQUIRED = 'platform_account_required';
Expand Down
2 changes: 2 additions & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ class Event extends ApiResource
const ISSUING_TOKEN_CREATED = 'issuing_token.created';
const ISSUING_TOKEN_UPDATED = 'issuing_token.updated';
const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created';
const ISSUING_TRANSACTION_PURCHASE_DETAILS_RECEIPT_UPDATED = 'issuing_transaction.purchase_details_receipt_updated';
const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated';
const MANDATE_UPDATED = 'mandate.updated';
const PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated';
Expand Down Expand Up @@ -469,6 +470,7 @@ class Event extends ApiResource
const TYPE_ISSUING_TOKEN_CREATED = 'issuing_token.created';
const TYPE_ISSUING_TOKEN_UPDATED = 'issuing_token.updated';
const TYPE_ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created';
const TYPE_ISSUING_TRANSACTION_PURCHASE_DETAILS_RECEIPT_UPDATED = 'issuing_transaction.purchase_details_receipt_updated';
const TYPE_ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated';
const TYPE_MANDATE_UPDATED = 'mandate.updated';
const TYPE_PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated';
Expand Down
15 changes: 13 additions & 2 deletions lib/Events/V1BillingMeterErrorReportTriggeredEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,26 @@ class V1BillingMeterErrorReportTriggeredEvent extends \Stripe\V2\Event
*/
public function fetchRelatedObject()
{
$apiMode = \Stripe\Util\Util::getApiMode($this->related_object->url);
list($object, $options) = $this->_request(
'get',
$this->related_object->url,
[],
['stripe_account' => $this->context],
[],
'v2'
$apiMode
);

return \Stripe\Util\Util::convertToStripeObject($object, $options, 'v2');
return \Stripe\Util\Util::convertToStripeObject($object, $options, $apiMode);
}

public static function constructFrom($values, $opts = null, $apiMode = 'v2')
{
$evt = parent::constructFrom($values, $opts, $apiMode);
if (null !== $evt->data) {
$evt->data = \Stripe\EventData\V1BillingMeterErrorReportTriggeredEventData::constructFrom($evt->data, $opts, $apiMode);
}

return $evt;
}
}
10 changes: 10 additions & 0 deletions lib/Events/V1BillingMeterNoMeterFoundEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,14 @@
class V1BillingMeterNoMeterFoundEvent extends \Stripe\V2\Event
{
const LOOKUP_TYPE = 'v1.billing.meter.no_meter_found';

public static function constructFrom($values, $opts = null, $apiMode = 'v2')
{
$evt = parent::constructFrom($values, $opts, $apiMode);
if (null !== $evt->data) {
$evt->data = \Stripe\EventData\V1BillingMeterNoMeterFoundEventData::constructFrom($evt->data, $opts, $apiMode);
}

return $evt;
}
}
18 changes: 18 additions & 0 deletions lib/PaymentIntent.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,24 @@ public function incrementAuthorization($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\PaymentIntent the triggered payment intent
*/
public static function triggerAction($params = null, $opts = null)
{
$url = '/v1/test/payment_intents/{intent}/trigger_action';
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}

/**
* @param null|array $params
* @param null|array|string $opts
Expand Down
2 changes: 2 additions & 0 deletions lib/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* @property null|\Stripe\StripeObject $giropay
* @property null|\Stripe\StripeObject $gopay
* @property null|\Stripe\StripeObject $grabpay
* @property null|\Stripe\StripeObject $id_bank_transfer
* @property null|\Stripe\StripeObject $ideal
* @property null|\Stripe\StripeObject $interac_present
* @property null|\Stripe\StripeObject $kakao_pay
Expand Down Expand Up @@ -104,6 +105,7 @@ class PaymentMethod extends ApiResource
const TYPE_GOPAY = 'gopay';
const TYPE_GRABPAY = 'grabpay';
const TYPE_IDEAL = 'ideal';
const TYPE_ID_BANK_TRANSFER = 'id_bank_transfer';
const TYPE_INTERAC_PRESENT = 'interac_present';
const TYPE_KAKAO_PAY = 'kakao_pay';
const TYPE_KLARNA = 'klarna';
Expand Down
4 changes: 4 additions & 0 deletions lib/PaymentMethodConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
* @property null|\Stripe\StripeObject $fpx
* @property null|\Stripe\StripeObject $giropay
* @property null|\Stripe\StripeObject $google_pay
* @property null|\Stripe\StripeObject $gopay
* @property null|\Stripe\StripeObject $grabpay
* @property null|\Stripe\StripeObject $id_bank_transfer
* @property null|\Stripe\StripeObject $ideal
* @property bool $is_default The default configuration is used whenever a payment method configuration is not specified.
* @property null|\Stripe\StripeObject $jcb
Expand All @@ -62,8 +64,10 @@
* @property null|\Stripe\StripeObject $paypal
* @property null|\Stripe\StripeObject $payto
* @property null|\Stripe\StripeObject $promptpay
* @property null|\Stripe\StripeObject $qris
* @property null|\Stripe\StripeObject $revolut_pay
* @property null|\Stripe\StripeObject $sepa_debit
* @property null|\Stripe\StripeObject $shopeepay
* @property null|\Stripe\StripeObject $sofort
* @property null|\Stripe\StripeObject $swish
* @property null|\Stripe\StripeObject $twint
Expand Down
3 changes: 1 addition & 2 deletions lib/Service/AccountService.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ public function createExternalAccount($parentId, $params = null, $opts = null)
}

/**
* Creates a single-use login link for a connected account to access the Express
* Dashboard.
* Creates a login link for a connected account to access the Express Dashboard.
*
* <strong>You can only create login links for accounts that use the <a
* href="/connect/express-dashboard">Express Dashboard</a> and are connected to
Expand Down
16 changes: 16 additions & 0 deletions lib/Service/PaymentIntentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,22 @@ public function search($params = null, $opts = null)
return $this->requestSearchResult('get', '/v1/payment_intents/search', $params, $opts);
}

/**
* Trigger an external action on a PaymentIntent.
*
* @param string $id
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\PaymentIntent
*/
public function triggerAction($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/test/payment_intents/%s/trigger_action', $id), $params, $opts);
}

/**
* Updates properties on a PaymentIntent object without confirming.
*
Expand Down
2 changes: 2 additions & 0 deletions lib/Service/V2/Core/CoreServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Service factory class for API resources in the root namespace.
* // Doc: The beginning of the section generated from our OpenAPI spec.
*
* @property EventDestinationService $eventDestinations
* @property EventService $events
* // Doc: The end of the section generated from our OpenAPI spec
*/
Expand All @@ -16,6 +17,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory
*/
private static $classMap = [
// Class Map: The beginning of the section generated from our OpenAPI spec
'eventDestinations' => EventDestinationService::class,
'events' => EventService::class,
// Class Map: The end of the section generated from our OpenAPI spec
];
Expand Down
138 changes: 138 additions & 0 deletions lib/Service/V2/Core/EventDestinationService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\V2\Core;

/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class EventDestinationService extends \Stripe\Service\AbstractService
{
/**
* Lists all event destinations.
*
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\V2\Collection<\Stripe\V2\EventDestination>
*/
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v2/core/event_destinations', $params, $opts);
}

/**
* Create a new event destination.
*
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\V2\EventDestination
*/
public function create($params = null, $opts = null)
{
return $this->request('post', '/v2/core/event_destinations', $params, $opts);
}

/**
* Delete an event destination.
*
* @param string $id
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\V2\EventDestination
*/
public function delete($id, $params = null, $opts = null)
{
return $this->request('delete', $this->buildPath('/v2/core/event_destinations/%s', $id), $params, $opts);
}

/**
* Disable an event destination.
*
* @param string $id
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\V2\EventDestination
*/
public function disable($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v2/core/event_destinations/%s/disable', $id), $params, $opts);
}

/**
* Enable an event destination.
*
* @param string $id
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\V2\EventDestination
*/
public function enable($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v2/core/event_destinations/%s/enable', $id), $params, $opts);
}

/**
* Send a `ping` event to an event destination.
*
* @param string $id
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\V2\Event
*/
public function ping($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v2/core/event_destinations/%s/ping', $id), $params, $opts);
}

/**
* Retrieves the details of an event destination.
*
* @param string $id
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\V2\EventDestination
*/
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v2/core/event_destinations/%s', $id), $params, $opts);
}

/**
* Update the details of an event destination.
*
* @param string $id
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\V2\EventDestination
*/
public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v2/core/event_destinations/%s', $id), $params, $opts);
}
}
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 = '2024-09-30.acacia';
const CURRENT = '2024-10-28.acacia';
}
Loading

0 comments on commit 82fb944

Please sign in to comment.