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: 255
openapi_spec_hash: 4458c613643910026be17923a699563f
openapi_spec_hash: 52ad873e23abfe508bdc93ffcba9b4b4
config_hash: de151ebd21a0bd391662389b310a8f49
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions src/DigitalCardProfiles/DigitalCardProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@
use Increase\Core\Attributes\Required;
use Increase\Core\Concerns\SdkModel;
use Increase\Core\Contracts\BaseModel;
use Increase\DigitalCardProfiles\DigitalCardProfile\ApplePay;
use Increase\DigitalCardProfiles\DigitalCardProfile\Status;
use Increase\DigitalCardProfiles\DigitalCardProfile\TextColor;
use Increase\DigitalCardProfiles\DigitalCardProfile\Type;

/**
* This contains artwork and metadata relating to a Card's appearance in digital wallet apps like Apple Pay and Google Pay. For more information, see our guide on [digital card artwork](https://increase.com/documentation/card-art).
*
* @phpstan-import-type ApplePayShape from \Increase\DigitalCardProfiles\DigitalCardProfile\ApplePay
* @phpstan-import-type TextColorShape from \Increase\DigitalCardProfiles\DigitalCardProfile\TextColor
*
* @phpstan-type DigitalCardProfileShape = array{
* id: string,
* appIconFileID: string,
* applePay: null|ApplePay|ApplePayShape,
* backgroundImageFileID: string,
* cardDescription: string,
* contactEmail: string|null,
Expand Down Expand Up @@ -50,6 +53,12 @@ final class DigitalCardProfile implements BaseModel
#[Required('app_icon_file_id')]
public string $appIconFileID;

/**
* Apple Pay specific settings for the Card Profile.
*/
#[Required('apple_pay')]
public ?ApplePay $applePay;

/**
* The identifier of the File containing the card's front image.
*/
Expand Down Expand Up @@ -134,6 +143,7 @@ final class DigitalCardProfile implements BaseModel
* DigitalCardProfile::with(
* id: ...,
* appIconFileID: ...,
* applePay: ...,
* backgroundImageFileID: ...,
* cardDescription: ...,
* contactEmail: ...,
Expand All @@ -155,6 +165,7 @@ final class DigitalCardProfile implements BaseModel
* (new DigitalCardProfile)
* ->withID(...)
* ->withAppIconFileID(...)
* ->withApplePay(...)
* ->withBackgroundImageFileID(...)
* ->withCardDescription(...)
* ->withContactEmail(...)
Expand All @@ -179,13 +190,15 @@ public function __construct()
*
* You must use named parameters to construct any parameters with a default value.
*
* @param ApplePay|ApplePayShape|null $applePay
* @param Status|value-of<Status> $status
* @param TextColor|TextColorShape $textColor
* @param Type|value-of<Type> $type
*/
public static function with(
string $id,
string $appIconFileID,
ApplePay|array|null $applePay,
string $backgroundImageFileID,
string $cardDescription,
?string $contactEmail,
Expand All @@ -203,6 +216,7 @@ public static function with(

$self['id'] = $id;
$self['appIconFileID'] = $appIconFileID;
$self['applePay'] = $applePay;
$self['backgroundImageFileID'] = $backgroundImageFileID;
$self['cardDescription'] = $cardDescription;
$self['contactEmail'] = $contactEmail;
Expand Down Expand Up @@ -241,6 +255,19 @@ public function withAppIconFileID(string $appIconFileID): self
return $self;
}

/**
* Apple Pay specific settings for the Card Profile.
*
* @param ApplePay|ApplePayShape|null $applePay
*/
public function withApplePay(ApplePay|array|null $applePay): self
{
$self = clone $this;
$self['applePay'] = $applePay;

return $self;
}

/**
* The identifier of the File containing the card's front image.
*/
Expand Down
121 changes: 121 additions & 0 deletions src/DigitalCardProfiles/DigitalCardProfile/ApplePay.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?php

declare(strict_types=1);

namespace Increase\DigitalCardProfiles\DigitalCardProfile;

use Increase\Core\Attributes\Required;
use Increase\Core\Concerns\SdkModel;
use Increase\Core\Contracts\BaseModel;
use Increase\DigitalCardProfiles\DigitalCardProfile\ApplePay\AssociatedApplicationIdentifier;
use Increase\DigitalCardProfiles\DigitalCardProfile\ApplePay\AssociatedStoreIdentifier;

/**
* Apple Pay specific settings for the Card Profile.
*
* @phpstan-import-type AssociatedApplicationIdentifierShape from \Increase\DigitalCardProfiles\DigitalCardProfile\ApplePay\AssociatedApplicationIdentifier
* @phpstan-import-type AssociatedStoreIdentifierShape from \Increase\DigitalCardProfiles\DigitalCardProfile\ApplePay\AssociatedStoreIdentifier
*
* @phpstan-type ApplePayShape = array{
* associatedApplicationIdentifiers: list<AssociatedApplicationIdentifier|AssociatedApplicationIdentifierShape>,
* associatedStoreIdentifiers: list<AssociatedStoreIdentifier|AssociatedStoreIdentifierShape>,
* }
*/
final class ApplePay implements BaseModel
{
/** @use SdkModel<ApplePayShape> */
use SdkModel;

/**
* The applications associated with cards using this Card Profile.
*
* @var list<AssociatedApplicationIdentifier> $associatedApplicationIdentifiers
*/
#[Required(
'associated_application_identifiers',
list: AssociatedApplicationIdentifier::class,
)]
public array $associatedApplicationIdentifiers;

/**
* The App Store listings of the applications associated with cards using this Card Profile.
*
* @var list<AssociatedStoreIdentifier> $associatedStoreIdentifiers
*/
#[Required(
'associated_store_identifiers',
list: AssociatedStoreIdentifier::class
)]
public array $associatedStoreIdentifiers;

/**
* `new ApplePay()` is missing required properties by the API.
*
* To enforce required parameters use
* ```
* ApplePay::with(
* associatedApplicationIdentifiers: ..., associatedStoreIdentifiers: ...
* )
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new ApplePay)
* ->withAssociatedApplicationIdentifiers(...)
* ->withAssociatedStoreIdentifiers(...)
* ```
*/
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<AssociatedApplicationIdentifier|AssociatedApplicationIdentifierShape> $associatedApplicationIdentifiers
* @param list<AssociatedStoreIdentifier|AssociatedStoreIdentifierShape> $associatedStoreIdentifiers
*/
public static function with(
array $associatedApplicationIdentifiers,
array $associatedStoreIdentifiers
): self {
$self = new self;

$self['associatedApplicationIdentifiers'] = $associatedApplicationIdentifiers;
$self['associatedStoreIdentifiers'] = $associatedStoreIdentifiers;

return $self;
}

/**
* The applications associated with cards using this Card Profile.
*
* @param list<AssociatedApplicationIdentifier|AssociatedApplicationIdentifierShape> $associatedApplicationIdentifiers
*/
public function withAssociatedApplicationIdentifiers(
array $associatedApplicationIdentifiers
): self {
$self = clone $this;
$self['associatedApplicationIdentifiers'] = $associatedApplicationIdentifiers;

return $self;
}

/**
* The App Store listings of the applications associated with cards using this Card Profile.
*
* @param list<AssociatedStoreIdentifier|AssociatedStoreIdentifierShape> $associatedStoreIdentifiers
*/
public function withAssociatedStoreIdentifiers(
array $associatedStoreIdentifiers
): self {
$self = clone $this;
$self['associatedStoreIdentifiers'] = $associatedStoreIdentifiers;

return $self;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

declare(strict_types=1);

namespace Increase\DigitalCardProfiles\DigitalCardProfile\ApplePay;

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

/**
* @phpstan-type AssociatedApplicationIdentifierShape = array{identifier: string}
*/
final class AssociatedApplicationIdentifier implements BaseModel
{
/** @use SdkModel<AssociatedApplicationIdentifierShape> */
use SdkModel;

/**
* The application identifier, composed of your Apple Developer Team ID and the application's bundle identifier, like `ABCDE12345.com.example.app`.
*/
#[Required]
public string $identifier;

/**
* `new AssociatedApplicationIdentifier()` is missing required properties by the API.
*
* To enforce required parameters use
* ```
* AssociatedApplicationIdentifier::with(identifier: ...)
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new AssociatedApplicationIdentifier)->withIdentifier(...)
* ```
*/
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 $identifier): self
{
$self = new self;

$self['identifier'] = $identifier;

return $self;
}

/**
* The application identifier, composed of your Apple Developer Team ID and the application's bundle identifier, like `ABCDE12345.com.example.app`.
*/
public function withIdentifier(string $identifier): self
{
$self = clone $this;
$self['identifier'] = $identifier;

return $self;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

declare(strict_types=1);

namespace Increase\DigitalCardProfiles\DigitalCardProfile\ApplePay;

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

/**
* @phpstan-type AssociatedStoreIdentifierShape = array{identifier: string}
*/
final class AssociatedStoreIdentifier implements BaseModel
{
/** @use SdkModel<AssociatedStoreIdentifierShape> */
use SdkModel;

/**
* The numeric App Store identifier.
*/
#[Required]
public string $identifier;

/**
* `new AssociatedStoreIdentifier()` is missing required properties by the API.
*
* To enforce required parameters use
* ```
* AssociatedStoreIdentifier::with(identifier: ...)
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new AssociatedStoreIdentifier)->withIdentifier(...)
* ```
*/
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 $identifier): self
{
$self = new self;

$self['identifier'] = $identifier;

return $self;
}

/**
* The numeric App Store identifier.
*/
public function withIdentifier(string $identifier): self
{
$self = clone $this;
$self['identifier'] = $identifier;

return $self;
}
}
Loading
Loading