Skip to content
Closed
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
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 254
openapi_spec_hash: 55fb271eb29805e8a49ed72fb5ed8843
config_hash: f0e1844d06c76a9e145f7986d993dda6
configured_endpoints: 255
openapi_spec_hash: 6019a3e3d3a2af63a09125c5357f274c
config_hash: de151ebd21a0bd391662389b310a8f49
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/AccountStatements/AccountStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ final class AccountStatement implements BaseModel
public int $startingBalance;

/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the end of the period the Account Statement covers. The statement covers all transactions up to, but not including this timestamp. Usually, this is the beginning of the following month.
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the end of the period the Account Statement covers. The statement covers all transactions up to, but not including this timestamp. Statement periods are measured in UTC days, so this is usually midnight UTC on the first day of the following month.
*/
#[Required('statement_period_end')]
public \DateTimeInterface $statementPeriodEnd;

/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the start of the period the Account Statement covers. This is the first moment of the statement period and is inclusive. Usually, this is the beginning of the month this statement covers.
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the start of the period the Account Statement covers. This is the first moment of the statement period and is inclusive. Statement periods are measured in UTC days, so this is usually midnight UTC on the first day of the month this statement covers.
*/
#[Required('statement_period_start')]
public \DateTimeInterface $statementPeriodStart;
Expand Down Expand Up @@ -251,7 +251,7 @@ public function withStartingBalance(int $startingBalance): self
}

/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the end of the period the Account Statement covers. The statement covers all transactions up to, but not including this timestamp. Usually, this is the beginning of the following month.
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the end of the period the Account Statement covers. The statement covers all transactions up to, but not including this timestamp. Statement periods are measured in UTC days, so this is usually midnight UTC on the first day of the following month.
*/
public function withStatementPeriodEnd(
\DateTimeInterface $statementPeriodEnd
Expand All @@ -263,7 +263,7 @@ public function withStatementPeriodEnd(
}

/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the start of the period the Account Statement covers. This is the first moment of the statement period and is inclusive. Usually, this is the beginning of the month this statement covers.
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the start of the period the Account Statement covers. This is the first moment of the statement period and is inclusive. Statement periods are measured in UTC days, so this is usually midnight UTC on the first day of the month this statement covers.
*/
public function withStatementPeriodStart(
\DateTimeInterface $statementPeriodStart
Expand Down
29 changes: 29 additions & 0 deletions src/Cards/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Increase\Cards\Card\BillingAddress;
use Increase\Cards\Card\CardholderName;
use Increase\Cards\Card\DigitalWallet;
use Increase\Cards\Card\Renewal;
use Increase\Cards\Card\Status;
use Increase\Cards\Card\Type;
use Increase\Core\Attributes\Required;
Expand All @@ -21,6 +22,7 @@
* @phpstan-import-type BillingAddressShape from \Increase\Cards\Card\BillingAddress
* @phpstan-import-type CardholderNameShape from \Increase\Cards\Card\CardholderName
* @phpstan-import-type DigitalWalletShape from \Increase\Cards\Card\DigitalWallet
* @phpstan-import-type RenewalShape from \Increase\Cards\Card\Renewal
*
* @phpstan-type CardShape = array{
* id: string,
Expand All @@ -37,6 +39,7 @@
* expirationYear: int,
* idempotencyKey: string|null,
* last4: string,
* renewals: list<Renewal|RenewalShape>,
* status: Status|value-of<Status>,
* type: Type|value-of<Type>,
* }
Expand Down Expand Up @@ -130,6 +133,14 @@ final class Card implements BaseModel
#[Required]
public string $last4;

/**
* Completed renewals of this Card, sorted by `renewed_at` in ascending order. Each renewal records the expiration date the Card had before it was renewed.
*
* @var list<Renewal> $renewals
*/
#[Required(list: Renewal::class)]
public array $renewals;

/**
* This indicates if payments can be made with the card.
*
Expand Down Expand Up @@ -166,6 +177,7 @@ final class Card implements BaseModel
* expirationYear: ...,
* idempotencyKey: ...,
* last4: ...,
* renewals: ...,
* status: ...,
* type: ...,
* )
Expand All @@ -189,6 +201,7 @@ final class Card implements BaseModel
* ->withExpirationYear(...)
* ->withIdempotencyKey(...)
* ->withLast4(...)
* ->withRenewals(...)
* ->withStatus(...)
* ->withType(...)
* ```
Expand All @@ -207,6 +220,7 @@ public function __construct()
* @param BillingAddress|BillingAddressShape $billingAddress
* @param CardholderName|CardholderNameShape|null $cardholderName
* @param DigitalWallet|DigitalWalletShape|null $digitalWallet
* @param list<Renewal|RenewalShape> $renewals
* @param Status|value-of<Status> $status
* @param Type|value-of<Type> $type
*/
Expand All @@ -225,6 +239,7 @@ public static function with(
int $expirationYear,
?string $idempotencyKey,
string $last4,
array $renewals,
Status|string $status,
Type|string $type,
): self {
Expand All @@ -244,6 +259,7 @@ public static function with(
$self['expirationYear'] = $expirationYear;
$self['idempotencyKey'] = $idempotencyKey;
$self['last4'] = $last4;
$self['renewals'] = $renewals;
$self['status'] = $status;
$self['type'] = $type;

Expand Down Expand Up @@ -416,6 +432,19 @@ public function withLast4(string $last4): self
return $self;
}

/**
* Completed renewals of this Card, sorted by `renewed_at` in ascending order. Each renewal records the expiration date the Card had before it was renewed.
*
* @param list<Renewal|RenewalShape> $renewals
*/
public function withRenewals(array $renewals): self
{
$self = clone $this;
$self['renewals'] = $renewals;

return $self;
}

/**
* This indicates if payments can be made with the card.
*
Expand Down
118 changes: 118 additions & 0 deletions src/Cards/Card/Renewal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?php

declare(strict_types=1);

namespace Increase\Cards\Card;

use Increase\Core\Attributes\Required;
use Increase\Core\Concerns\SdkModel;
use Increase\Core\Contracts\BaseModel;

/**
* @phpstan-type RenewalShape = array{
* previousExpirationMonth: int,
* previousExpirationYear: int,
* renewedAt: \DateTimeInterface,
* }
*/
final class Renewal implements BaseModel
{
/** @use SdkModel<RenewalShape> */
use SdkModel;

/**
* The month the Card expired in before this renewal, in M format (e.g., August is 8).
*/
#[Required('previous_expiration_month')]
public int $previousExpirationMonth;

/**
* The year the Card expired in before this renewal, in YYYY format (e.g., 2025).
*/
#[Required('previous_expiration_year')]
public int $previousExpirationYear;

/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the Card was renewed.
*/
#[Required('renewed_at')]
public \DateTimeInterface $renewedAt;

/**
* `new Renewal()` is missing required properties by the API.
*
* To enforce required parameters use
* ```
* Renewal::with(
* previousExpirationMonth: ..., previousExpirationYear: ..., renewedAt: ...
* )
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new Renewal)
* ->withPreviousExpirationMonth(...)
* ->withPreviousExpirationYear(...)
* ->withRenewedAt(...)
* ```
*/
public function __construct()
{
$this->initialize();
}

/**
* Construct an instance from the required parameters.
*
* You must use named parameters to construct any parameters with a default value.
*/
public static function with(
int $previousExpirationMonth,
int $previousExpirationYear,
\DateTimeInterface $renewedAt,
): self {
$self = new self;

$self['previousExpirationMonth'] = $previousExpirationMonth;
$self['previousExpirationYear'] = $previousExpirationYear;
$self['renewedAt'] = $renewedAt;

return $self;
}

/**
* The month the Card expired in before this renewal, in M format (e.g., August is 8).
*/
public function withPreviousExpirationMonth(
int $previousExpirationMonth
): self {
$self = clone $this;
$self['previousExpirationMonth'] = $previousExpirationMonth;

return $self;
}

/**
* The year the Card expired in before this renewal, in YYYY format (e.g., 2025).
*/
public function withPreviousExpirationYear(
int $previousExpirationYear
): self {
$self = clone $this;
$self['previousExpirationYear'] = $previousExpirationYear;

return $self;
}

/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the Card was renewed.
*/
public function withRenewedAt(\DateTimeInterface $renewedAt): self
{
$self = clone $this;
$self['renewedAt'] = $renewedAt;

return $self;
}
}
2 changes: 1 addition & 1 deletion src/DigitalCardProfiles/DigitalCardProfileCloneParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Increase\DigitalCardProfiles\DigitalCardProfileCloneParams\TextColor;

/**
* Clones a Digital Card Profile.
* Clone a Digital Card Profile.
*
* @see Increase\Services\DigitalCardProfilesService::clone()
*
Expand Down
2 changes: 1 addition & 1 deletion src/DigitalCardProfiles/DigitalCardProfileListParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Increase\DigitalCardProfiles\DigitalCardProfileListParams\Status;

/**
* List Card Profiles.
* List Digital Card Profiles.
*
* @see Increase\Services\DigitalCardProfilesService::list()
*
Expand Down
4 changes: 2 additions & 2 deletions src/Entities/EntityCreateParams/Corporation.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ enum: BeneficialOwnershipExemptionReason::class,
public ?string $incorporationState;

/**
* The North American Industry Classification System (NAICS) code for the corporation's primary line of business. This is a number, like `5132` for `Software Publishers`. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
* The North American Industry Classification System (NAICS) code for the corporation's primary line of business. This is a number, like `5132` for `Software Publishers`. Increase uses the 2022 version of NAICS. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
*/
#[Optional('industry_code')]
public ?string $industryCode;
Expand Down Expand Up @@ -248,7 +248,7 @@ public function withIncorporationState(string $incorporationState): self
}

/**
* The North American Industry Classification System (NAICS) code for the corporation's primary line of business. This is a number, like `5132` for `Software Publishers`. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
* The North American Industry Classification System (NAICS) code for the corporation's primary line of business. This is a number, like `5132` for `Software Publishers`. Increase uses the 2022 version of NAICS. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
*/
public function withIndustryCode(string $industryCode): self
{
Expand Down
4 changes: 2 additions & 2 deletions src/Entities/EntityCreateParams/SoleProprietorship.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ final class SoleProprietorship implements BaseModel
public ?string $email;

/**
* The North American Industry Classification System (NAICS) code for the sole proprietorship's primary line of business. This is a number, like `5132` for `Software Publishers`. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
* The North American Industry Classification System (NAICS) code for the sole proprietorship's primary line of business. This is a number, like `5132` for `Software Publishers`. Increase uses the 2022 version of NAICS. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
*/
#[Optional('industry_code')]
public ?string $industryCode;
Expand Down Expand Up @@ -174,7 +174,7 @@ public function withEmail(string $email): self
}

/**
* The North American Industry Classification System (NAICS) code for the sole proprietorship's primary line of business. This is a number, like `5132` for `Software Publishers`. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
* The North American Industry Classification System (NAICS) code for the sole proprietorship's primary line of business. This is a number, like `5132` for `Software Publishers`. Increase uses the 2022 version of NAICS. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
*/
public function withIndustryCode(string $industryCode): self
{
Expand Down
4 changes: 2 additions & 2 deletions src/Entities/EntityUpdateParams/Corporation.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ final class Corporation implements BaseModel
public ?string $incorporationState;

/**
* The North American Industry Classification System (NAICS) code for the corporation's primary line of business. This is a number, like `5132` for `Software Publishers`. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
* The North American Industry Classification System (NAICS) code for the corporation's primary line of business. This is a number, like `5132` for `Software Publishers`. Increase uses the 2022 version of NAICS. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
*/
#[Optional('industry_code')]
public ?string $industryCode;
Expand Down Expand Up @@ -144,7 +144,7 @@ public function withIncorporationState(string $incorporationState): self
}

/**
* The North American Industry Classification System (NAICS) code for the corporation's primary line of business. This is a number, like `5132` for `Software Publishers`. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
* The North American Industry Classification System (NAICS) code for the corporation's primary line of business. This is a number, like `5132` for `Software Publishers`. Increase uses the 2022 version of NAICS. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
*/
public function withIndustryCode(string $industryCode): self
{
Expand Down
4 changes: 2 additions & 2 deletions src/Entities/EntityUpdateParams/SoleProprietorship.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final class SoleProprietorship implements BaseModel
public ?string $email;

/**
* The North American Industry Classification System (NAICS) code for the sole proprietorship's primary line of business. This is a number, like `5132` for `Software Publishers`. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
* The North American Industry Classification System (NAICS) code for the sole proprietorship's primary line of business. This is a number, like `5132` for `Software Publishers`. Increase uses the 2022 version of NAICS. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
*/
#[Optional('industry_code')]
public ?string $industryCode;
Expand Down Expand Up @@ -124,7 +124,7 @@ public function withEmail(string $email): self
}

/**
* The North American Industry Classification System (NAICS) code for the sole proprietorship's primary line of business. This is a number, like `5132` for `Software Publishers`. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
* The North American Industry Classification System (NAICS) code for the sole proprietorship's primary line of business. This is a number, like `5132` for `Software Publishers`. Increase uses the 2022 version of NAICS. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
*/
public function withIndustryCode(string $industryCode): self
{
Expand Down
4 changes: 2 additions & 2 deletions src/Exports/Export/AccountStatementBai2.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class AccountStatementBai2 implements BaseModel
public ?string $accountID;

/**
* The date for which to retrieve the balance.
* The UTC date for which to retrieve the balance.
*/
#[Required('effective_date')]
public ?string $effectiveDate;
Expand Down Expand Up @@ -91,7 +91,7 @@ public function withAccountID(?string $accountID): self
}

/**
* The date for which to retrieve the balance.
* The UTC date for which to retrieve the balance.
*/
public function withEffectiveDate(?string $effectiveDate): self
{
Expand Down
4 changes: 2 additions & 2 deletions src/Exports/Export/AccountVerificationLetter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class AccountVerificationLetter implements BaseModel
public string $accountNumberID;

/**
* The date of the balance to include in the letter.
* The UTC date of the balance to include in the letter.
*/
#[Required('balance_date')]
public ?string $balanceDate;
Expand Down Expand Up @@ -80,7 +80,7 @@ public function withAccountNumberID(string $accountNumberID): self
}

/**
* The date of the balance to include in the letter.
* The UTC date of the balance to include in the letter.
*/
public function withBalanceDate(?string $balanceDate): self
{
Expand Down
Loading
Loading