Skip to content

Commit

Permalink
Codegen for openapi v196
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym-stripe committed Sep 26, 2022
1 parent 48f0c4d commit e2d825a
Show file tree
Hide file tree
Showing 15 changed files with 294 additions and 5 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v185
v196
8 changes: 7 additions & 1 deletion init.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
require __DIR__ . '/lib/ApiOperations/Request.php';
require __DIR__ . '/lib/ApiOperations/Retrieve.php';
require __DIR__ . '/lib/ApiOperations/Search.php';
require __DIR__ . '/lib/ApiOperations/SingletonRetrieve.php';
require __DIR__ . '/lib/ApiOperations/Update.php';

// Plumbing
Expand Down Expand Up @@ -91,6 +90,9 @@
require __DIR__ . '/lib/BillingPortal/Configuration.php';
require __DIR__ . '/lib/BillingPortal/Session.php';
require __DIR__ . '/lib/Capability.php';
require __DIR__ . '/lib/Capital/FinancingOffer.php';
require __DIR__ . '/lib/Capital/FinancingSummary.php';
require __DIR__ . '/lib/Capital/FinancingTransaction.php';
require __DIR__ . '/lib/Card.php';
require __DIR__ . '/lib/CashBalance.php';
require __DIR__ . '/lib/Charge.php';
Expand Down Expand Up @@ -200,6 +202,9 @@
require __DIR__ . '/lib/Service/BalanceTransactionService.php';
require __DIR__ . '/lib/Service/BillingPortal/ConfigurationService.php';
require __DIR__ . '/lib/Service/BillingPortal/SessionService.php';
require __DIR__ . '/lib/Service/Capital/FinancingOfferService.php';
require __DIR__ . '/lib/Service/Capital/FinancingSummaryService.php';
require __DIR__ . '/lib/Service/Capital/FinancingTransactionService.php';
require __DIR__ . '/lib/Service/ChargeService.php';
require __DIR__ . '/lib/Service/Checkout/SessionService.php';
require __DIR__ . '/lib/Service/CountrySpecService.php';
Expand Down Expand Up @@ -287,6 +292,7 @@
// Service factories
require __DIR__ . '/lib/Service/Apps/AppsServiceFactory.php';
require __DIR__ . '/lib/Service/BillingPortal/BillingPortalServiceFactory.php';
require __DIR__ . '/lib/Service/Capital/CapitalServiceFactory.php';
require __DIR__ . '/lib/Service/Checkout/CheckoutServiceFactory.php';
require __DIR__ . '/lib/Service/CoreServiceFactory.php';
require __DIR__ . '/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php';
Expand Down
6 changes: 3 additions & 3 deletions lib/AccountSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@

/**
* An AccountSession allows a Connect platform to grant access to a connected
* account in Connect Elements.
* account in Connect Embedded UIs.
*
* We recommend that you create an AccountSession each time you need to display an
* embedded UI to your user. Do not save AccountSessions to your database as they
* expire relatively quickly, and cannot be used more than once.
*
* Related guide: <a
* href="https://stripe.com/docs/connect/get-started-connect-elements">Connect
* Elements</a>.
* Embedded UIs</a>.
*
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property string $account The ID of the account the AccountSession was created for
* @property string $client_secret <p>The client secret of this AccountSession. Used on the client to set up secure access to the given <code>account</code>.</p><p>The client secret can be used to provide access to <code>account</code> from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret.</p><p>Refer to our docs to <a href="https://stripe.com/docs/connect/get-started-connect-elements">setup Connect Elements</a> and learn about how <code>client_secret</code> should be handled.</p>
* @property string $client_secret <p>The client secret of this AccountSession. Used on the client to set up secure access to the given <code>account</code>.</p><p>The client secret can be used to provide access to <code>account</code> from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret.</p><p>Refer to our docs to <a href="https://stripe.com/docs/connect/get-started-connect-elements">setup Connect Embedded UIs</a> and learn about how <code>client_secret</code> should be handled.</p>
* @property int $expires_at The timestamp at which this AccountSession will expire.
* @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
67 changes: 67 additions & 0 deletions lib/Capital/FinancingOffer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Capital;

/**
* This is an object representing an offer of financing from Stripe Capital to a
* Connect subaccount.
*
* @property string $id A unique identifier for the financing object.
* @property string $object The object type: financing_offer.
* @property \Stripe\StripeObject $accepted_terms This is an object representing the terms of an offer of financing from Stripe Capital to a Connected account. This resource represents the terms accepted by the Connected account, which may differ from those offered.
* @property string $account The ID of the merchant associated with this financing object.
* @property int $created Time at which the offer was created. Given in seconds since unix epoch.
* @property float $expires_after Time at which the offer expires. Given in seconds since unix epoch.
* @property string $financing_type The type of financing being offered.
* @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 \Stripe\StripeObject $offered_terms This is an object representing the terms of an offer of financing from Stripe Capital to a Connected account. This resource represents both the terms offered to the Connected account.
* @property string $product_type Financing product identifier.
* @property string $status The current status of the offer.
* @property string $type See <a href="https://stripe.com/docs/api/capital/connect_financing_object#financing_offer_object-financing_type">financing_type</a>.
*/
class FinancingOffer extends \Stripe\ApiResource
{
const OBJECT_NAME = 'capital.financing_offer';

use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Retrieve;

const FINANCING_TYPE_CASH_ADVANCE = 'cash_advance';
const FINANCING_TYPE_FLEX_LOAN = 'flex_loan';

const PRODUCT_TYPE_REFILL = 'refill';
const PRODUCT_TYPE_STANDARD = 'standard';

const STATUS_ACCEPTED = 'accepted';
const STATUS_CANCELED = 'canceled';
const STATUS_COMPLETED = 'completed';
const STATUS_DELIVERED = 'delivered';
const STATUS_EXPIRED = 'expired';
const STATUS_FULLY_REPAID = 'fully_repaid';
const STATUS_PAID_OUT = 'paid_out';
const STATUS_REJECTED = 'rejected';
const STATUS_UNDELIVERED = 'undelivered';

const TYPE_CASH_ADVANCE = 'cash_advance';
const TYPE_FLEX_LOAN = 'flex_loan';

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Capital\FinancingOffer the marked financing offer
*/
public function markDelivered($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/mark_delivered';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);

return $this;
}
}
25 changes: 25 additions & 0 deletions lib/Capital/FinancingSummary.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Capital;

/**
* A financing object describes an account's current financing state. Used by
* Connect platforms to read the state of Capital offered to their connected
* accounts.
*
* @property string $object The object type: financing_summary
* @property null|\Stripe\StripeObject $details Additional information about the financing summary. Describes currency, advance amount, fee amount, withhold rate, remaining amount, paid amount, current repayment interval, repayment start date, and advance payout date.
* @property null|string $status Status of the Connected Account's financing. <a href="https://stripe.com/docs/api/capital/financing_summary">/v1/capital/financing_summary</a> will only return <code>details</code> for <code>paid_out</code> financing.
*/
class FinancingSummary extends \Stripe\SingletonApiResource
{
const OBJECT_NAME = 'capital.financing_summary';

use \Stripe\ApiOperations\SingletonRetrieve;

const STATUS_ACCEPTED = 'accepted';
const STATUS_DELIVERED = 'delivered';
const STATUS_NONE = 'none';
}
32 changes: 32 additions & 0 deletions lib/Capital/FinancingTransaction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Capital;

/**
* This is an object representing the details of a transaction on a Capital
* financing object.
*
* @property string $id A unique identifier for the financing transaction object.
* @property string $object The object type: financing_transaction
* @property string $account The ID of the merchant associated with this financing transaction.
* @property int $created_at Time at which the financing transaction was created. Given in seconds since unix epoch.
* @property \Stripe\StripeObject $details This is an object representing a transaction on a Capital financing offer.
* @property null|string $financing_offer The Capital financing offer for this financing transaction.
* @property string $legacy_balance_transaction_source The Capital transaction object that predates the Financing Transactions API and corresponds with the balance transaction that was created as a result of this financing transaction.
* @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 string $type The type of the financing transaction.
* @property null|string $user_facing_description A human-friendly description of the financing transaction.
*/
class FinancingTransaction extends \Stripe\ApiResource
{
const OBJECT_NAME = 'capital.financing_transaction';

use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Retrieve;

const TYPE_PAYMENT = 'payment';
const TYPE_PAYOUT = 'payout';
const TYPE_REVERSAL = 'reversal';
}
1 change: 1 addition & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class Event extends ApiResource
const BILLING_PORTAL_CONFIGURATION_UPDATED = 'billing_portal.configuration.updated';
const BILLING_PORTAL_SESSION_CREATED = 'billing_portal.session.created';
const CAPABILITY_UPDATED = 'capability.updated';
const CAPITAL_FINANCING_TRANSACTION_CREATED = 'capital.financing_transaction.created';
const CASH_BALANCE_FUNDS_AVAILABLE = 'cash_balance.funds_available';
const CHARGE_CAPTURED = 'charge.captured';
const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed';
Expand Down
1 change: 1 addition & 0 deletions lib/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
* @property \Stripe\StripeObject $oxxo
* @property \Stripe\StripeObject $p24
* @property \Stripe\StripeObject $paynow
* @property \Stripe\StripeObject $paypal
* @property \Stripe\StripeObject $pix
* @property \Stripe\StripeObject $promptpay
* @property \Stripe\StripeObject $radar_options Options to configure Radar. See <a href="https://stripe.com/docs/radar/radar-session">Radar Session</a> for more information.
Expand Down
29 changes: 29 additions & 0 deletions lib/Service/Capital/CapitalServiceFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\Capital;

/**
* Service factory class for API resources in the Capital namespace.
*
* @property FinancingOfferService $financingOffers
* @property FinancingSummaryService $financingSummary
* @property FinancingTransactionService $financingTransactions
*/
class CapitalServiceFactory extends \Stripe\Service\AbstractServiceFactory
{
/**
* @var array<string, string>
*/
private static $classMap = [
'financingOffers' => FinancingOfferService::class,
'financingSummary' => FinancingSummaryService::class,
'financingTransactions' => FinancingTransactionService::class,
];

protected function getServiceClass($name)
{
return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null;
}
}
58 changes: 58 additions & 0 deletions lib/Service/Capital/FinancingOfferService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\Capital;

class FinancingOfferService extends \Stripe\Service\AbstractService
{
/**
* Retrieves the financing offers available for Connected accounts that belong to
* your platform.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Capital\FinancingOffer>
*/
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/capital/financing_offers', $params, $opts);
}

/**
* Acknowledges that platform has received and delivered the financing_offer to the
* intended merchant recipient. This is required to make the application
* accessible.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Capital\FinancingOffer
*/
public function markDelivered($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/capital/financing_offers/%s/mark_delivered', $id), $params, $opts);
}

/**
* Get the details of the financing offer.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Capital\FinancingOffer
*/
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/capital/financing_offers/%s', $id), $params, $opts);
}
}
24 changes: 24 additions & 0 deletions lib/Service/Capital/FinancingSummaryService.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\Capital;

class FinancingSummaryService extends \Stripe\Service\AbstractService
{
/**
* Retrieve the financing state for the account that was authenticated in the
* request.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Capital\FinancingSummary
*/
public function retrieve($params = null, $opts = null)
{
return $this->request('get', '/v1/capital/financing_summary', $params, $opts);
}
}
40 changes: 40 additions & 0 deletions lib/Service/Capital/FinancingTransactionService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\Capital;

class FinancingTransactionService extends \Stripe\Service\AbstractService
{
/**
* Returns a list of financing transactions. The transactions are returned in
* sorted order, with the most recent transactions appearing first.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Capital\FinancingTransaction>
*/
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/capital/financing_transactions', $params, $opts);
}

/**
* Retrieves a financing transaction for a financing offer.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Capital\FinancingTransaction
*/
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/capital/financing_transactions/%s', $id), $params, $opts);
}
}
2 changes: 2 additions & 0 deletions lib/Service/CoreServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @property BalanceService $balance
* @property BalanceTransactionService $balanceTransactions
* @property BillingPortal\BillingPortalServiceFactory $billingPortal
* @property Capital\CapitalServiceFactory $capital
* @property ChargeService $charges
* @property Checkout\CheckoutServiceFactory $checkout
* @property CountrySpecService $countrySpecs
Expand Down Expand Up @@ -85,6 +86,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory
'balance' => BalanceService::class,
'balanceTransactions' => BalanceTransactionService::class,
'billingPortal' => BillingPortal\BillingPortalServiceFactory::class,
'capital' => Capital\CapitalServiceFactory::class,
'charges' => ChargeService::class,
'checkout' => Checkout\CheckoutServiceFactory::class,
'countrySpecs' => CountrySpecService::class,
Expand Down
1 change: 1 addition & 0 deletions lib/StripeClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @property \Stripe\Service\BalanceService $balance
* @property \Stripe\Service\BalanceTransactionService $balanceTransactions
* @property \Stripe\Service\BillingPortal\BillingPortalServiceFactory $billingPortal
* @property \Stripe\Service\Capital\CapitalServiceFactory $capital
* @property \Stripe\Service\ChargeService $charges
* @property \Stripe\Service\Checkout\CheckoutServiceFactory $checkout
* @property \Stripe\Service\CountrySpecService $countrySpecs
Expand Down
3 changes: 3 additions & 0 deletions lib/Util/ObjectTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class ObjectTypes
\Stripe\BillingPortal\Configuration::OBJECT_NAME => \Stripe\BillingPortal\Configuration::class,
\Stripe\BillingPortal\Session::OBJECT_NAME => \Stripe\BillingPortal\Session::class,
\Stripe\Capability::OBJECT_NAME => \Stripe\Capability::class,
\Stripe\Capital\FinancingOffer::OBJECT_NAME => \Stripe\Capital\FinancingOffer::class,
\Stripe\Capital\FinancingSummary::OBJECT_NAME => \Stripe\Capital\FinancingSummary::class,
\Stripe\Capital\FinancingTransaction::OBJECT_NAME => \Stripe\Capital\FinancingTransaction::class,
\Stripe\Card::OBJECT_NAME => \Stripe\Card::class,
\Stripe\CashBalance::OBJECT_NAME => \Stripe\CashBalance::class,
\Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class,
Expand Down

0 comments on commit e2d825a

Please sign in to comment.