Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.110.0"
".": "0.111.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 240
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-c9957e6ab1c9adef0dfb9a3956c8e7505a1661d22e79531eaee71b2a3a699b61.yml
openapi_spec_hash: 1190741469af674747df81908239a601
config_hash: 82cb0fb1fae47b3467cd6da4273541de
configured_endpoints: 241
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-ecd0cee565701f1d47c0db3efed2734f1195f60e5767c9c5f67ddb5de5e6abf1.yml
openapi_spec_hash: d9205bf9cc1ce52d0d046007318761a1
config_hash: cb5b8736705c06b670f6a25484622d62
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.111.0 (2026-04-13)

Full Changelog: [v0.110.0...v0.111.0](https://github.com/Increase/increase-php/compare/v0.110.0...v0.111.0)

### Features

* **api:** api update ([20985e1](https://github.com/Increase/increase-php/commit/20985e1959f15994fa384a87e83c1d2892adba7f))

## 0.110.0 (2026-04-13)

Full Changelog: [v0.109.0...v0.110.0](https://github.com/Increase/increase-php/compare/v0.109.0...v0.110.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d
<!-- x-release-please-start-version -->

```
composer require "increase/increase 0.110.0"
composer require "increase/increase 0.111.0"
```

<!-- x-release-please-end -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

namespace Increase\ServiceContracts\Simulations;

use Increase\CardPurchaseSupplements\CardPurchaseSupplement;
use Increase\Core\Exceptions\APIException;
use Increase\RequestOptions;
use Increase\Simulations\CardPurchaseSupplements\CardPurchaseSupplementCreateParams\Invoice;
use Increase\Simulations\CardPurchaseSupplements\CardPurchaseSupplementCreateParams\LineItem;

/**
* @phpstan-import-type InvoiceShape from \Increase\Simulations\CardPurchaseSupplements\CardPurchaseSupplementCreateParams\Invoice
* @phpstan-import-type LineItemShape from \Increase\Simulations\CardPurchaseSupplements\CardPurchaseSupplementCreateParams\LineItem
* @phpstan-import-type RequestOpts from \Increase\RequestOptions
*/
interface CardPurchaseSupplementsContract
{
/**
* @api
*
* @param string $transactionID The identifier of the Transaction to create a Card Purchase Supplement for. The Transaction must have a source of type `card_settlement`.
* @param Invoice|InvoiceShape $invoice invoice-level information about the payment
* @param list<LineItem|LineItemShape> $lineItems line item information, such as individual products purchased
* @param RequestOpts|null $requestOptions
*
* @throws APIException
*/
public function create(
string $transactionID,
Invoice|array|null $invoice = null,
?array $lineItems = null,
RequestOptions|array|null $requestOptions = null,
): CardPurchaseSupplement;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

namespace Increase\ServiceContracts\Simulations;

use Increase\CardPurchaseSupplements\CardPurchaseSupplement;
use Increase\Core\Contracts\BaseResponse;
use Increase\Core\Exceptions\APIException;
use Increase\RequestOptions;
use Increase\Simulations\CardPurchaseSupplements\CardPurchaseSupplementCreateParams;

/**
* @phpstan-import-type RequestOpts from \Increase\RequestOptions
*/
interface CardPurchaseSupplementsRawContract
{
/**
* @api
*
* @param array<string,mixed>|CardPurchaseSupplementCreateParams $params
* @param RequestOpts|null $requestOptions
*
* @return BaseResponse<CardPurchaseSupplement>
*
* @throws APIException
*/
public function create(
array|CardPurchaseSupplementCreateParams $params,
RequestOptions|array|null $requestOptions = null,
): BaseResponse;
}
64 changes: 64 additions & 0 deletions src/Services/Simulations/CardPurchaseSupplementsRawService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

declare(strict_types=1);

namespace Increase\Services\Simulations;

use Increase\CardPurchaseSupplements\CardPurchaseSupplement;
use Increase\Client;
use Increase\Core\Contracts\BaseResponse;
use Increase\Core\Exceptions\APIException;
use Increase\RequestOptions;
use Increase\ServiceContracts\Simulations\CardPurchaseSupplementsRawContract;
use Increase\Simulations\CardPurchaseSupplements\CardPurchaseSupplementCreateParams;
use Increase\Simulations\CardPurchaseSupplements\CardPurchaseSupplementCreateParams\Invoice;
use Increase\Simulations\CardPurchaseSupplements\CardPurchaseSupplementCreateParams\LineItem;

/**
* @phpstan-import-type InvoiceShape from \Increase\Simulations\CardPurchaseSupplements\CardPurchaseSupplementCreateParams\Invoice
* @phpstan-import-type LineItemShape from \Increase\Simulations\CardPurchaseSupplements\CardPurchaseSupplementCreateParams\LineItem
* @phpstan-import-type RequestOpts from \Increase\RequestOptions
*/
final class CardPurchaseSupplementsRawService implements CardPurchaseSupplementsRawContract
{
// @phpstan-ignore-next-line
/**
* @internal
*/
public function __construct(private Client $client) {}

/**
* @api
*
* Simulates the creation of a Card Purchase Supplement (Level 3 data) for a card settlement. This happens asynchronously in production when Visa sends enhanced transaction data about a purchase.
*
* @param array{
* transactionID: string,
* invoice?: Invoice|InvoiceShape,
* lineItems?: list<LineItem|LineItemShape>,
* }|CardPurchaseSupplementCreateParams $params
* @param RequestOpts|null $requestOptions
*
* @return BaseResponse<CardPurchaseSupplement>
*
* @throws APIException
*/
public function create(
array|CardPurchaseSupplementCreateParams $params,
RequestOptions|array|null $requestOptions = null,
): BaseResponse {
[$parsed, $options] = CardPurchaseSupplementCreateParams::parseRequest(
$params,
$requestOptions,
);

// @phpstan-ignore-next-line return.type
return $this->client->request(
method: 'post',
path: 'simulations/card_purchase_supplements',
body: (object) $parsed,
options: $options,
convert: CardPurchaseSupplement::class,
);
}
}
67 changes: 67 additions & 0 deletions src/Services/Simulations/CardPurchaseSupplementsService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

declare(strict_types=1);

namespace Increase\Services\Simulations;

use Increase\CardPurchaseSupplements\CardPurchaseSupplement;
use Increase\Client;
use Increase\Core\Exceptions\APIException;
use Increase\Core\Util;
use Increase\RequestOptions;
use Increase\ServiceContracts\Simulations\CardPurchaseSupplementsContract;
use Increase\Simulations\CardPurchaseSupplements\CardPurchaseSupplementCreateParams\Invoice;
use Increase\Simulations\CardPurchaseSupplements\CardPurchaseSupplementCreateParams\LineItem;

/**
* @phpstan-import-type InvoiceShape from \Increase\Simulations\CardPurchaseSupplements\CardPurchaseSupplementCreateParams\Invoice
* @phpstan-import-type LineItemShape from \Increase\Simulations\CardPurchaseSupplements\CardPurchaseSupplementCreateParams\LineItem
* @phpstan-import-type RequestOpts from \Increase\RequestOptions
*/
final class CardPurchaseSupplementsService implements CardPurchaseSupplementsContract
{
/**
* @api
*/
public CardPurchaseSupplementsRawService $raw;

/**
* @internal
*/
public function __construct(private Client $client)
{
$this->raw = new CardPurchaseSupplementsRawService($client);
}

/**
* @api
*
* Simulates the creation of a Card Purchase Supplement (Level 3 data) for a card settlement. This happens asynchronously in production when Visa sends enhanced transaction data about a purchase.
*
* @param string $transactionID The identifier of the Transaction to create a Card Purchase Supplement for. The Transaction must have a source of type `card_settlement`.
* @param Invoice|InvoiceShape $invoice invoice-level information about the payment
* @param list<LineItem|LineItemShape> $lineItems line item information, such as individual products purchased
* @param RequestOpts|null $requestOptions
*
* @throws APIException
*/
public function create(
string $transactionID,
Invoice|array|null $invoice = null,
?array $lineItems = null,
RequestOptions|array|null $requestOptions = null,
): CardPurchaseSupplement {
$params = Util::removeNulls(
[
'transactionID' => $transactionID,
'invoice' => $invoice,
'lineItems' => $lineItems,
],
);

// @phpstan-ignore-next-line argument.type
$response = $this->raw->create(params: $params, requestOptions: $requestOptions);

return $response->parse();
}
}
7 changes: 7 additions & 0 deletions src/Services/SimulationsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Increase\Services\Simulations\CardDisputesService;
use Increase\Services\Simulations\CardFuelConfirmationsService;
use Increase\Services\Simulations\CardIncrementsService;
use Increase\Services\Simulations\CardPurchaseSupplementsService;
use Increase\Services\Simulations\CardRefundsService;
use Increase\Services\Simulations\CardReversalsService;
use Increase\Services\Simulations\CardSettlementsService;
Expand Down Expand Up @@ -96,6 +97,11 @@ final class SimulationsService implements SimulationsContract
*/
public CardAuthenticationsService $cardAuthentications;

/**
* @api
*/
public CardPurchaseSupplementsService $cardPurchaseSupplements;

/**
* @api
*/
Expand Down Expand Up @@ -222,6 +228,7 @@ public function __construct(private Client $client)
$this->cardFuelConfirmations = new CardFuelConfirmationsService($client);
$this->cardRefunds = new CardRefundsService($client);
$this->cardAuthentications = new CardAuthenticationsService($client);
$this->cardPurchaseSupplements = new CardPurchaseSupplementsService($client);
$this->cardDisputes = new CardDisputesService($client);
$this->physicalCards = new PhysicalCardsService($client);
$this->digitalWalletTokenRequests = new DigitalWalletTokenRequestsService($client);
Expand Down
Loading