diff --git a/.github/workflows/publish-packagist.yml b/.github/workflows/publish-packagist.yml index 613b464c..0cd6b005 100644 --- a/.github/workflows/publish-packagist.yml +++ b/.github/workflows/publish-packagist.yml @@ -15,7 +15,7 @@ jobs: - name: Publish to Packagist run: |- - curl --fail-with-body -X POST -H 'Content-Type: application/json' "https://packagist.org/api/update-package?username=${PACKAGIST_USERNAME}&apiToken=${PACKAGIST_SAFE_KEY}" -d '{"repository":"https://www.github.com/Increase/increase-php"}' + curl --fail-with-body -X POST -H 'Content-Type: application/json' "https://packagist.org/api/update-package?username=${PACKAGIST_USERNAME}&apiToken=${PACKAGIST_SAFE_KEY}" -d '{"repository":"https://github.com/Increase/increase-php"}' env: PACKAGIST_USERNAME: ${{ secrets.INCREASE_PACKAGIST_USERNAME || secrets.PACKAGIST_USERNAME }} PACKAGIST_SAFE_KEY: ${{ secrets.INCREASE_PACKAGIST_SAFE_KEY || secrets.PACKAGIST_SAFE_KEY }} \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bd115b20..58ebf7f2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.122.0" + ".": "0.123.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 6f61c3b1..fd8a5981 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 236 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-47752267c48d299a01c906499bb7d584228ea8801b7d83e34ae4100d5dec3434.yml -openapi_spec_hash: 9ea8bc6dc383de626d3fa15c823227ae -config_hash: 026e2baa580c7f5f2447c24332081ba8 +configured_endpoints: 238 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase/increase-eaee3db1b6a076bc5c49879e3b3154e5ae466d0fd278917a3835f4ed0c9cce63.yml +openapi_spec_hash: 34a379fd12fbaa209f10dde757ede478 +config_hash: ac050010e5453883d5e5fa603554a2e0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 305db21c..a15ddbaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.123.0 (2026-05-06) + +Full Changelog: [v0.122.0...v0.123.0](https://github.com/Increase/increase-php/compare/v0.122.0...v0.123.0) + +### Features + +* **api:** api update ([6c75d27](https://github.com/Increase/increase-php/commit/6c75d2796e11f6267a39264be808a4e0edfb7d64)) + + +### Chores + +* remove custom code ([2279e9b](https://github.com/Increase/increase-php/commit/2279e9b43ad6569e7ab92365d69289bfbeaef1dc)) + ## 0.122.0 (2026-04-27) Full Changelog: [v0.121.1...v0.122.0](https://github.com/Increase/increase-php/compare/v0.121.1...v0.122.0) diff --git a/README.md b/README.md index e7890a38..fce879ee 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d ``` -composer require "increase/increase 0.122.0" +composer require "increase/increase 0.123.0" ``` @@ -87,7 +87,7 @@ use Increase\Core\Exceptions\RateLimitException; use Increase\Core\Exceptions\APIStatusException; try { - $account = $client->accounts->create(name: 'New Account!'); + $account = $client->accounts->create(name: 'Oops'); } catch (APIConnectionException $e) { echo "The server could not be reached", PHP_EOL; var_dump($e->getPrevious()); @@ -157,9 +157,7 @@ $file = $client->files->create( ); // Pass in only a string (where applicable) -$file = $client->files->create( - file: 'Example data', purpose: 'check_image_front' -); +$file = $client->files->create(file: 'check.png', purpose: 'check_image_front'); // Pass an open resource: $fd = fopen('my/file.txt', 'r'); diff --git a/src/ACHTransfers/ACHTransferCreateParams/Addenda/Freeform.php b/src/ACHTransfers/ACHTransferCreateParams/Addenda/Freeform.php index 639bca0f..882eaf66 100644 --- a/src/ACHTransfers/ACHTransferCreateParams/Addenda/Freeform.php +++ b/src/ACHTransfers/ACHTransferCreateParams/Addenda/Freeform.php @@ -22,7 +22,7 @@ final class Freeform implements BaseModel use SdkModel; /** - * Each entry represents an addendum sent with the transfer. In general, you should send at most one addendum–most ACH recipients cannot access beyond the first 80 characters sent. Please reach out to [support@increase.com](mailto:support@increase.com) to send 2 or more addenda to a recipient expecting a specific addendum format. + * Each entry represents an addendum sent with the transfer. Sending more than one addendum is only supported for transfers with `standard_entry_class_code` of `corporate_trade_exchange` (CTX). * * @var list $entries */ @@ -65,7 +65,7 @@ public static function with(array $entries): self } /** - * Each entry represents an addendum sent with the transfer. In general, you should send at most one addendum–most ACH recipients cannot access beyond the first 80 characters sent. Please reach out to [support@increase.com](mailto:support@increase.com) to send 2 or more addenda to a recipient expecting a specific addendum format. + * Each entry represents an addendum sent with the transfer. Sending more than one addendum is only supported for transfers with `standard_entry_class_code` of `corporate_trade_exchange` (CTX). * * @param list $entries */ diff --git a/src/BeneficialOwners/BeneficialOwnerCreateParams/Individual/Identification.php b/src/BeneficialOwners/BeneficialOwnerCreateParams/Individual/Identification.php index e945b0af..9df3bfde 100644 --- a/src/BeneficialOwners/BeneficialOwnerCreateParams/Individual/Identification.php +++ b/src/BeneficialOwners/BeneficialOwnerCreateParams/Individual/Identification.php @@ -42,7 +42,7 @@ final class Identification implements BaseModel public string $method; /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ #[Required] public string $number; @@ -127,7 +127,7 @@ public function withMethod(Method|string $method): self } /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ public function withNumber(string $number): self { diff --git a/src/BeneficialOwners/BeneficialOwnerUpdateParams/Identification.php b/src/BeneficialOwners/BeneficialOwnerUpdateParams/Identification.php index bb82f5d2..816ccef9 100644 --- a/src/BeneficialOwners/BeneficialOwnerUpdateParams/Identification.php +++ b/src/BeneficialOwners/BeneficialOwnerUpdateParams/Identification.php @@ -42,7 +42,7 @@ final class Identification implements BaseModel public string $method; /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ #[Required] public string $number; @@ -127,7 +127,7 @@ public function withMethod(Method|string $method): self } /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ public function withNumber(string $number): self { diff --git a/src/Client.php b/src/Client.php index e1087753..f780fb1e 100644 --- a/src/Client.php +++ b/src/Client.php @@ -154,12 +154,12 @@ class Client extends BaseClient /** * @api */ - public ACHPrenotificationsService $achPrenotifications; + public InboundACHTransfersService $inboundACHTransfers; /** * @api */ - public InboundACHTransfersService $inboundACHTransfers; + public ACHPrenotificationsService $achPrenotifications; /** * @api @@ -389,18 +389,31 @@ public function __construct( $requestOptions, ); + /** @var array $headers */ + $headers = [ + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'User-Agent' => sprintf('increase/PHP %s', VERSION), + 'X-Stainless-Lang' => 'php', + 'X-Stainless-Package-Version' => '0.122.0', + 'X-Stainless-Arch' => Util::machtype(), + 'X-Stainless-OS' => Util::ostype(), + 'X-Stainless-Runtime' => php_sapi_name(), + 'X-Stainless-Runtime-Version' => phpversion(), + ]; + + $customHeadersEnv = Util::getenv('INCREASE_CUSTOM_HEADERS'); + if (null !== $customHeadersEnv) { + foreach (explode("\n", $customHeadersEnv) as $line) { + $colon = strpos($line, ':'); + if (false !== $colon) { + $headers[trim(substr($line, 0, $colon))] = trim(substr($line, $colon + 1)); + } + } + } + parent::__construct( - headers: [ - 'Content-Type' => 'application/json', - 'Accept' => 'application/json', - 'User-Agent' => sprintf('increase/PHP %s', VERSION), - 'X-Stainless-Lang' => 'php', - 'X-Stainless-Package-Version' => '0.0.1', - 'X-Stainless-Arch' => Util::machtype(), - 'X-Stainless-OS' => Util::ostype(), - 'X-Stainless-Runtime' => php_sapi_name(), - 'X-Stainless-Runtime-Version' => phpversion(), - ], + headers: $headers, baseUrl: $baseUrl, options: $options, idempotencyHeader: 'Idempotency-Key' @@ -421,8 +434,8 @@ public function __construct( $this->pendingTransactions = new PendingTransactionsService($this); $this->declinedTransactions = new DeclinedTransactionsService($this); $this->achTransfers = new ACHTransfersService($this); - $this->achPrenotifications = new ACHPrenotificationsService($this); $this->inboundACHTransfers = new InboundACHTransfersService($this); + $this->achPrenotifications = new ACHPrenotificationsService($this); $this->wireTransfers = new WireTransfersService($this); $this->inboundWireTransfers = new InboundWireTransfersService($this); $this->wireDrawdownRequests = new WireDrawdownRequestsService($this); diff --git a/src/Entities/EntityCreateParams/Corporation.php b/src/Entities/EntityCreateParams/Corporation.php index 0fa973f3..a11668dc 100644 --- a/src/Entities/EntityCreateParams/Corporation.php +++ b/src/Entities/EntityCreateParams/Corporation.php @@ -93,7 +93,7 @@ enum: BeneficialOwnershipExemptionReason::class, public ?string $industryCode; /** - * The website of the corporation. + * A website for the business. Not every program requires a website for submitted Entities. */ #[Optional] public ?string $website; @@ -259,7 +259,7 @@ public function withIndustryCode(string $industryCode): self } /** - * The website of the corporation. + * A website for the business. Not every program requires a website for submitted Entities. */ public function withWebsite(string $website): self { diff --git a/src/Entities/EntityCreateParams/Corporation/BeneficialOwner/Individual/Identification.php b/src/Entities/EntityCreateParams/Corporation/BeneficialOwner/Individual/Identification.php index 4b886ae6..b0d6db92 100644 --- a/src/Entities/EntityCreateParams/Corporation/BeneficialOwner/Individual/Identification.php +++ b/src/Entities/EntityCreateParams/Corporation/BeneficialOwner/Individual/Identification.php @@ -42,7 +42,7 @@ final class Identification implements BaseModel public string $method; /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ #[Required] public string $number; @@ -127,7 +127,7 @@ public function withMethod(Method|string $method): self } /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ public function withNumber(string $number): self { diff --git a/src/Entities/EntityCreateParams/Corporation/LegalIdentifier.php b/src/Entities/EntityCreateParams/Corporation/LegalIdentifier.php index 649b6deb..34c4192f 100644 --- a/src/Entities/EntityCreateParams/Corporation/LegalIdentifier.php +++ b/src/Entities/EntityCreateParams/Corporation/LegalIdentifier.php @@ -23,7 +23,7 @@ final class LegalIdentifier implements BaseModel use SdkModel; /** - * The legal identifier. + * The legal identifier. For US Employer Identification Numbers, submit nine digits with no dashes or other separators. */ #[Required] public string $value; @@ -76,7 +76,7 @@ public static function with( } /** - * The legal identifier. + * The legal identifier. For US Employer Identification Numbers, submit nine digits with no dashes or other separators. */ public function withValue(string $value): self { diff --git a/src/Entities/EntityCreateParams/GovernmentAuthority.php b/src/Entities/EntityCreateParams/GovernmentAuthority.php index 36501a7d..84589c4c 100644 --- a/src/Entities/EntityCreateParams/GovernmentAuthority.php +++ b/src/Entities/EntityCreateParams/GovernmentAuthority.php @@ -61,13 +61,13 @@ final class GovernmentAuthority implements BaseModel public string $name; /** - * The Employer Identification Number (EIN) for the government authority. + * The Employer Identification Number (EIN) for the government authority. Submit nine digits with no dashes or other separators. */ #[Required('tax_identifier')] public string $taxIdentifier; /** - * The website of the government authority. + * A website for the government authority. Not every program requires a website for submitted Entities. */ #[Optional] public ?string $website; @@ -183,7 +183,7 @@ public function withName(string $name): self } /** - * The Employer Identification Number (EIN) for the government authority. + * The Employer Identification Number (EIN) for the government authority. Submit nine digits with no dashes or other separators. */ public function withTaxIdentifier(string $taxIdentifier): self { @@ -194,7 +194,7 @@ public function withTaxIdentifier(string $taxIdentifier): self } /** - * The website of the government authority. + * A website for the government authority. Not every program requires a website for submitted Entities. */ public function withWebsite(string $website): self { diff --git a/src/Entities/EntityCreateParams/Joint/Individual/Identification.php b/src/Entities/EntityCreateParams/Joint/Individual/Identification.php index abdbacb4..f1e5a97c 100644 --- a/src/Entities/EntityCreateParams/Joint/Individual/Identification.php +++ b/src/Entities/EntityCreateParams/Joint/Individual/Identification.php @@ -42,7 +42,7 @@ final class Identification implements BaseModel public string $method; /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ #[Required] public string $number; @@ -127,7 +127,7 @@ public function withMethod(Method|string $method): self } /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ public function withNumber(string $number): self { diff --git a/src/Entities/EntityCreateParams/NaturalPerson/Identification.php b/src/Entities/EntityCreateParams/NaturalPerson/Identification.php index a5c1de95..c77a0d23 100644 --- a/src/Entities/EntityCreateParams/NaturalPerson/Identification.php +++ b/src/Entities/EntityCreateParams/NaturalPerson/Identification.php @@ -42,7 +42,7 @@ final class Identification implements BaseModel public string $method; /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ #[Required] public string $number; @@ -127,7 +127,7 @@ public function withMethod(Method|string $method): self } /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ public function withNumber(string $number): self { diff --git a/src/Entities/EntityCreateParams/Trust.php b/src/Entities/EntityCreateParams/Trust.php index 03a4db78..4ebf73de 100644 --- a/src/Entities/EntityCreateParams/Trust.php +++ b/src/Entities/EntityCreateParams/Trust.php @@ -83,7 +83,7 @@ final class Trust implements BaseModel public ?Grantor $grantor; /** - * The Employer Identification Number (EIN) for the trust. Required if `category` is equal to `irrevocable`. + * The Employer Identification Number (EIN) for the trust. Submit nine digits with no dashes or other separators. Required if `category` is equal to `irrevocable`. */ #[Optional('tax_identifier')] public ?string $taxIdentifier; @@ -233,7 +233,7 @@ public function withGrantor(Grantor|array $grantor): self } /** - * The Employer Identification Number (EIN) for the trust. Required if `category` is equal to `irrevocable`. + * The Employer Identification Number (EIN) for the trust. Submit nine digits with no dashes or other separators. Required if `category` is equal to `irrevocable`. */ public function withTaxIdentifier(string $taxIdentifier): self { diff --git a/src/Entities/EntityCreateParams/Trust/Grantor/Identification.php b/src/Entities/EntityCreateParams/Trust/Grantor/Identification.php index 41882d24..60b9d75f 100644 --- a/src/Entities/EntityCreateParams/Trust/Grantor/Identification.php +++ b/src/Entities/EntityCreateParams/Trust/Grantor/Identification.php @@ -42,7 +42,7 @@ final class Identification implements BaseModel public string $method; /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ #[Required] public string $number; @@ -127,7 +127,7 @@ public function withMethod(Method|string $method): self } /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ public function withNumber(string $number): self { diff --git a/src/Entities/EntityCreateParams/Trust/Trustee/Individual/Identification.php b/src/Entities/EntityCreateParams/Trust/Trustee/Individual/Identification.php index f5f40a4f..45d5d354 100644 --- a/src/Entities/EntityCreateParams/Trust/Trustee/Individual/Identification.php +++ b/src/Entities/EntityCreateParams/Trust/Trustee/Individual/Identification.php @@ -42,7 +42,7 @@ final class Identification implements BaseModel public string $method; /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ #[Required] public string $number; @@ -127,7 +127,7 @@ public function withMethod(Method|string $method): self } /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ public function withNumber(string $number): self { diff --git a/src/Entities/EntityUpdateParams/Corporation.php b/src/Entities/EntityUpdateParams/Corporation.php index e01b057b..82f4086d 100644 --- a/src/Entities/EntityUpdateParams/Corporation.php +++ b/src/Entities/EntityUpdateParams/Corporation.php @@ -23,6 +23,7 @@ * industryCode?: string|null, * legalIdentifier?: null|LegalIdentifier|LegalIdentifierShape, * name?: string|null, + * website?: string|null, * } */ final class Corporation implements BaseModel @@ -66,6 +67,12 @@ final class Corporation implements BaseModel #[Optional] public ?string $name; + /** + * A website for the business. Not every program requires a website for submitted Entities. + */ + #[Optional] + public ?string $website; + public function __construct() { $this->initialize(); @@ -86,6 +93,7 @@ public static function with( ?string $industryCode = null, LegalIdentifier|array|null $legalIdentifier = null, ?string $name = null, + ?string $website = null, ): self { $self = new self; @@ -95,6 +103,7 @@ public static function with( null !== $industryCode && $self['industryCode'] = $industryCode; null !== $legalIdentifier && $self['legalIdentifier'] = $legalIdentifier; null !== $name && $self['name'] = $name; + null !== $website && $self['website'] = $website; return $self; } @@ -169,4 +178,15 @@ public function withName(string $name): self return $self; } + + /** + * A website for the business. Not every program requires a website for submitted Entities. + */ + public function withWebsite(string $website): self + { + $self = clone $this; + $self['website'] = $website; + + return $self; + } } diff --git a/src/Entities/EntityUpdateParams/Corporation/LegalIdentifier.php b/src/Entities/EntityUpdateParams/Corporation/LegalIdentifier.php index 11f7c769..06fa0f1c 100644 --- a/src/Entities/EntityUpdateParams/Corporation/LegalIdentifier.php +++ b/src/Entities/EntityUpdateParams/Corporation/LegalIdentifier.php @@ -23,7 +23,7 @@ final class LegalIdentifier implements BaseModel use SdkModel; /** - * The identifier of the legal identifier. + * The identifier of the legal identifier. For US Employer Identification Numbers, submit nine digits with no dashes or other separators. */ #[Required] public string $value; @@ -76,7 +76,7 @@ public static function with( } /** - * The identifier of the legal identifier. + * The identifier of the legal identifier. For US Employer Identification Numbers, submit nine digits with no dashes or other separators. */ public function withValue(string $value): self { diff --git a/src/Entities/EntityUpdateParams/NaturalPerson/Identification.php b/src/Entities/EntityUpdateParams/NaturalPerson/Identification.php index 96bc14ef..ba5376ef 100644 --- a/src/Entities/EntityUpdateParams/NaturalPerson/Identification.php +++ b/src/Entities/EntityUpdateParams/NaturalPerson/Identification.php @@ -42,7 +42,7 @@ final class Identification implements BaseModel public string $method; /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ #[Required] public string $number; @@ -127,7 +127,7 @@ public function withMethod(Method|string $method): self } /** - * An identification number that can be used to verify the individual's identity, such as a social security number. + * An identification number that can be used to verify the individual's identity, such as a social security number. For Social Security Numbers and Individual Taxpayer Identification Numbers, submit nine digits with no dashes or other separators. */ public function withNumber(string $number): self { diff --git a/src/EventSubscriptions/EventSubscription/SelectedEventCategory/EventCategory.php b/src/EventSubscriptions/EventSubscription/SelectedEventCategory/EventCategory.php index 8e54e217..6341fc27 100644 --- a/src/EventSubscriptions/EventSubscription/SelectedEventCategory/EventCategory.php +++ b/src/EventSubscriptions/EventSubscription/SelectedEventCategory/EventCategory.php @@ -85,8 +85,6 @@ enum EventCategory: string case DIGITAL_WALLET_TOKEN_UPDATED = 'digital_wallet_token.updated'; - case DOCUMENT_CREATED = 'document.created'; - case ENTITY_CREATED = 'entity.created'; case ENTITY_UPDATED = 'entity.updated'; @@ -151,10 +149,6 @@ enum EventCategory: string case INTRAFI_EXCLUSION_UPDATED = 'intrafi_exclusion.updated'; - case LEGACY_CARD_DISPUTE_CREATED = 'legacy_card_dispute.created'; - - case LEGACY_CARD_DISPUTE_UPDATED = 'legacy_card_dispute.updated'; - case LOCKBOX_CREATED = 'lockbox.created'; case LOCKBOX_UPDATED = 'lockbox.updated'; diff --git a/src/EventSubscriptions/EventSubscriptionCreateParams/SelectedEventCategory/EventCategory.php b/src/EventSubscriptions/EventSubscriptionCreateParams/SelectedEventCategory/EventCategory.php index 36e62560..8e144028 100644 --- a/src/EventSubscriptions/EventSubscriptionCreateParams/SelectedEventCategory/EventCategory.php +++ b/src/EventSubscriptions/EventSubscriptionCreateParams/SelectedEventCategory/EventCategory.php @@ -85,8 +85,6 @@ enum EventCategory: string case DIGITAL_WALLET_TOKEN_UPDATED = 'digital_wallet_token.updated'; - case DOCUMENT_CREATED = 'document.created'; - case ENTITY_CREATED = 'entity.created'; case ENTITY_UPDATED = 'entity.updated'; @@ -151,10 +149,6 @@ enum EventCategory: string case INTRAFI_EXCLUSION_UPDATED = 'intrafi_exclusion.updated'; - case LEGACY_CARD_DISPUTE_CREATED = 'legacy_card_dispute.created'; - - case LEGACY_CARD_DISPUTE_UPDATED = 'legacy_card_dispute.updated'; - case LOCKBOX_CREATED = 'lockbox.created'; case LOCKBOX_UPDATED = 'lockbox.updated'; diff --git a/src/Events/Event/Category.php b/src/Events/Event/Category.php index e4868886..07e925af 100644 --- a/src/Events/Event/Category.php +++ b/src/Events/Event/Category.php @@ -85,8 +85,6 @@ enum Category: string case DIGITAL_WALLET_TOKEN_UPDATED = 'digital_wallet_token.updated'; - case DOCUMENT_CREATED = 'document.created'; - case ENTITY_CREATED = 'entity.created'; case ENTITY_UPDATED = 'entity.updated'; @@ -151,10 +149,6 @@ enum Category: string case INTRAFI_EXCLUSION_UPDATED = 'intrafi_exclusion.updated'; - case LEGACY_CARD_DISPUTE_CREATED = 'legacy_card_dispute.created'; - - case LEGACY_CARD_DISPUTE_UPDATED = 'legacy_card_dispute.updated'; - case LOCKBOX_CREATED = 'lockbox.created'; case LOCKBOX_UPDATED = 'lockbox.updated'; diff --git a/src/Events/EventListParams/Category/In.php b/src/Events/EventListParams/Category/In.php index 3dfbe3ca..df2a0a34 100644 --- a/src/Events/EventListParams/Category/In.php +++ b/src/Events/EventListParams/Category/In.php @@ -82,8 +82,6 @@ enum In: string case DIGITAL_WALLET_TOKEN_UPDATED = 'digital_wallet_token.updated'; - case DOCUMENT_CREATED = 'document.created'; - case ENTITY_CREATED = 'entity.created'; case ENTITY_UPDATED = 'entity.updated'; @@ -148,10 +146,6 @@ enum In: string case INTRAFI_EXCLUSION_UPDATED = 'intrafi_exclusion.updated'; - case LEGACY_CARD_DISPUTE_CREATED = 'legacy_card_dispute.created'; - - case LEGACY_CARD_DISPUTE_UPDATED = 'legacy_card_dispute.updated'; - case LOCKBOX_CREATED = 'lockbox.created'; case LOCKBOX_UPDATED = 'lockbox.updated'; diff --git a/src/Events/UnwrapWebhookEvent/Category.php b/src/Events/UnwrapWebhookEvent/Category.php index 50133758..b67120e0 100644 --- a/src/Events/UnwrapWebhookEvent/Category.php +++ b/src/Events/UnwrapWebhookEvent/Category.php @@ -85,8 +85,6 @@ enum Category: string case DIGITAL_WALLET_TOKEN_UPDATED = 'digital_wallet_token.updated'; - case DOCUMENT_CREATED = 'document.created'; - case ENTITY_CREATED = 'entity.created'; case ENTITY_UPDATED = 'entity.updated'; @@ -151,10 +149,6 @@ enum Category: string case INTRAFI_EXCLUSION_UPDATED = 'intrafi_exclusion.updated'; - case LEGACY_CARD_DISPUTE_CREATED = 'legacy_card_dispute.created'; - - case LEGACY_CARD_DISPUTE_UPDATED = 'legacy_card_dispute.updated'; - case LOCKBOX_CREATED = 'lockbox.created'; case LOCKBOX_UPDATED = 'lockbox.updated'; diff --git a/src/InboundMailItems/InboundMailItem.php b/src/InboundMailItems/InboundMailItem.php index e00685fe..2de4c40a 100644 --- a/src/InboundMailItems/InboundMailItem.php +++ b/src/InboundMailItems/InboundMailItem.php @@ -22,7 +22,7 @@ * checks: list, * createdAt: \DateTimeInterface, * fileID: string, - * lockboxAddressID: string|null, + * lockboxAddressID: string, * lockboxRecipientID: string|null, * recipientName: string|null, * rejectionReason: null|RejectionReason|value-of, @@ -65,7 +65,7 @@ final class InboundMailItem implements BaseModel * The identifier for the Lockbox Address that received this mail item. */ #[Required('lockbox_address_id')] - public ?string $lockboxAddressID; + public string $lockboxAddressID; /** * The identifier for the Lockbox Recipient that received this mail item. For mail items that could not be routed to a Lockbox Recipient, this will be null. @@ -158,7 +158,7 @@ public static function with( array $checks, \DateTimeInterface $createdAt, string $fileID, - ?string $lockboxAddressID, + string $lockboxAddressID, ?string $lockboxRecipientID, ?string $recipientName, RejectionReason|string|null $rejectionReason, @@ -230,7 +230,7 @@ public function withFileID(string $fileID): self /** * The identifier for the Lockbox Address that received this mail item. */ - public function withLockboxAddressID(?string $lockboxAddressID): self + public function withLockboxAddressID(string $lockboxAddressID): self { $self = clone $this; $self['lockboxAddressID'] = $lockboxAddressID; diff --git a/src/RoutingNumbers/RoutingNumberListParams.php b/src/RoutingNumbers/RoutingNumberListParams.php index 3157483e..edb32906 100644 --- a/src/RoutingNumbers/RoutingNumberListParams.php +++ b/src/RoutingNumbers/RoutingNumberListParams.php @@ -11,7 +11,7 @@ use Increase\Core\Contracts\BaseModel; /** - * You can use this API to confirm if a routing number is valid, such as when a user is providing you with bank account details. Since routing numbers uniquely identify a bank, this will always return 0 or 1 entry. In Sandbox, the only valid routing number for this method is 110000000. + * You can use this API to confirm if a routing number is valid, such as when a user is providing you with bank account details. Since routing numbers uniquely identify a bank, this will always return 0 or 1 entry. In Sandbox, only a few [routing numbers are valid](/documentation/sandbox-test-values#routing-numbers). `110000000` is an example of a Sandbox routing number. * * @see Increase\Services\RoutingNumbersService::list() * diff --git a/src/ServiceContracts/Simulations/AccountRevenuePaymentsContract.php b/src/ServiceContracts/Simulations/AccountRevenuePaymentsContract.php new file mode 100644 index 00000000..af62df4a --- /dev/null +++ b/src/ServiceContracts/Simulations/AccountRevenuePaymentsContract.php @@ -0,0 +1,36 @@ +|AccountRevenuePaymentCreateParams $params + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function create( + array|AccountRevenuePaymentCreateParams $params, + RequestOptions|array|null $requestOptions = null, + ): BaseResponse; +} diff --git a/src/ServiceContracts/Simulations/EntitiesContract.php b/src/ServiceContracts/Simulations/EntitiesContract.php new file mode 100644 index 00000000..5dbd30eb --- /dev/null +++ b/src/ServiceContracts/Simulations/EntitiesContract.php @@ -0,0 +1,32 @@ + $issues The validation issues to attach. If no issues are provided, the validation status will be set to `valid`. + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function updateValidation( + string $entityID, + array $issues, + RequestOptions|array|null $requestOptions = null, + ): Entity; +} diff --git a/src/ServiceContracts/Simulations/EntitiesRawContract.php b/src/ServiceContracts/Simulations/EntitiesRawContract.php new file mode 100644 index 00000000..56aa1ad6 --- /dev/null +++ b/src/ServiceContracts/Simulations/EntitiesRawContract.php @@ -0,0 +1,34 @@ +|EntityUpdateValidationParams $params + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function updateValidation( + string $entityID, + array|EntityUpdateValidationParams $params, + RequestOptions|array|null $requestOptions = null, + ): BaseResponse; +} diff --git a/src/Services/RoutingNumbersRawService.php b/src/Services/RoutingNumbersRawService.php index 620f9f0a..0a9c7c18 100644 --- a/src/Services/RoutingNumbersRawService.php +++ b/src/Services/RoutingNumbersRawService.php @@ -28,7 +28,7 @@ public function __construct(private Client $client) {} /** * @api * - * You can use this API to confirm if a routing number is valid, such as when a user is providing you with bank account details. Since routing numbers uniquely identify a bank, this will always return 0 or 1 entry. In Sandbox, the only valid routing number for this method is 110000000. + * You can use this API to confirm if a routing number is valid, such as when a user is providing you with bank account details. Since routing numbers uniquely identify a bank, this will always return 0 or 1 entry. In Sandbox, only a few [routing numbers are valid](/documentation/sandbox-test-values#routing-numbers). `110000000` is an example of a Sandbox routing number. * * @param array{ * routingNumber: string, cursor?: string, limit?: int diff --git a/src/Services/RoutingNumbersService.php b/src/Services/RoutingNumbersService.php index 9a33fafa..446a790e 100644 --- a/src/Services/RoutingNumbersService.php +++ b/src/Services/RoutingNumbersService.php @@ -33,7 +33,7 @@ public function __construct(private Client $client) /** * @api * - * You can use this API to confirm if a routing number is valid, such as when a user is providing you with bank account details. Since routing numbers uniquely identify a bank, this will always return 0 or 1 entry. In Sandbox, the only valid routing number for this method is 110000000. + * You can use this API to confirm if a routing number is valid, such as when a user is providing you with bank account details. Since routing numbers uniquely identify a bank, this will always return 0 or 1 entry. In Sandbox, only a few [routing numbers are valid](/documentation/sandbox-test-values#routing-numbers). `110000000` is an example of a Sandbox routing number. * * @param string $routingNumber filter financial institutions by routing number * @param string $cursor return the page of entries after this one diff --git a/src/Services/Simulations/AccountRevenuePaymentsRawService.php b/src/Services/Simulations/AccountRevenuePaymentsRawService.php new file mode 100644 index 00000000..3b3a7087 --- /dev/null +++ b/src/Services/Simulations/AccountRevenuePaymentsRawService.php @@ -0,0 +1,62 @@ + + * + * @throws APIException + */ + public function create( + array|AccountRevenuePaymentCreateParams $params, + RequestOptions|array|null $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = AccountRevenuePaymentCreateParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'simulations/account_revenue_payments', + body: (object) $parsed, + options: $options, + convert: Transaction::class, + ); + } +} diff --git a/src/Services/Simulations/AccountRevenuePaymentsService.php b/src/Services/Simulations/AccountRevenuePaymentsService.php new file mode 100644 index 00000000..ad9297ec --- /dev/null +++ b/src/Services/Simulations/AccountRevenuePaymentsService.php @@ -0,0 +1,69 @@ +raw = new AccountRevenuePaymentsRawService($client); + } + + /** + * @api + * + * Simulates an account revenue payment to your account. In production, this happens automatically on the first of each month. + * + * @param string $accountID the identifier of the Account the Account Revenue Payment should be paid to + * @param int $amount The account revenue amount in cents. Must be positive. + * @param string $accruedOnAccountID The identifier of the Account the account revenue accrued on. Defaults to `account_id`. + * @param \DateTimeInterface $periodEnd The end of the account revenue period. If not provided, defaults to the current time. + * @param \DateTimeInterface $periodStart The start of the account revenue period. If not provided, defaults to the current time. + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function create( + string $accountID, + int $amount, + ?string $accruedOnAccountID = null, + ?\DateTimeInterface $periodEnd = null, + ?\DateTimeInterface $periodStart = null, + RequestOptions|array|null $requestOptions = null, + ): Transaction { + $params = Util::removeNulls( + [ + 'accountID' => $accountID, + 'amount' => $amount, + 'accruedOnAccountID' => $accruedOnAccountID, + 'periodEnd' => $periodEnd, + 'periodStart' => $periodStart, + ], + ); + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->create(params: $params, requestOptions: $requestOptions); + + return $response->parse(); + } +} diff --git a/src/Services/Simulations/EntitiesRawService.php b/src/Services/Simulations/EntitiesRawService.php new file mode 100644 index 00000000..586aef95 --- /dev/null +++ b/src/Services/Simulations/EntitiesRawService.php @@ -0,0 +1,62 @@ + + * }|EntityUpdateValidationParams $params + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function updateValidation( + string $entityID, + array|EntityUpdateValidationParams $params, + RequestOptions|array|null $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = EntityUpdateValidationParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: ['simulations/entities/%1$s/update_validation', $entityID], + body: (object) $parsed, + options: $options, + convert: Entity::class, + ); + } +} diff --git a/src/Services/Simulations/EntitiesService.php b/src/Services/Simulations/EntitiesService.php new file mode 100644 index 00000000..20d5502a --- /dev/null +++ b/src/Services/Simulations/EntitiesService.php @@ -0,0 +1,57 @@ +raw = new EntitiesRawService($client); + } + + /** + * @api + * + * Simulate updates to an [Entity's validation](/documentation/api/entities#entity-object.validation). In production, Know Your Customer validations [run automatically](/documentation/entity-validation#entity-validation) for eligible programs. While developing, use this API to simulate issues with information submissions. + * + * @param string $entityID the identifier of the Entity whose validation status to update + * @param list $issues The validation issues to attach. If no issues are provided, the validation status will be set to `valid`. + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function updateValidation( + string $entityID, + array $issues, + RequestOptions|array|null $requestOptions = null, + ): Entity { + $params = Util::removeNulls(['issues' => $issues]); + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->updateValidation($entityID, params: $params, requestOptions: $requestOptions); + + return $response->parse(); + } +} diff --git a/src/Services/Simulations/InboundMailItemsRawService.php b/src/Services/Simulations/InboundMailItemsRawService.php index aa366f60..28119a98 100644 --- a/src/Services/Simulations/InboundMailItemsRawService.php +++ b/src/Services/Simulations/InboundMailItemsRawService.php @@ -26,7 +26,7 @@ public function __construct(private Client $client) {} /** * @api * - * Simulates an inbound mail item to your account, as if someone had mailed a physical check to one of your account's Lockboxes. + * Simulates an Inbound Mail Item to one of your Lockbox Addresses or Lockbox Recipients, as if someone had mailed a physical check. * * @param array{ * amount: int, diff --git a/src/Services/Simulations/InboundMailItemsService.php b/src/Services/Simulations/InboundMailItemsService.php index f44b14b9..b1f338eb 100644 --- a/src/Services/Simulations/InboundMailItemsService.php +++ b/src/Services/Simulations/InboundMailItemsService.php @@ -32,7 +32,7 @@ public function __construct(private Client $client) /** * @api * - * Simulates an inbound mail item to your account, as if someone had mailed a physical check to one of your account's Lockboxes. + * Simulates an Inbound Mail Item to one of your Lockbox Addresses or Lockbox Recipients, as if someone had mailed a physical check. * * @param int $amount the amount of the check to be simulated, in cents * @param string $contentsFileID The file containing the PDF contents. If not present, a default check image file will be used. diff --git a/src/Services/SimulationsService.php b/src/Services/SimulationsService.php index 7d4b1e23..67e1f65e 100644 --- a/src/Services/SimulationsService.php +++ b/src/Services/SimulationsService.php @@ -6,6 +6,7 @@ use Increase\Client; use Increase\ServiceContracts\SimulationsContract; +use Increase\Services\Simulations\AccountRevenuePaymentsService; use Increase\Services\Simulations\AccountStatementsService; use Increase\Services\Simulations\ACHTransfersService; use Increase\Services\Simulations\CardAuthenticationsService; @@ -23,6 +24,7 @@ use Increase\Services\Simulations\CheckDepositsService; use Increase\Services\Simulations\CheckTransfersService; use Increase\Services\Simulations\DigitalWalletTokenRequestsService; +use Increase\Services\Simulations\EntitiesService; use Increase\Services\Simulations\EntityOnboardingSessionsService; use Increase\Services\Simulations\ExportsService; use Increase\Services\Simulations\InboundACHTransfersService; @@ -52,6 +54,11 @@ final class SimulationsService implements SimulationsContract */ public InterestPaymentsService $interestPayments; + /** + * @api + */ + public AccountRevenuePaymentsService $accountRevenuePayments; + /** * @api */ @@ -187,6 +194,11 @@ final class SimulationsService implements SimulationsContract */ public InboundMailItemsService $inboundMailItems; + /** + * @api + */ + public EntitiesService $entities; + /** * @api */ @@ -219,6 +231,7 @@ public function __construct(private Client $client) { $this->raw = new SimulationsRawService($client); $this->interestPayments = new InterestPaymentsService($client); + $this->accountRevenuePayments = new AccountRevenuePaymentsService($client); $this->cardAuthorizations = new CardAuthorizationsService($client); $this->cardBalanceInquiries = new CardBalanceInquiriesService($client); $this->cardAuthorizationExpirations = new CardAuthorizationExpirationsService($client); @@ -246,6 +259,7 @@ public function __construct(private Client $client) $this->inboundFednowTransfers = new InboundFednowTransfersService($client); $this->checkDeposits = new CheckDepositsService($client); $this->inboundMailItems = new InboundMailItemsService($client); + $this->entities = new EntitiesService($client); $this->entityOnboardingSessions = new EntityOnboardingSessionsService($client); $this->programs = new ProgramsService($client); $this->accountStatements = new AccountStatementsService($client); diff --git a/src/Simulations/AccountRevenuePayments/AccountRevenuePaymentCreateParams.php b/src/Simulations/AccountRevenuePayments/AccountRevenuePaymentCreateParams.php new file mode 100644 index 00000000..30bdf871 --- /dev/null +++ b/src/Simulations/AccountRevenuePayments/AccountRevenuePaymentCreateParams.php @@ -0,0 +1,159 @@ + */ + use SdkModel; + use SdkParams; + + /** + * The identifier of the Account the Account Revenue Payment should be paid to. + */ + #[Required('account_id')] + public string $accountID; + + /** + * The account revenue amount in cents. Must be positive. + */ + #[Required] + public int $amount; + + /** + * The identifier of the Account the account revenue accrued on. Defaults to `account_id`. + */ + #[Optional('accrued_on_account_id')] + public ?string $accruedOnAccountID; + + /** + * The end of the account revenue period. If not provided, defaults to the current time. + */ + #[Optional('period_end')] + public ?\DateTimeInterface $periodEnd; + + /** + * The start of the account revenue period. If not provided, defaults to the current time. + */ + #[Optional('period_start')] + public ?\DateTimeInterface $periodStart; + + /** + * `new AccountRevenuePaymentCreateParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AccountRevenuePaymentCreateParams::with(accountID: ..., amount: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AccountRevenuePaymentCreateParams)->withAccountID(...)->withAmount(...) + * ``` + */ + 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( + string $accountID, + int $amount, + ?string $accruedOnAccountID = null, + ?\DateTimeInterface $periodEnd = null, + ?\DateTimeInterface $periodStart = null, + ): self { + $self = new self; + + $self['accountID'] = $accountID; + $self['amount'] = $amount; + + null !== $accruedOnAccountID && $self['accruedOnAccountID'] = $accruedOnAccountID; + null !== $periodEnd && $self['periodEnd'] = $periodEnd; + null !== $periodStart && $self['periodStart'] = $periodStart; + + return $self; + } + + /** + * The identifier of the Account the Account Revenue Payment should be paid to. + */ + public function withAccountID(string $accountID): self + { + $self = clone $this; + $self['accountID'] = $accountID; + + return $self; + } + + /** + * The account revenue amount in cents. Must be positive. + */ + public function withAmount(int $amount): self + { + $self = clone $this; + $self['amount'] = $amount; + + return $self; + } + + /** + * The identifier of the Account the account revenue accrued on. Defaults to `account_id`. + */ + public function withAccruedOnAccountID(string $accruedOnAccountID): self + { + $self = clone $this; + $self['accruedOnAccountID'] = $accruedOnAccountID; + + return $self; + } + + /** + * The end of the account revenue period. If not provided, defaults to the current time. + */ + public function withPeriodEnd(\DateTimeInterface $periodEnd): self + { + $self = clone $this; + $self['periodEnd'] = $periodEnd; + + return $self; + } + + /** + * The start of the account revenue period. If not provided, defaults to the current time. + */ + public function withPeriodStart(\DateTimeInterface $periodStart): self + { + $self = clone $this; + $self['periodStart'] = $periodStart; + + return $self; + } +} diff --git a/src/Simulations/Entities/EntityUpdateValidationParams.php b/src/Simulations/Entities/EntityUpdateValidationParams.php new file mode 100644 index 00000000..a55cec73 --- /dev/null +++ b/src/Simulations/Entities/EntityUpdateValidationParams.php @@ -0,0 +1,85 @@ + + * } + */ +final class EntityUpdateValidationParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * The validation issues to attach. If no issues are provided, the validation status will be set to `valid`. + * + * @var list $issues + */ + #[Required(list: Issue::class)] + public array $issues; + + /** + * `new EntityUpdateValidationParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * EntityUpdateValidationParams::with(issues: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new EntityUpdateValidationParams)->withIssues(...) + * ``` + */ + 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. + * + * @param list $issues + */ + public static function with(array $issues): self + { + $self = new self; + + $self['issues'] = $issues; + + return $self; + } + + /** + * The validation issues to attach. If no issues are provided, the validation status will be set to `valid`. + * + * @param list $issues + */ + public function withIssues(array $issues): self + { + $self = clone $this; + $self['issues'] = $issues; + + return $self; + } +} diff --git a/src/Simulations/Entities/EntityUpdateValidationParams/Issue.php b/src/Simulations/Entities/EntityUpdateValidationParams/Issue.php new file mode 100644 index 00000000..004959b0 --- /dev/null +++ b/src/Simulations/Entities/EntityUpdateValidationParams/Issue.php @@ -0,0 +1,75 @@ +} + */ +final class Issue implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * The type of issue. + * + * @var value-of $category + */ + #[Required(enum: Category::class)] + public string $category; + + /** + * `new Issue()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Issue::with(category: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Issue)->withCategory(...) + * ``` + */ + 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. + * + * @param Category|value-of $category + */ + public static function with(Category|string $category): self + { + $self = new self; + + $self['category'] = $category; + + return $self; + } + + /** + * The type of issue. + * + * @param Category|value-of $category + */ + public function withCategory(Category|string $category): self + { + $self = clone $this; + $self['category'] = $category; + + return $self; + } +} diff --git a/src/Simulations/Entities/EntityUpdateValidationParams/Issue/Category.php b/src/Simulations/Entities/EntityUpdateValidationParams/Issue/Category.php new file mode 100644 index 00000000..88bfbf58 --- /dev/null +++ b/src/Simulations/Entities/EntityUpdateValidationParams/Issue/Category.php @@ -0,0 +1,19 @@ + [ 'expirationDate' => '2019-12-27', 'fileID' => 'file_id', - 'state' => 'x', + 'state' => 'xx', 'backFileID' => 'back_file_id', ], 'other' => [ diff --git a/tests/Services/CardPushTransfersTest.php b/tests/Services/CardPushTransfersTest.php index 8f3b4e81..22e7b014 100644 --- a/tests/Services/CardPushTransfersTest.php +++ b/tests/Services/CardPushTransfersTest.php @@ -34,7 +34,7 @@ public function testCreate(): void $result = $this->client->cardPushTransfers->create( businessApplicationIdentifier: 'funds_disbursement', cardTokenID: 'outbound_card_token_zlt0ml6youq3q7vcdlg0', - merchantCategoryCode: '1234', + merchantCategoryCode: '5734', merchantCityName: 'New York', merchantName: 'Acme Corp', merchantNamePrefix: 'Acme', @@ -60,7 +60,7 @@ public function testCreateWithOptionalParams(): void $result = $this->client->cardPushTransfers->create( businessApplicationIdentifier: 'funds_disbursement', cardTokenID: 'outbound_card_token_zlt0ml6youq3q7vcdlg0', - merchantCategoryCode: '1234', + merchantCategoryCode: '5734', merchantCityName: 'New York', merchantName: 'Acme Corp', merchantNamePrefix: 'Acme', diff --git a/tests/Services/EntitiesTest.php b/tests/Services/EntitiesTest.php index 15ae3e15..10a9a350 100644 --- a/tests/Services/EntitiesTest.php +++ b/tests/Services/EntitiesTest.php @@ -69,7 +69,7 @@ public function testCreateWithOptionalParams(): void 'driversLicense' => [ 'expirationDate' => '2019-12-27', 'fileID' => 'file_id', - 'state' => 'x', + 'state' => 'xx', 'backFileID' => 'back_file_id', ], 'other' => [ @@ -108,7 +108,7 @@ public function testCreateWithOptionalParams(): void 'address' => [ 'city' => 'x', 'line1' => 'x', - 'state' => 'x', + 'state' => 'xx', 'zip' => 'x', 'line2' => 'x', ], @@ -136,7 +136,7 @@ public function testCreateWithOptionalParams(): void 'driversLicense' => [ 'expirationDate' => '2019-12-27', 'fileID' => 'file_id', - 'state' => 'x', + 'state' => 'xx', 'backFileID' => 'back_file_id', ], 'other' => [ @@ -173,7 +173,7 @@ public function testCreateWithOptionalParams(): void 'driversLicense' => [ 'expirationDate' => '2019-12-27', 'fileID' => 'file_id', - 'state' => 'x', + 'state' => 'xx', 'backFileID' => 'back_file_id', ], 'other' => [ @@ -209,7 +209,7 @@ public function testCreateWithOptionalParams(): void 'address' => [ 'city' => 'x', 'line1' => 'x', - 'state' => 'x', + 'state' => 'xx', 'zip' => 'x', 'line2' => 'x', ], @@ -234,7 +234,7 @@ public function testCreateWithOptionalParams(): void 'driversLicense' => [ 'expirationDate' => '2019-12-27', 'fileID' => 'file_id', - 'state' => 'x', + 'state' => 'xx', 'backFileID' => 'back_file_id', ], 'other' => [ @@ -273,7 +273,7 @@ public function testCreateWithOptionalParams(): void 'driversLicense' => [ 'expirationDate' => '2019-12-27', 'fileID' => 'file_id', - 'state' => 'x', + 'state' => 'xx', 'backFileID' => 'back_file_id', ], 'other' => [ diff --git a/tests/Services/FednowTransfersTest.php b/tests/Services/FednowTransfersTest.php index 45936b34..16b113e1 100644 --- a/tests/Services/FednowTransfersTest.php +++ b/tests/Services/FednowTransfersTest.php @@ -62,7 +62,7 @@ public function testCreateWithOptionalParams(): void debtorAddress: [ 'city' => 'x', 'postalCode' => '21029-9469', - 'state' => 'x', + 'state' => 'xx', 'line1' => 'x', ], externalAccountID: 'external_account_id', diff --git a/tests/Services/Simulations/AccountRevenuePaymentsTest.php b/tests/Services/Simulations/AccountRevenuePaymentsTest.php new file mode 100644 index 00000000..a913dfd1 --- /dev/null +++ b/tests/Services/Simulations/AccountRevenuePaymentsTest.php @@ -0,0 +1,56 @@ +client = $client; + } + + #[Test] + public function testCreate(): void + { + $result = $this->client->simulations->accountRevenuePayments->create( + accountID: 'account_in71c4amph0vgo2qllky', + amount: 1000 + ); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(Transaction::class, $result); + } + + #[Test] + public function testCreateWithOptionalParams(): void + { + $result = $this->client->simulations->accountRevenuePayments->create( + accountID: 'account_in71c4amph0vgo2qllky', + amount: 1000, + accruedOnAccountID: 'accrued_on_account_id', + periodEnd: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'), + periodStart: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'), + ); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(Transaction::class, $result); + } +} diff --git a/tests/Services/Simulations/EntitiesTest.php b/tests/Services/Simulations/EntitiesTest.php new file mode 100644 index 00000000..32812ba5 --- /dev/null +++ b/tests/Services/Simulations/EntitiesTest.php @@ -0,0 +1,53 @@ +client = $client; + } + + #[Test] + public function testUpdateValidation(): void + { + $result = $this->client->simulations->entities->updateValidation( + 'entity_n8y8tnk2p9339ti393yi', + issues: [['category' => 'entity_tax_identifier']], + ); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(Entity::class, $result); + } + + #[Test] + public function testUpdateValidationWithOptionalParams(): void + { + $result = $this->client->simulations->entities->updateValidation( + 'entity_n8y8tnk2p9339ti393yi', + issues: [['category' => 'entity_tax_identifier']], + ); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(Entity::class, $result); + } +}