-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48f0c4d
commit e2d825a
Showing
15 changed files
with
294 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v185 | ||
v196 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters