Skip to content

Commit

Permalink
Codegen for openapi v237
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym-stripe committed Mar 2, 2023
1 parent 407b026 commit 287ce73
Show file tree
Hide file tree
Showing 11 changed files with 222 additions and 0 deletions.
5 changes: 5 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@
require __DIR__ . '/lib/InvoiceLineItem.php';
require __DIR__ . '/lib/Issuing/Authorization.php';
require __DIR__ . '/lib/Issuing/Card.php';
require __DIR__ . '/lib/Issuing/CardBundle.php';
require __DIR__ . '/lib/Issuing/CardDesign.php';
require __DIR__ . '/lib/Issuing/CardDetails.php';
require __DIR__ . '/lib/Issuing/Cardholder.php';
require __DIR__ . '/lib/Issuing/Dispute.php';
Expand Down Expand Up @@ -234,6 +236,8 @@
require __DIR__ . '/lib/Service/InvoiceItemService.php';
require __DIR__ . '/lib/Service/Issuing/AuthorizationService.php';
require __DIR__ . '/lib/Service/Issuing/CardService.php';
require __DIR__ . '/lib/Service/Issuing/CardBundleService.php';
require __DIR__ . '/lib/Service/Issuing/CardDesignService.php';
require __DIR__ . '/lib/Service/Issuing/CardholderService.php';
require __DIR__ . '/lib/Service/Issuing/DisputeService.php';
require __DIR__ . '/lib/Service/Issuing/TransactionService.php';
Expand Down Expand Up @@ -276,6 +280,7 @@
require __DIR__ . '/lib/Service/Terminal/ReaderService.php';
require __DIR__ . '/lib/Service/TestHelpers/CustomerService.php';
require __DIR__ . '/lib/Service/TestHelpers/Issuing/CardService.php';
require __DIR__ . '/lib/Service/TestHelpers/Issuing/CardDesignService.php';
require __DIR__ . '/lib/Service/TestHelpers/RefundService.php';
require __DIR__ . '/lib/Service/TestHelpers/Terminal/ReaderService.php';
require __DIR__ . '/lib/Service/TestHelpers/TestClockService.php';
Expand Down
3 changes: 3 additions & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ class Event extends ApiResource
const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated';
const ISSUING_CARD_CREATED = 'issuing_card.created';
const ISSUING_CARD_UPDATED = 'issuing_card.updated';
const ISSUING_CARD_DESIGN_ACTIVATED = 'issuing_card_design.activated';
const ISSUING_CARD_DESIGN_DEACTIVATED = 'issuing_card_design.deactivated';
const ISSUING_CARD_DESIGN_UPDATED = 'issuing_card_design.updated';
const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created';
const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated';
const ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed';
Expand Down
1 change: 1 addition & 0 deletions lib/Issuing/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property string $brand The brand of the card.
* @property null|string $cancellation_reason The reason why the card was canceled.
* @property null|string|\Stripe\Issuing\CardDesign $card_design The card design object belonging to this card.
* @property \Stripe\Issuing\Cardholder $cardholder <p>An Issuing <code>Cardholder</code> object represents an individual or business entity who is <a href="https://stripe.com/docs/issuing">issued</a> cards.</p><p>Related guide: <a href="https://stripe.com/docs/issuing/cards#create-cardholder">How to create a Cardholder</a></p>
* @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. Supported currencies are <code>usd</code> in the US, <code>eur</code> in the EU, and <code>gbp</code> in the UK.
Expand Down
32 changes: 32 additions & 0 deletions lib/Issuing/CardBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Issuing;

/**
* A Card Bundle represents the bundle of physical items - card stock, carrier
* letter, and envelope - that is shipped to a cardholder when you create a
* physical card.
*
* @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 $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 $name Friendly display name.
* @property string $status Whether this card bundle can be used to create cards.
* @property string $type Whether this card bundle is a standard Stripe offering or custom-made for you.
*/
class CardBundle extends \Stripe\ApiResource
{
const OBJECT_NAME = 'issuing.card_bundle';

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

const STATUS_ACTIVE = 'active';
const STATUS_INACTIVE = 'inactive';
const STATUS_REVIEW = 'review';

const TYPE_CUSTOM = 'custom';
const TYPE_STANDARD = 'standard';
}
35 changes: 35 additions & 0 deletions lib/Issuing/CardDesign.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Issuing;

/**
* A Card Design is a logical grouping of a Card Bundle, card logo, and carrier
* text that represents a product line.
*
* @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 string|\Stripe\Issuing\CardBundle $card_bundle The card bundle object belonging to this card design.
* @property null|string $lookup_key A lookup key used to retrieve card designs dynamically from a static string. This may be up to 200 characters.
* @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 $name Friendly display name.
* @property string $preference Whether this card design is used to create cards when one is not specified.
* @property string $status Whether this card design can be used to create cards.
*/
class CardDesign extends \Stripe\ApiResource
{
const OBJECT_NAME = 'issuing.card_design';

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

const PREFERENCE_DEFAULT = 'default';
const PREFERENCE_NONE = 'none';

const STATUS_ACTIVE = 'active';
const STATUS_INACTIVE = 'inactive';
const STATUS_REJECTED = 'rejected';
const STATUS_REVIEW = 'review';
}
40 changes: 40 additions & 0 deletions lib/Service/Issuing/CardBundleService.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\Issuing;

class CardBundleService extends \Stripe\Service\AbstractService
{
/**
* Returns a list of card bundle objects. The objects are sorted in descending
* order by creation date, with the most recently created object 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\Issuing\CardBundle>
*/
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/issuing/card_bundles', $params, $opts);
}

/**
* Retrieves a card bundle object.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Issuing\CardBundle
*/
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/issuing/card_bundles/%s', $id), $params, $opts);
}
}
56 changes: 56 additions & 0 deletions lib/Service/Issuing/CardDesignService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\Issuing;

class CardDesignService extends \Stripe\Service\AbstractService
{
/**
* Returns a list of card design objects. The objects are sorted in descending
* order by creation date, with the most recently created object 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\Issuing\CardDesign>
*/
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/issuing/card_designs', $params, $opts);
}

/**
* Retrieves a card design object.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Issuing\CardDesign
*/
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/issuing/card_designs/%s', $id), $params, $opts);
}

/**
* Updates a card design object.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Issuing\CardDesign
*/
public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/issuing/card_designs/%s', $id), $params, $opts);
}
}
4 changes: 4 additions & 0 deletions lib/Service/Issuing/IssuingServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* Service factory class for API resources in the Issuing namespace.
*
* @property AuthorizationService $authorizations
* @property CardBundleService $cardBundles
* @property CardDesignService $cardDesigns
* @property CardholderService $cardholders
* @property CardService $cards
* @property DisputeService $disputes
Expand All @@ -20,6 +22,8 @@ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory
*/
private static $classMap = [
'authorizations' => AuthorizationService::class,
'cardBundles' => CardBundleService::class,
'cardDesigns' => CardDesignService::class,
'cardholders' => CardholderService::class,
'cards' => CardService::class,
'disputes' => DisputeService::class,
Expand Down
42 changes: 42 additions & 0 deletions lib/Service/TestHelpers/Issuing/CardDesignService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\TestHelpers\Issuing;

class CardDesignService extends \Stripe\Service\AbstractService
{
/**
* Updates the <code>status</code> of the specified testmode card design object to
* <code>active</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\Issuing\CardDesign
*/
public function activateTestmode($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/card_designs/%s/status/activate', $id), $params, $opts);
}

/**
* Updates the <code>status</code> of the specified testmode card design object to
* <code>inactive</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\Issuing\CardDesign
*/
public function deactivateTestmode($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/card_designs/%s/status/deactivate', $id), $params, $opts);
}
}
2 changes: 2 additions & 0 deletions lib/Service/TestHelpers/Issuing/IssuingServiceFactory.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 Issuing namespace.
*
* @property CardDesignService $cardDesigns
* @property CardService $cards
*/
class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory
Expand All @@ -15,6 +16,7 @@ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory
* @var array<string, string>
*/
private static $classMap = [
'cardDesigns' => CardDesignService::class,
'cards' => CardService::class,
];

Expand Down
2 changes: 2 additions & 0 deletions lib/Util/ObjectTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class ObjectTypes
\Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class,
\Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class,
\Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class,
\Stripe\Issuing\CardBundle::OBJECT_NAME => \Stripe\Issuing\CardBundle::class,
\Stripe\Issuing\CardDesign::OBJECT_NAME => \Stripe\Issuing\CardDesign::class,
\Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class,
\Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class,
\Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class,
Expand Down

0 comments on commit 287ce73

Please sign in to comment.