From ca1d372b6d8a5b9bb80baa9b727d3597737b65fa Mon Sep 17 00:00:00 2001 From: Marcus Bointon Date: Thu, 19 Oct 2023 18:47:21 +0200 Subject: [PATCH] Add support for the wide logos of various types --- src/Google/Components/Flight/FlightCarrier.php | 6 ++++++ src/Google/Passes/EventTicketClass.php | 6 ++++++ src/Google/Passes/GenericObject.php | 6 ++++++ src/Google/Passes/GiftCardClass.php | 6 ++++++ src/Google/Passes/LoyaltyClass.php | 6 ++++++ src/Google/Passes/OfferClass.php | 6 ++++++ src/Google/Passes/TransitClass.php | 6 ++++++ tests/Google/Fixtures/Passes.php | 2 ++ tests/Google/Fixtures/responses/generic-object.json | 6 ++++++ tests/Google/Fixtures/responses/generic-objects.json | 6 ++++++ tests/Google/Fixtures/responses/offer-class.json | 6 ++++++ tests/Google/Fixtures/responses/offer-classes.json | 6 ++++++ 12 files changed, 68 insertions(+) diff --git a/src/Google/Components/Flight/FlightCarrier.php b/src/Google/Components/Flight/FlightCarrier.php index e366615..b1aea85 100644 --- a/src/Google/Components/Flight/FlightCarrier.php +++ b/src/Google/Components/Flight/FlightCarrier.php @@ -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. diff --git a/src/Google/Passes/EventTicketClass.php b/src/Google/Passes/EventTicketClass.php index 5c2fd0b..e022cf5 100644 --- a/src/Google/Passes/EventTicketClass.php +++ b/src/Google/Passes/EventTicketClass.php @@ -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. diff --git a/src/Google/Passes/GenericObject.php b/src/Google/Passes/GenericObject.php index 5828759..4fa3584 100644 --- a/src/Google/Passes/GenericObject.php +++ b/src/Google/Passes/GenericObject.php @@ -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 diff --git a/src/Google/Passes/GiftCardClass.php b/src/Google/Passes/GiftCardClass.php index e9f613f..c37ff64 100644 --- a/src/Google/Passes/GiftCardClass.php +++ b/src/Google/Passes/GiftCardClass.php @@ -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". diff --git a/src/Google/Passes/LoyaltyClass.php b/src/Google/Passes/LoyaltyClass.php index 955f829..b496406 100644 --- a/src/Google/Passes/LoyaltyClass.php +++ b/src/Google/Passes/LoyaltyClass.php @@ -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 diff --git a/src/Google/Passes/OfferClass.php b/src/Google/Passes/OfferClass.php index 2dd15bc..3e3f73a 100644 --- a/src/Google/Passes/OfferClass.php +++ b/src/Google/Passes/OfferClass.php @@ -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. diff --git a/src/Google/Passes/TransitClass.php b/src/Google/Passes/TransitClass.php index 32d9b54..22d2f35 100644 --- a/src/Google/Passes/TransitClass.php +++ b/src/Google/Passes/TransitClass.php @@ -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". diff --git a/tests/Google/Fixtures/Passes.php b/tests/Google/Fixtures/Passes.php index d1024ef..59a2814 100644 --- a/tests/Google/Fixtures/Passes.php +++ b/tests/Google/Fixtures/Passes.php @@ -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'))], @@ -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, diff --git a/tests/Google/Fixtures/responses/generic-object.json b/tests/Google/Fixtures/responses/generic-object.json index 1b547fc..1237b01 100644 --- a/tests/Google/Fixtures/responses/generic-object.json +++ b/tests/Google/Fixtures/responses/generic-object.json @@ -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", diff --git a/tests/Google/Fixtures/responses/generic-objects.json b/tests/Google/Fixtures/responses/generic-objects.json index 7123c3f..de6348c 100644 --- a/tests/Google/Fixtures/responses/generic-objects.json +++ b/tests/Google/Fixtures/responses/generic-objects.json @@ -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", diff --git a/tests/Google/Fixtures/responses/offer-class.json b/tests/Google/Fixtures/responses/offer-class.json index e203332..981c617 100644 --- a/tests/Google/Fixtures/responses/offer-class.json +++ b/tests/Google/Fixtures/responses/offer-class.json @@ -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" }, diff --git a/tests/Google/Fixtures/responses/offer-classes.json b/tests/Google/Fixtures/responses/offer-classes.json index ee22f1f..535880c 100644 --- a/tests/Google/Fixtures/responses/offer-classes.json +++ b/tests/Google/Fixtures/responses/offer-classes.json @@ -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" },