{"id":16380946,"url":"https://github.com/vergilet/google_wallet","last_synced_at":"2025-04-22T22:46:47.915Z","repository":{"id":195518714,"uuid":"693102298","full_name":"vergilet/google_wallet","owner":"vergilet","description":"Unofficial Ruby Gem for Google Wallet API.","archived":false,"fork":false,"pushed_at":"2023-11-19T10:02:08.000Z","size":61,"stargazers_count":1,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T19:41:47.358Z","etag":null,"topics":["gem","google-wallet","google-wallet-api","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vergilet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-18T11:00:01.000Z","updated_at":"2024-10-13T18:24:30.000Z","dependencies_parsed_at":"2023-09-27T02:20:40.492Z","dependency_job_id":null,"html_url":"https://github.com/vergilet/google_wallet","commit_stats":null,"previous_names":["vergilet/google_wallet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vergilet%2Fgoogle_wallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vergilet%2Fgoogle_wallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vergilet%2Fgoogle_wallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vergilet%2Fgoogle_wallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vergilet","download_url":"https://codeload.github.com/vergilet/google_wallet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249303557,"owners_count":21247696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gem","google-wallet","google-wallet-api","ruby"],"created_at":"2024-10-11T03:52:58.068Z","updated_at":"2025-04-17T02:31:45.362Z","avatar_url":"https://github.com/vergilet.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"right\"\u003e\n    \u003ca href=\"https://github.com/vergilet/google_wallet\"\u003e\u003cimg align=\"\" src=\"https://user-images.githubusercontent.com/2478436/51829223-cb05d600-22f5-11e9-9245-bc6e82dcf028.png\" width=\"56\" height=\"56\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://rubygems.org/gems/google_wallet\"\u003e\u003cimg align=\"right\" src=\"https://user-images.githubusercontent.com/2478436/51829691-c55cc000-22f6-11e9-99a5-42f88a8f2a55.png\" width=\"56\" height=\"56\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://rubygems.org/gems/repost\"\u003e\n  \u003cimg width=\"460\" src=\"https://github.com/vergilet/google_wallet/assets/2478436/5f9c5925-129a-401e-bd46-82e6ae2b2430\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n\n# GoogleWallet\nUnofficial Ruby Gem for [Google Wallet API](https://developers.google.com/wallet).\n\n## Prerequisites\nBefore you use the Google Wallet API for an integration, complete first four steps from [this guide](https://developers.google.com/wallet/tickets/events/web/prerequisites).\n\n\n\n*The 1st step will provide you with **IssuerID**=33880000000XXXXXXXX and* \n\n*on the 3rd step you are going to obtain **key.json**, those are needed for the gem initialization.*\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'google_wallet'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install google_wallet\n\n## Usage\n\nCreate initializer:\n```ruby\n# config/initializers/google_wallet.rb\n\nGoogleWallet.configure do |config|\n  config.load_credentials_from_file('./key.json')\n  config.issuer_id = '33880000000XXXXXXXX'\n  config.debug_mode = true\n  config.logger = Logger.new(STDOUT)\nend\n```\n\n### EventTicket\n\n#### Create class (event representation):\n```ruby\nevent_attributes = {\n  # required fields\n  class_identifier: 'Event-123456', \n  event_name: 'Solo Singing Contest #1 Yay!', \n  issuer_name: 'iChar System',\n  \n  # other fields\n  event_id: '123456',\n  logo_url: 'https://images.unsplash.com/photo-1475721027785-f74eccf877e2?auto=format\u0026fit=crop\u0026w=360\u0026h=360',\n  hero_image_url: 'https://images.unsplash.com/photo-1501281668745-f7f57925c3b4?auto=format\u0026fit=crop\u0026w=1032\u0026h=336',\n  homepage_url: 'https://example.com',\n  country_code: 'no',\n  venue_name: 'Opera Theater',\n  venue_address: \"Shevchenka street 41/5, Ukraine, Kyiv\",\n  start_date_time: '2023-09-27T22:30',\n  end_date_time: '2023-09-28T01:30',\n  hex_background_color: '#ff0077',\n  callback_url: 'https://example.com/gpass_callback'\n}\n\n\n# Create Resource of EventTicket Class\nevent = GoogleWallet::Resources::EventTicket::Class.new(attributes: event_attributes)\n\n# Push Class to Google Wallet API\nevent.push\n```\n\n#### Create object (ticket representation):\n```ruby\nticket_attributes = {\n  # required fields\n  object_identifier: 'fd9b637f-0381-42ad-9161-b4d887d79d9f',\n  class_identifier: 'Event-123456',\n\n  # other fields\n  grouping_id: 'order-12345',\n  ticket_type: 'VIP Adult Plus',\n  section: 'The Sponsor Felt-F Overpower',\n  seat: '65',\n  row: '17',\n  gate: 'G3, G4',\n  ticket_holder_name: 'Yaro Developer',\n  qr_code_value: '12345678',\n  ticket_number: 'cdeqw',\n  valid_time_start: '2023-09-27T22:30',\n  valid_time_end: '2023-09-28T02:00',\n  micros: 82_000_000,\n  currency_code: 'NOK',\n  hex_background_color: '#0090ff'\n}\n\n# Create Resource of EventTicket Object\nticket = GoogleWallet::Resources::EventTicket::Object.new(attributes: ticket_attributes)\n\n# Push Object to Google Wallet API\n\n# Option 1 (Recommended):\n# Separated push and sign\nticket.push\njwt = ticket.sign(push_resource: false)\n\n# Option 2:\n# Combined - just use sign\njwt = ticket.sign # default is push_resource: true\n\n# visit output link via authenticated browser\n# or send it to you android device with Wallet app.\n\"https://pay.google.com/gp/v/save/#{jwt}\"\n\n```\n\n#### Separation of Ticket Push and JWT Signing\nThe gem offers a distinct advantage when pushing tickets separately from the signing phase. If tickets are pushed individually, the subsequent signing method utilizes only the ticket identifiers during the JWT signing process, rather than the entire ticket objects.\n\n*Advantages of Using Ticket Identifiers:*\n\n*By employing ticket identifiers in the signing process instead of the full ticket objects, it significantly reduces the length of the final link generated. This streamlined approach allows for a more efficient and concise link that can be easily sent to the user.*\n\n\n### Result\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/vergilet/google_wallet/assets/2478436/394dc017-c6f8-43d1-ad7b-f2139d643aec\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/vergilet/google_wallet.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvergilet%2Fgoogle_wallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvergilet%2Fgoogle_wallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvergilet%2Fgoogle_wallet/lists"}