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
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 258
openapi_spec_hash: a0b4ea6e95b4d03425ddbbf38709d16d
openapi_spec_hash: bae77f4f26192d3f539b3a53269fc09a
config_hash: b0e46656e84a8c26907fbe6dc8116a3d
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

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

/**
* The name by which the recipient knows the counterparty of this transaction. If you're processing payments on behalf of another party, use their name, not your own, so that it's more likely the recipient understands the context of the payment. This value is usually displayed to the recipient on their bank statement. We recommend setting this on every transfer; if you do not, we fall back to the `statement_descriptor`.
* The name by which the recipient knows the counterparty of this transaction. If you're processing payments on behalf of another party, use their name, not your own, so that it's more likely the recipient understands the context of the payment. This value is usually displayed to the recipient on their bank statement.
*/
#[Required('company_name')]
public string $companyName;

/**
* The name of the transfer recipient. This value is informational and generally not verified by the recipient's bank. This value is usually displayed to the recipient on their bank statement. We recommend setting this on every transfer; if you do not, we fall back to the `statement_descriptor`.
* The name of the transfer recipient. This value is informational and generally not verified by the recipient's bank. The business-to-business [Standard Entry Class (SEC) codes](/documentation/ach-standard-entry-class-codes) call this "individual name or receiving company name;" it's reasonable to include a business name in this field. This value is usually displayed to the recipient on their bank statement.
*/
#[Required('individual_name')]
public string $individualName;
Expand Down Expand Up @@ -264,7 +264,7 @@ public function withAmount(int $amount): self
}

/**
* The name by which the recipient knows the counterparty of this transaction. If you're processing payments on behalf of another party, use their name, not your own, so that it's more likely the recipient understands the context of the payment. This value is usually displayed to the recipient on their bank statement. We recommend setting this on every transfer; if you do not, we fall back to the `statement_descriptor`.
* The name by which the recipient knows the counterparty of this transaction. If you're processing payments on behalf of another party, use their name, not your own, so that it's more likely the recipient understands the context of the payment. This value is usually displayed to the recipient on their bank statement.
*/
public function withCompanyName(string $companyName): self
{
Expand All @@ -275,7 +275,7 @@ public function withCompanyName(string $companyName): self
}

/**
* The name of the transfer recipient. This value is informational and generally not verified by the recipient's bank. This value is usually displayed to the recipient on their bank statement. We recommend setting this on every transfer; if you do not, we fall back to the `statement_descriptor`.
* The name of the transfer recipient. This value is informational and generally not verified by the recipient's bank. The business-to-business [Standard Entry Class (SEC) codes](/documentation/ach-standard-entry-class-codes) call this "individual name or receiving company name;" it's reasonable to include a business name in this field. This value is usually displayed to the recipient on their bank statement.
*/
public function withIndividualName(string $individualName): self
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ enum FeeType: string

case VISA_PROCESSING_GUARANTEE_COMMERCIAL_CREDIT = 'visa_processing_guarantee_commercial_credit';

case VISA_ATM_CASH_WITHDRAWAL_DOMESTIC = 'visa_atm_cash_withdrawal_domestic';

case VISA_ATM_CASH_WITHDRAWAL_INTERNATIONAL = 'visa_atm_cash_withdrawal_international';

case VISA_ATM_CASH_DEPOSIT_DOMESTIC = 'visa_atm_cash_deposit_domestic';

case PULSE_SWITCH_FEE = 'pulse_switch_fee';

case PULSE_TOKENIZATION_FEE = 'pulse_tokenization_fee';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ enum FeeType: string

case VISA_PROCESSING_GUARANTEE_COMMERCIAL_CREDIT = 'visa_processing_guarantee_commercial_credit';

case VISA_ATM_CASH_WITHDRAWAL_DOMESTIC = 'visa_atm_cash_withdrawal_domestic';

case VISA_ATM_CASH_WITHDRAWAL_INTERNATIONAL = 'visa_atm_cash_withdrawal_international';

case VISA_ATM_CASH_DEPOSIT_DOMESTIC = 'visa_atm_cash_deposit_domestic';

case PULSE_SWITCH_FEE = 'pulse_switch_fee';

case PULSE_TOKENIZATION_FEE = 'pulse_tokenization_fee';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ enum FeeType: string

case VISA_PROCESSING_GUARANTEE_COMMERCIAL_CREDIT = 'visa_processing_guarantee_commercial_credit';

case VISA_ATM_CASH_WITHDRAWAL_DOMESTIC = 'visa_atm_cash_withdrawal_domestic';

case VISA_ATM_CASH_WITHDRAWAL_INTERNATIONAL = 'visa_atm_cash_withdrawal_international';

case VISA_ATM_CASH_DEPOSIT_DOMESTIC = 'visa_atm_cash_deposit_domestic';

case PULSE_SWITCH_FEE = 'pulse_switch_fee';

case PULSE_TOKENIZATION_FEE = 'pulse_tokenization_fee';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ enum FeeType: string

case VISA_PROCESSING_GUARANTEE_COMMERCIAL_CREDIT = 'visa_processing_guarantee_commercial_credit';

case VISA_ATM_CASH_WITHDRAWAL_DOMESTIC = 'visa_atm_cash_withdrawal_domestic';

case VISA_ATM_CASH_WITHDRAWAL_INTERNATIONAL = 'visa_atm_cash_withdrawal_international';

case VISA_ATM_CASH_DEPOSIT_DOMESTIC = 'visa_atm_cash_deposit_domestic';

case PULSE_SWITCH_FEE = 'pulse_switch_fee';

case PULSE_TOKENIZATION_FEE = 'pulse_tokenization_fee';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ enum FeeType: string

case VISA_PROCESSING_GUARANTEE_COMMERCIAL_CREDIT = 'visa_processing_guarantee_commercial_credit';

case VISA_ATM_CASH_WITHDRAWAL_DOMESTIC = 'visa_atm_cash_withdrawal_domestic';

case VISA_ATM_CASH_WITHDRAWAL_INTERNATIONAL = 'visa_atm_cash_withdrawal_international';

case VISA_ATM_CASH_DEPOSIT_DOMESTIC = 'visa_atm_cash_deposit_domestic';

case PULSE_SWITCH_FEE = 'pulse_switch_fee';

case PULSE_TOKENIZATION_FEE = 'pulse_tokenization_fee';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ enum FeeType: string

case VISA_PROCESSING_GUARANTEE_COMMERCIAL_CREDIT = 'visa_processing_guarantee_commercial_credit';

case VISA_ATM_CASH_WITHDRAWAL_DOMESTIC = 'visa_atm_cash_withdrawal_domestic';

case VISA_ATM_CASH_WITHDRAWAL_INTERNATIONAL = 'visa_atm_cash_withdrawal_international';

case VISA_ATM_CASH_DEPOSIT_DOMESTIC = 'visa_atm_cash_deposit_domestic';

case PULSE_SWITCH_FEE = 'pulse_switch_fee';

case PULSE_TOKENIZATION_FEE = 'pulse_tokenization_fee';
Expand Down
34 changes: 32 additions & 2 deletions src/CardPayments/CardPayment/Element/CardRefund/Interchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Increase\CardPayments\CardPayment\Element\CardRefund;

use Increase\CardPayments\CardPayment\Element\CardRefund\Interchange\Adjustment;
use Increase\CardPayments\CardPayment\Element\CardRefund\Interchange\Currency;
use Increase\Core\Attributes\Required;
use Increase\Core\Concerns\SdkModel;
Expand All @@ -12,7 +13,10 @@
/**
* Interchange assessed as a part of this transaction.
*
* @phpstan-import-type AdjustmentShape from \Increase\CardPayments\CardPayment\Element\CardRefund\Interchange\Adjustment
*
* @phpstan-type InterchangeShape = array{
* adjustment: null|Adjustment|AdjustmentShape,
* amount: string,
* code: string|null,
* currency: \Increase\CardPayments\CardPayment\Element\CardRefund\Interchange\Currency|value-of<\Increase\CardPayments\CardPayment\Element\CardRefund\Interchange\Currency>,
Expand All @@ -23,6 +27,12 @@ final class Interchange implements BaseModel
/** @use SdkModel<InterchangeShape> */
use SdkModel;

/**
* An adjustment the card network made to the interchange after this transaction cleared, if any.
*/
#[Required]
public ?Adjustment $adjustment;

/**
* The interchange amount given as a string containing a decimal number in major units (so e.g., "3.14" for $3.14). The amount is a positive number if it is credited to Increase (e.g., settlements) and a negative number if it is debited (e.g., refunds).
*/
Expand Down Expand Up @@ -50,13 +60,17 @@ enum: Currency::class,
*
* To enforce required parameters use
* ```
* Interchange::with(amount: ..., code: ..., currency: ...)
* Interchange::with(adjustment: ..., amount: ..., code: ..., currency: ...)
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new Interchange)->withAmount(...)->withCode(...)->withCurrency(...)
* (new Interchange)
* ->withAdjustment(...)
* ->withAmount(...)
* ->withCode(...)
* ->withCurrency(...)
* ```
*/
public function __construct()
Expand All @@ -69,22 +83,38 @@ public function __construct()
*
* You must use named parameters to construct any parameters with a default value.
*
* @param Adjustment|AdjustmentShape|null $adjustment
* @param Currency|value-of<Currency> $currency
*/
public static function with(
Adjustment|array|null $adjustment,
string $amount,
?string $code,
Currency|string $currency,
): self {
$self = new self;

$self['adjustment'] = $adjustment;
$self['amount'] = $amount;
$self['code'] = $code;
$self['currency'] = $currency;

return $self;
}

/**
* An adjustment the card network made to the interchange after this transaction cleared, if any.
*
* @param Adjustment|AdjustmentShape|null $adjustment
*/
public function withAdjustment(Adjustment|array|null $adjustment): self
{
$self = clone $this;
$self['adjustment'] = $adjustment;

return $self;
}

/**
* The interchange amount given as a string containing a decimal number in major units (so e.g., "3.14" for $3.14). The amount is a positive number if it is credited to Increase (e.g., settlements) and a negative number if it is debited (e.g., refunds).
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?php

declare(strict_types=1);

namespace Increase\CardPayments\CardPayment\Element\CardRefund\Interchange;

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

/**
* An adjustment the card network made to the interchange after this transaction cleared, if any.
*
* @phpstan-type AdjustmentShape = array{
* adjustedAt: \DateTimeInterface, amount: string, code: string
* }
*/
final class Adjustment implements BaseModel
{
/** @use SdkModel<AdjustmentShape> */
use SdkModel;

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

/**
* The adjustment amount given as a string containing a decimal number in major units (so e.g., "3.14" for $3.14). The amount is a positive number if it is credited to Increase and a negative number if it is debited.
*/
#[Required]
public string $amount;

/**
* The card network specific interchange code that applies after the adjustment.
*/
#[Required]
public string $code;

/**
* `new Adjustment()` is missing required properties by the API.
*
* To enforce required parameters use
* ```
* Adjustment::with(adjustedAt: ..., amount: ..., code: ...)
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new Adjustment)->withAdjustedAt(...)->withAmount(...)->withCode(...)
* ```
*/
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(
\DateTimeInterface $adjustedAt,
string $amount,
string $code
): self {
$self = new self;

$self['adjustedAt'] = $adjustedAt;
$self['amount'] = $amount;
$self['code'] = $code;

return $self;
}

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

return $self;
}

/**
* The adjustment amount given as a string containing a decimal number in major units (so e.g., "3.14" for $3.14). The amount is a positive number if it is credited to Increase and a negative number if it is debited.
*/
public function withAmount(string $amount): self
{
$self = clone $this;
$self['amount'] = $amount;

return $self;
}

/**
* The card network specific interchange code that applies after the adjustment.
*/
public function withCode(string $code): self
{
$self = clone $this;
$self['code'] = $code;

return $self;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,60 @@ enum FuelType: string

case KEROSENE_ULTRA_LOW_SULFUR = 'kerosene_ultra_low_sulfur';

case KEROSENE_LOW_SULFUR_NON_TAXABLE = 'kerosene_low_sulfur_non_taxable';

case KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE = 'kerosene_ultra_low_sulfur_non_taxable';

case ELECTRIC_VEHICLE_CHARGING_LEVEL_1_110_VOLT = 'electric_vehicle_charging_level_1_110_volt';

case ELECTRIC_VEHICLE_CHARGING_LEVEL_2_240_VOLT = 'electric_vehicle_charging_level_2_240_volt';

case ELECTRIC_VEHICLE_CHARGING_LEVEL_3_480_VOLT = 'electric_vehicle_charging_level_3_480_volt';

case BIODIESEL_BLEND_2_OFF_ROAD_NON_TAXABLE = 'biodiesel_blend_2_off_road_non_taxable';

case BIODIESEL_BLEND_5_OFF_ROAD_NON_TAXABLE = 'biodiesel_blend_5_off_road_non_taxable';

case BIODIESEL_BLEND_10_OFF_ROAD_NON_TAXABLE = 'biodiesel_blend_10_off_road_non_taxable';

case BIODIESEL_BLEND_11_OFF_ROAD_NON_TAXABLE = 'biodiesel_blend_11_off_road_non_taxable';

case BIODIESEL_BLEND_15_OFF_ROAD_NON_TAXABLE = 'biodiesel_blend_15_off_road_non_taxable';

case BIODIESEL_BLEND_20_OFF_ROAD_NON_TAXABLE = 'biodiesel_blend_20_off_road_non_taxable';

case DIESEL_1_OFF_ROAD_NON_TAXABLE = 'diesel_1_off_road_non_taxable';

case DIESEL_2_OFF_ROAD_NON_TAXABLE = 'diesel_2_off_road_non_taxable';

case DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE = 'diesel_1_premium_off_road_non_taxable';

case DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE = 'diesel_2_premium_off_road_non_taxable';

case ADDITIVE_DOSAGE = 'additive_dosage';

case ETHANOL_BLENDS_E16_TO_E84 = 'ethanol_blends_e16_to_e84';

case LOW_OCTANE_UNLEADED = 'low_octane_unleaded';

case BLENDED_DIESEL_1_AND_2 = 'blended_diesel_1_and_2';

case OFF_ROAD_REGULAR_NON_TAXABLE = 'off_road_regular_non_taxable';

case OFF_ROAD_MID_OR_PLUS_NON_TAXABLE = 'off_road_mid_or_plus_non_taxable';

case OFF_ROAD_PREMIUM_OR_SUPER_NON_TAXABLE = 'off_road_premium_or_super_non_taxable';

case OFF_ROAD_MID_OR_PLUS_2_NON_TAXABLE = 'off_road_mid_or_plus_2_non_taxable';

case OFF_ROAD_PREMIUM_OR_SUPER_2_NON_TAXABLE = 'off_road_premium_or_super_2_non_taxable';

case RECREATIONAL_FUEL_90_OCTANE = 'recreational_fuel_90_octane';

case HYDROGEN_H35 = 'hydrogen_h35';

case HYDROGEN_H70 = 'hydrogen_h70';

case RENEWABLE_DIESEL_R95_OR_GREATER_OFF_ROAD_NON_TAXABLE = 'renewable_diesel_r95_or_greater_off_road_non_taxable';

case BIODIESEL_BLEND_1_OFF_ROAD_NON_TAXABLE = 'biodiesel_blend_1_off_road_non_taxable';
Expand All @@ -201,6 +247,8 @@ enum FuelType: string

case RENEWABLE_DIESEL_BIODIESEL_6_TO_20_OFF_ROAD_NON_TAXABLE = 'renewable_diesel_biodiesel_6_to_20_off_road_non_taxable';

case RENEWABLE_DIESEL_R25_HYDROTREATED_VEGETABLE_OIL_25_BLEND = 'renewable_diesel_r25_hydrotreated_vegetable_oil_25_blend';

case ELECTRIC_VEHICLE_CHARGING_LEVEL_4_800_VOLT = 'electric_vehicle_charging_level_4_800_volt';

case ELECTRIC_VEHICLE_CHARGING_LEVEL_5_MEGAWATT = 'electric_vehicle_charging_level_5_megawatt';
Expand Down
Loading
Loading