Expired Event tickets  |  Google for Developers (2024)

  • Home
  • Products
  • Google Wallet
  • Event tickets
Stay organized with collections Save and categorize content based on your preferences.

In Google Wallet, there's an "Expired passes" section that contains all archived or inactive passes.

A pass is moved to the "Expired passes" section if at least one of the following conditions is true:

  • It's been at least 72 hours since class.dateTime.end expired. If class.dateTime.end isn't specified, class.dateTime.start is usedinstead. The pass moves to "Expired passes" anytime between 72-96 hours after class.dateTime.end or class.dateTime.start expires.
  • When the object.validTimeInterval.end.date expires the pass moves to "Expired passes" anytime up to 24 hours after.
  • The state of the object object.state field is marked as Expired, Inactive, or Completed.

The following code sample demonstrates expiring a pass object using the GoogleWallet API.

Java

To start your integration in Java, refer to our complete code samples on GitHub.

/** * Expire an object. * * <p>Sets the object's state to Expired. If the valid time interval is already set, the pass will * expire automatically up to 24 hours after. * * @param issuerId The issuer ID being used for this request. * @param objectSuffix Developer-defined unique ID for this pass object. * @return The pass object ID: "{issuerId}.{objectSuffix}" */public String expireObject(String issuerId, String objectSuffix) throws IOException { // Check if the object exists try { service.eventticketobject().get(String.format("%s.%s", issuerId, objectSuffix)).execute(); } catch (GoogleJsonResponseException ex) { if (ex.getStatusCode() == 404) { // Object does not exist System.out.printf("Object %s.%s not found!%n", issuerId, objectSuffix); return String.format("%s.%s", issuerId, objectSuffix); } else { // Something else went wrong... ex.printStackTrace(); return String.format("%s.%s", issuerId, objectSuffix); } } // Patch the object, setting the pass as expired EventTicketObject patchBody = new EventTicketObject().setState("EXPIRED"); EventTicketObject response = service .eventticketobject() .patch(String.format("%s.%s", issuerId, objectSuffix), patchBody) .execute(); System.out.println("Object expiration response"); System.out.println(response.toPrettyString()); return response.getId();}

PHP

To start your integration in PHP, refer to our complete code samples on GitHub.

/** * Expire an object. * * Sets the object's state to Expired. If the valid time interval is * already set, the pass will expire automatically up to 24 hours after. * * @param string $issuerId The issuer ID being used for this request. * @param string $objectSuffix Developer-defined unique ID for this pass object. * * @return string The pass object ID: "{$issuerId}.{$objectSuffix}" */public function expireObject(string $issuerId, string $objectSuffix){ // Check if the object exists try { $this->service->eventticketobject->get("{$issuerId}.{$objectSuffix}"); } catch (Google\Service\Exception $ex) { if (!empty($ex->getErrors()) && $ex->getErrors()[0]['reason'] == 'resourceNotFound') { print("Object {$issuerId}.{$objectSuffix} not found!"); return "{$issuerId}.{$objectSuffix}"; } else { // Something else went wrong... print_r($ex); return "{$issuerId}.{$objectSuffix}"; } } // Patch the object, setting the pass as expired $patchBody = new EventTicketObject([ 'state' => 'EXPIRED' ]); $response = $this->service->eventticketobject->patch("{$issuerId}.{$objectSuffix}", $patchBody); print "Object expiration response\n"; print_r($response); return $response->id;}

Python

To start your integration in Python, refer to our complete code samples on GitHub.

def expire_object(self, issuer_id: str, object_suffix: str) -> str: """Expire an object. Sets the object's state to Expired. If the valid time interval is already set, the pass will expire automatically up to 24 hours after. Args: issuer_id (str): The issuer ID being used for this request. object_suffix (str): Developer-defined unique ID for the pass object. Returns: The pass object ID: f"{issuer_id}.{object_suffix}" """ # Check if the object exists try: response = self.client.eventticketobject().get(resourceId=f'{issuer_id}.{object_suffix}').execute() except HttpError as e: if e.status_code == 404: print(f'Object {issuer_id}.{object_suffix} not found!') return f'{issuer_id}.{object_suffix}' else: # Something else went wrong... print(e.error_details) return f'{issuer_id}.{object_suffix}' # Patch the object, setting the pass as expired patch_body = {'state': 'EXPIRED'} response = self.client.eventticketobject().patch( resourceId=f'{issuer_id}.{object_suffix}', body=patch_body).execute() print('Object expiration response') print(response) return f'{issuer_id}.{object_suffix}'

C#

To start your integration in C#, refer to our complete code samples on GitHub.

/// <summary>/// Expire an object./// <para />/// Sets the object's state to Expired. If the valid time interval is already/// set, the pass will expire automatically up to 24 hours after./// </summary>/// <param name="issuerId">The issuer ID being used for this request.</param>/// <param name="objectSuffix">Developer-defined unique ID for this pass object.</param>/// <returns>The pass object ID: "{issuerId}.{objectSuffix}"</returns>public string ExpireObject(string issuerId, string objectSuffix){ // Check if the object exists Stream responseStream = service.Eventticketobject .Get($"{issuerId}.{objectSuffix}") .ExecuteAsStream(); StreamReader responseReader = new StreamReader(responseStream); JObject jsonResponse = JObject.Parse(responseReader.ReadToEnd()); if (jsonResponse.ContainsKey("error")) { if (jsonResponse["error"].Value<int>("code") == 404) { // Object does not exist Console.WriteLine($"Object {issuerId}.{objectSuffix} not found!"); return $"{issuerId}.{objectSuffix}"; } else { // Something else went wrong... Console.WriteLine(jsonResponse.ToString()); return $"{issuerId}.{objectSuffix}"; } } // Patch the object, setting the pass as expired EventTicketObject patchBody = new EventTicketObject { State = "EXPIRED" }; responseStream = service.Eventticketobject .Patch(patchBody, $"{issuerId}.{objectSuffix}") .ExecuteAsStream(); responseReader = new StreamReader(responseStream); jsonResponse = JObject.Parse(responseReader.ReadToEnd()); Console.WriteLine("Object expiration response"); Console.WriteLine(jsonResponse.ToString()); return $"{issuerId}.{objectSuffix}";}

Node.js

To start your integration in Node, refer to our complete code samples on GitHub.

/** * Expire an object. * * Sets the object's state to Expired. If the valid time interval is * already set, the pass will expire automatically up to 24 hours after. * * @param {string} issuerId The issuer ID being used for this request. * @param {string} objectSuffix Developer-defined unique ID for the pass object. * * @returns {string} The pass object ID: `${issuerId}.${objectSuffix}` */async expireObject(issuerId, objectSuffix) { let response; // Check if the object exists try { response = await this.client.eventticketobject.get({ resourceId: `${issuerId}.${objectSuffix}` }); } catch (err) { if (err.response && err.response.status === 404) { console.log(`Object ${issuerId}.${objectSuffix} not found!`); return `${issuerId}.${objectSuffix}`; } else { // Something else went wrong... console.log(err); return `${issuerId}.${objectSuffix}`; } } // Patch the object, setting the pass as expired let patchBody = { 'state': 'EXPIRED' }; response = await this.client.eventticketobject.patch({ resourceId: `${issuerId}.${objectSuffix}`, requestBody: patchBody }); console.log('Object expiration response'); console.log(response); return `${issuerId}.${objectSuffix}`;}

Go

To start your integration in Go, refer to our complete code samples on GitHub code samples on Github.

// Expire an object.//// Sets the object's state to Expired. If the valid time interval is// already set, the pass will expire automatically up to 24 hours after.func (d *demoEventticket) expireObject(issuerId, objectSuffix string) {eventticketObject := &walletobjects.EventTicketObject{State: "EXPIRED",}res, err := d.service.Eventticketobject.Patch(fmt.Sprintf("%s.%s", issuerId, objectSuffix), eventticketObject).Do()if err != nil {log.Fatalf("Unable to patch object: %v", err)} else {fmt.Printf("Object expiration id:\n%s\n", res.Id)}}

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-09-13 UTC.

Expired Event tickets  |  Google for Developers (2024)
Top Articles
IBC 2016 - Empowering The Stakeholders Consultation Committee (SCC)
Why Is My Game Hitting My CPU (Not GPU)? How To Make It Use The GPU Instead - Tech Overwrite
The Blackening Showtimes Near Century Aurora And Xd
Dte Outage Map Woodhaven
Rainbird Wiring Diagram
Kentucky Downs Entries Today
Sunday World Northern Ireland
Espn Expert Picks Week 2
Natureza e Qualidade de Produtos - Gestão da Qualidade
Qhc Learning
Craigslist Apartments In Philly
iOS 18 Hadir, Tapi Mana Fitur AI Apple?
Available Training - Acadis® Portal
Games Like Mythic Manor
Define Percosivism
Echat Fr Review Pc Retailer In Qatar Prestige Pc Providers – Alpha Marine Group
Best Uf Sororities
Yakimacraigslist
Nhl Tankathon Mock Draft
Rufus Benton "Bent" Moulds Jr. Obituary 2024 - Webb & Stephens Funeral Homes
Sef2 Lewis Structure
Jeffers Funeral Home Obituaries Greeneville Tennessee
Minnick Funeral Home West Point Nebraska
Holiday Gift Bearer In Egypt
Sunset Time November 5 2022
Manuela Qm Only
Is Light Raid Hard
Access a Shared Resource | Computing for Arts + Sciences
Enduring Word John 15
Cylinder Head Bolt Torque Values
Weather Underground Durham
Winterset Rants And Raves
Parent Management Training (PMT) Worksheet | HappierTHERAPY
Greater Orangeburg
Ghid depunere declarație unică
Chicago Pd Rotten Tomatoes
Devotion Showtimes Near Mjr Universal Grand Cinema 16
Tyler Perry Marriage Counselor Play 123Movies
Ursula Creed Datasheet
Man Stuff Idaho
Postgraduate | Student Recruitment
Nina Flowers
Arcane Bloodline Pathfinder
Best GoMovies Alternatives
18006548818
Login
Conan Exiles Colored Crystal
Dying Light Mother's Day Roof
Sapphire Pine Grove
Syrie Funeral Home Obituary
How to Choose Where to Study Abroad
Pauline Frommer's Paris 2007 (Pauline Frommer Guides) - SILO.PUB
Latest Posts
Article information

Author: Eusebia Nader

Last Updated:

Views: 6444

Rating: 5 / 5 (80 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Eusebia Nader

Birthday: 1994-11-11

Address: Apt. 721 977 Ebert Meadows, Jereville, GA 73618-6603

Phone: +2316203969400

Job: International Farming Consultant

Hobby: Reading, Photography, Shooting, Singing, Magic, Kayaking, Mushroom hunting

Introduction: My name is Eusebia Nader, I am a encouraging, brainy, lively, nice, famous, healthy, clever person who loves writing and wants to share my knowledge and understanding with you.