Skip to content

Commit

Permalink
Add support for the wide logos of various types
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Oct 19, 2023
1 parent 0974146 commit ca1d372
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Google/Components/Flight/FlightCarrier.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ class FlightCarrier extends Component
*/
public ?Image $airlineLogo;

/**
* Optional.
* The wide logo image of the ticket. This image is displayed in the top title bar instead of the logo and card title.
*/
public ?Image $wideAirlineLogo;

/**
* Optional.
* A logo for the airline alliance, displayed above the QR code that the passenger scans to board.
Expand Down
6 changes: 6 additions & 0 deletions src/Google/Passes/EventTicketClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ class EventTicketClass extends BaseClass
*/
public ?Image $logo;

/**
* Optional.
* The wide logo of the ticket. When provided, this will be used in place of the logo in the top left of the card view.
*/
public ?Image $wideLogo;

/**
* Optional.
* Event venue details.
Expand Down
6 changes: 6 additions & 0 deletions src/Google/Passes/GenericObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ class GenericObject extends AbstractObject
*/
public ?Image $logo;

/**
* Optional.
* The wide logo of the pass. When provided, this will be used in place of the logo in the top left of the card view.
*/
public ?Image $wideLogo;

/**
* Optional.
* The background color for the card. If not set, the dominant color of the hero image is used, and if no hero
Expand Down
6 changes: 6 additions & 0 deletions src/Google/Passes/GiftCardClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ class GiftCardClass extends BaseClass
*/
public ?Image $programLogo;

/**
* Optional.
* The wide logo of the gift card program or company. When provided, this will be used in place of the program logo in the top left of the card view.
*/
public ?Image $wideProgramLogo;

/**
* Optional.
* The label to display for the PIN, such as "4-digit PIN".
Expand Down
6 changes: 6 additions & 0 deletions src/Google/Passes/LoyaltyClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ class LoyaltyClass extends BaseClass
#[Required]
public ?Image $programLogo;

/**
* Optional.
* The wide logo of the loyalty program or company. When provided, this will be used in place of the program logo in the top left of the card view.
*/
public ?Image $wideProgramLogo;

/**
* Optional.
* The account name label, such as "Member Name." Recommended maximum length is 15 characters to
Expand Down
6 changes: 6 additions & 0 deletions src/Google/Passes/OfferClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ class OfferClass extends BaseClass
*/
public ?Image $titleImage;

/**
* Optional.
* The wide title image of the offer. When provided, this will be used in place of the title image in the top left of the card view.
*/
public ?Image $wideTitleImage;

/**
* Optional.
* The details of the offer.
Expand Down
6 changes: 6 additions & 0 deletions src/Google/Passes/TransitClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ class TransitClass extends BaseClass
#[Required]
public ?Image $logo;

/**
* Optional.
* The wide logo of the ticket. When provided, this will be used in place of the logo in the top left of the card view.
*/
public ?Image $wideLogo;

/**
* Required.
* The type of transit this class represents, such as "bus".
Expand Down
2 changes: 2 additions & 0 deletions tests/Google/Fixtures/Passes.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public static function offerClass(): array
'redemptionChannel' => RedemptionChannel::INSTORE,
'provider' => 'ACME',
'titleImage' => Image::make('https://example.org/title.png'),
'wideTitleImage' => Image::make('https://example.org/wide-title.png'),
'helpUri' => Uri::make('https://example.org/help'),
'localizedDetails' => LocalizedString::make('en', '::value::'),
'imageModulesData' => [new ImageModuleData(mainImage: Image::make('https://example.org/wallet.png'))],
Expand Down Expand Up @@ -99,6 +100,7 @@ public static function genericObject(): array
'hasUsers' => true,
'header' => LocalizedString::make('en', 'Header'),
'logo' => Image::make('https://domain.com/logo.png'),
'wideLogo' => Image::make('https://domain.com/wide-logo.png'),
'heroImage' => Image::make('https://domain.com/hero-image.png'),
'hexBackgroundColor' => '#333',
'state' => State::ACTIVE,
Expand Down
6 changes: 6 additions & 0 deletions tests/Google/Fixtures/responses/generic-object.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@
"date": "2023-01-01T13:00:00+00:00"
}
},
"wideLogo": {
"kind": "walletobjects#image",
"sourceUri": {
"uri": "https:\/\/domain.com\/wide-logo.png"
}
},
"textModulesData": [
{
"header": "header-1",
Expand Down
6 changes: 6 additions & 0 deletions tests/Google/Fixtures/responses/generic-objects.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@
"date": "2023-01-01T13:00:00+00:00"
}
},
"wideLogo": {
"kind": "walletobjects#image",
"sourceUri": {
"uri": "https:\/\/domain.com\/wide-logo.png"
}
},
"textModulesData": [
{
"header": "header-1",
Expand Down
6 changes: 6 additions & 0 deletions tests/Google/Fixtures/responses/offer-class.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
"uri": "https://example.org/title.png"
}
},
"wideTitleImage": {
"kind": "walletobjects#image",
"sourceUri": {
"uri": "https://example.org/wide-title.png"
}
},
"helpUri": {
"uri": "https://example.org/help"
},
Expand Down
6 changes: 6 additions & 0 deletions tests/Google/Fixtures/responses/offer-classes.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"uri": "https://example.org/title.png"
}
},
"wideTitleImage": {
"kind": "walletobjects#image",
"sourceUri": {
"uri": "https://example.org/wide-title.png"
}
},
"helpUri": {
"uri": "https://example.org/help"
},
Expand Down

0 comments on commit ca1d372

Please sign in to comment.