Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Pass EventTicketClass GET from API does not include issuerName, but localizedIssuerName #12

Open
jdnwi opened this issue Jan 24, 2023 · 3 comments

Comments

@jdnwi
Copy link

jdnwi commented Jan 24, 2023

I'm working with the Google Pass for EventTicketClass. After successfully creating a Class, I am later retrieving it via the Event Ticket Class Repository GET function. The retrieval is OK, but the conversion to the Class object fails due to class validation on the API response.

Here is a sample API response:

{
  "allowMultipleUsersPerObject": true,
  "confirmationCodeLabel": "orderNumber",
  "dateTime": {
    "doorsOpen": "2023-01-18T17:30-05:00",
    "end": "2023-01-18T21:00-05:00",
    "kind": "walletobjects#eventDateTime",
    "start": "2023-01-18T18:30-05:00"
  },
  "eventId": "my-id",
  "eventName": {
    "defaultValue": {
      "kind": "walletobjects#translatedString",
      "language": "en",
      "value": "my event name"
    },
    "kind": "walletobjects#localizedString"
  },
  "homepageUri": {
    "uri": "my.uri"
  },
  "id": "3388000000022084756.my.uri_my-id",
  "kind": "walletobjects#eventTicketClass",
  "localizedIssuerName": {
    "defaultValue": {
      "kind": "walletobjects#translatedString",
      "language": "en",
      "value": "myissuer"
    },
    "kind": "walletobjects#localizedString"
  },
  "multipleDevicesAndHoldersAllowedStatus": "multipleHolders",
  "reviewStatus": "approved",
  "venue": {
    "address": {
      "defaultValue": {
        "kind": "walletobjects#translatedString",
        "language": "en",
        "value": "my address"
      },
      "kind": "walletobjects#localizedString"
    },
    "kind": "walletobjects#eventVenue",
    "name": {
      "defaultValue": {
        "kind": "walletobjects#translatedString",
        "language": "en",
        "value": "my location"
      },
      "kind": "walletobjects#localizedString"
    }
  },
  "version": "1"
}

BaseRepository calls the get function and when it runs return new $class($response); it throws a ValidationException with the message:

Validation errors:
	 - `Chiiya\Passes\Google\Passes\EventTicketClass->issuerName`: The field is required.

The response does not include issuerName, but localizedIssuerName. I believe this should be corrected to match the API's response.

@chiiya
Copy link
Owner

chiiya commented Jan 30, 2023

Weird, according to the documentation it should be a required property: https://developers.google.com/wallet/tickets/events/rest/v1/eventticketclass#EventTicketClass
Is this an issue only for the GET request?

@jdnwi
Copy link
Author

jdnwi commented Jan 30, 2023

Weird, according to the documentation it should be a required property: https://developers.google.com/wallet/tickets/events/rest/v1/eventticketclass#EventTicketClass Is this an issue only for the GET request?

Yes- it's only an issue in the GET request

@Gamesh
Copy link

Gamesh commented Jan 16, 2025

The same is true for LoyaltyClass
both IssuerName and programName are not returned, but rather localized versions of these fields

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants