Comments (2)
Hello!
Unfortunately we do not have a Java 8-compatible JAR at this time. I will bring this up to the Engineering team to take a look at! In the meantime, you can continue to use the Google Wallet API, however you will need to instead build the API requests as JSON strings instead of using the object types defined by the library. An example can be found below:
HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();
HttpRequestFactory httpRequestFactory = httpTransport.createRequestFactory();
GenericUrl objectUrl = new GenericUrl(String.format("https://walletobjects.googleapis.com/walletobjects/v1/genericObject/%s.%s", issuerId, objectSuffix));
// Build a payload for an object
// Make sure to include all required properties
// for this object type
String objectPayload = String.format(
"{"
+ " \"id\": \"%s.%s\","
+ " \"classId\": \"%s.%s\""
+ "}",
issuerId, objectSuffix, issuerId, classSuffix);
// Check if the object exists already
// Build a GET request
HttpRequest objectRequest = httpRequestFactory.buildGetRequest(objectUrl);
// Add auth to the request headers
objectRequest
.setHeaders(new HttpHeaders()
.setAuthorization("Bearer " + credentials.getAccessToken().getTokenValue()));
// Invoke the GET request
HttpResponse objectResponse = objectRequest.execute();
if (objectResponse.getStatusCode() == 404) {
// Object does not yet exist
// Send POST request to create it
// Include the JSON payload
objectRequest = httpRequestFactory.buildPostRequest(
objectUrl,
new JsonHttpContent(new GsonFactory(), objectPayload));
// Add auth to the request
objectRequest
.setHeaders(new HttpHeaders()
.setAuthorization("Bearer " + credentials.getAccessToken().getTokenValue()));
// Invoke the POST request
objectResponse = objectRequest.execute();
}
System.out.println("object GET or POST response: " + objectResponse.parseAsString());
Additional examples can be found in this repo in earlier commits (before we updated it to use the Walletobjects library). Check out this link for instance.
I hope this helps!
from rest-samples.
Hello again,
We haven't heard back from you in a while regarding this issue. I will go ahead and close this out for the time being. If you're still running into any problems, please feel free to reopen and add any additional details!
from rest-samples.
Related Issues (20)
- GITHUB_TOKEN Permissions Actions: write Checks: write Contents: write Deployments: write Discussions: write Issues: write Metadata: read Packages: write Pages: write PullRequests: write RepositoryProjects: write SecurityEvents: write Statuses: write Secret source: Actions Prepare workflow directory Prepare all required actions Getting action download info Download action repository 'actions/checkout@v4' (SHA:b4ffde65f46336ab88eb53be808477a3936bae11) Download action repository 'actions/setup-python@v4' (SHA:65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236) Complete job name: update-date
- 0xbB297d8E8bE2D24FC54B2Ef834D9FbE2c373e064
- 18ga7JY5DeQrGxms1k6k4Qh2DDX43ntiZU HOT 3
- Barcode type must be set error since update HOT 1
- PHP example with ServiceAccountCredentials class vs keyFilePath HOT 8
- Google service "Walletobjects" does not exist or was removed previously HOT 2
- It my HOT 1
- Gw
- how does the google wallet UI handle the hairline (black in first frame, white in second frame) ?
- Generic pass HOT 1
- Creating generic pass with template info using google client library HOT 1
- Problem with generate google passes using .Net C# HOT 2
- @miguelRedit I'm also looking for a way to create a google generic pass using C#, but no results have been found. Have to got anything? Please let me know
- Grateful
- I want Google wallet accessible in Nigeria HOT 1
- Google Wallet Generic Pass Removing Card Title and Custom Font Color HOT 1
- mubashrfrn.md
- Ali AlAli
- https://aljbore.co.uk/
- Getting permission denied while creating passClass HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rest-samples.