{"id":19780462,"url":"https://github.com/cbetta/gyft","last_synced_at":"2025-04-30T21:33:23.896Z","repository":{"id":48774314,"uuid":"63798307","full_name":"cbetta/gyft","owner":"cbetta","description":"🎁 An SDK for the Gyft Developer API in Ruby","archived":false,"fork":false,"pushed_at":"2023-04-17T08:53:02.000Z","size":23,"stargazers_count":0,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-24T13:45:14.244Z","etag":null,"topics":["gyft-api","library","sdk"],"latest_commit_sha":null,"homepage":"http://developer.gyft.com/","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/cbetta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-20T16:48:54.000Z","updated_at":"2019-07-18T18:19:11.000Z","dependencies_parsed_at":"2022-08-26T23:10:12.203Z","dependency_job_id":null,"html_url":"https://github.com/cbetta/gyft","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbetta%2Fgyft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbetta%2Fgyft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbetta%2Fgyft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbetta%2Fgyft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbetta","download_url":"https://codeload.github.com/cbetta/gyft/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224225349,"owners_count":17276435,"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":["gyft-api","library","sdk"],"created_at":"2024-11-12T05:39:53.483Z","updated_at":"2024-11-12T05:39:53.933Z","avatar_url":"https://github.com/cbetta.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby API library for the Gyft API\n\n[![Gem Version](https://badge.fury.io/rb/gyft.svg)](https://badge.fury.io/rb/gyft) [![Build Status](https://travis-ci.org/cbetta/gyft.svg?branch=master)](https://travis-ci.org/cbetta/gyft)\n\nA wrapper for the [Gyft API](http://developer.gyft.com). Specification is as described in the the [developer documentation](http://developer.gyft.com/io-docs).\n\n## Installation\n\nEither install directly or via bundler.\n\n```rb\ngem 'gyft'\n```\n\n## Getting started\n\nThe client will accept the API key and secret either as parameters on initialization,\nor as environment variables. Additionally an `environment` parameter can be set to either\n`sandbox` (default) or `production`.\n\n```rb\nrequire 'gyft'\n\n# using parameters\nclient = Gyft::Client.new(api_key: '...', api_secret: '...', environment: 'production')\n\n# using environment variables:\n# * GYFT_API_KEY\n# * GYFT_API_SECRET\n# * GYFT_API_ENVIRONMENT\nclient = Gyft::Client.new\n```\n\nThe client provides with direct access to every API call as documented in the\ndeveloper documentation. Additionally it also provides some convenience methods.\n\n```rb\n# get a card to purchase\ncard = client.cards.first\n# purchase the card for someone\ntransaction = card.purchase(to_email: 'customer@example.com')\n# load more details on the transaction\ntransaction = transaction.reload\n# refund the transaction\ntransaction.refund\n```\n\n## Convenience methods\n\n### `client.cards`\n\nMaps to `client.reseller.shop_cards`, allows for easier access and a less\nverbose DSL.\n\n### `card.purchase`\n\nMaps to `client.partner.purchase.gift_card_direct` and passes along all the\nsame parameters while automatically setting the `shop_card_id`.\n\n### `transaction.reload`\n\nThe purchase method returns an incomplete transaction object. This convenience\nmethods calls `client.reseller.transaction.find` passing along the transaction\n`id` and returning a new `Gyft::Transaction` object.\n\n### `transaction.refund`\n\nMaps to `client.reseller.transactions.refund` and automatically passes along\nthe transaction `id`.\n\n## API\n\n### `GET /health/check`\n\n```rb\n# with a connection\n\u003e client.health.check\ntrue\n\n# without a connection\n\u003e client.health.check\nfalse\n```\n\n### `GET /reseller/shop_cards`\n\nReturns the shop cards available for purchase.\n\n```rb\n\u003e cards = client.reseller.shop_cards\n[#\u003cGyft::Card id=123, merchant_id=\"123\", ...\u003e, ...]\n\u003e cards.first\nGyft::Card {\n                            :id =\u003e 3028,\n                   :merchant_id =\u003e \"211-1346844972352-24\",\n                 :merchant_name =\u003e \"Foot Locker\",\n              :long_description =\u003e \"\u003cp\u003eFoot Locker is ...\u003c/p\u003e\",\n            :card_currency_code =\u003e \"USD\",\n               :opening_balance =\u003e 50.0,\n     :merchant_card_template_id =\u003e 3750,\n            :cover_image_url_hd =\u003e \"http://imagestest.gyft.com/merchants_cards/c-211-1346844972355-64_cover_hd.png\",\n    :merchant_icon_image_url_hd =\u003e \"http://imagestest.gyft.com/merchants/i-211-1346844972353-0_hd.png\"\n}\n```\n\n### `GET /reseller/categories`\n\nReturns all of the categories.\n\n```rb\n\u003e categories = client.reseller.categories\n[#\u003cGyft::Category id=4, name=\"Babies \u0026 Children\"\u003e, ... ]\n\u003e categories.first\nGyft::Category {\n      :id =\u003e 4,\n    :name =\u003e \"Babies \u0026 Children\"\n}\n```\n\n### `GET /reseller/merchants`\n\nReturns all of the merchants.\n\n```rb\n\u003e merchants = client.reseller.merchants\n[#\u003cGyft::Merchant id=\"123\", name=\"foobar.com\", ...\u003e, ... ]\n\u003e merchants.first\nGyft::Merchant {\n                       :id =\u003e \"1406228802381_103\",\n                     :name =\u003e \"1-800-Baskets.com\",\n              :description =\u003e \"Gift baskets for every occasion. \",\n         :long_description =\u003e \"\u003cp\u003e1-800-Baskets has ...\u003c/p\u003e\",\n             :country_code =\u003e \"US\",\n           :homepage_label =\u003e \"Go to 1800baskets.com\",\n             :homepage_url =\u003e \"http://www.1800baskets.com\",\n              :facebook_id =\u003e \"229053644398\",\n               :twitter_id =\u003e \"1800baskets\",\n                :google_id =\u003e \"+1800baskets\",\n               :shop_cards =\u003e [#\n        [0] Gyft::Card {\n                         :id =\u003e 4456,\n              :currency_code =\u003e \"USD\",\n                      :price =\u003e 25.0,\n            :opening_balance =\u003e 25.0\n        },\n        [1] Gyft::Card {\n                         :id =\u003e 4461,\n              :currency_code =\u003e \"USD\",\n                      :price =\u003e 50.0,\n            :opening_balance =\u003e 50.0\n        }\n    ],\n               :categories =\u003e [\n        [0] Gyft::Category {\n              :id =\u003e 12,\n            :name =\u003e \"Home Goods\"\n        }\n    ],\n               :meta_title =\u003e \"Buy 1-800-Baskets.com Gift Cards | Gyft\",\n         :meta_description =\u003e \"1-800-Baskets.com\",\n           :min_card_value =\u003e 25.0,\n           :max_card_value =\u003e 50.0,\n       :cover_image_url_hd =\u003e \"http://imagestest.gyft.com/merchants_cards/default-08_cover_hd.png\",\n          :google_plus_url =\u003e \"https://plus.google.com/+1800baskets\",\n              :twitter_url =\u003e \"https://twitter.com/1800baskets\",\n                :card_name =\u003e \"1-800-Baskets.com\",\n                 :icon_url =\u003e \"http://imagestest.gyft.com/merchants/1-800-baskets_hd.png\",\n    :legal_disclaimer_html =\u003e \"...\",\n             :facebook_url =\u003e \"http://www.facebook.com/229053644398\"\n}\n```\n\n### `GET /reseller/account`\n\nReturns details of the reseller's account.\n\n```rb\n\u003e account = client.reseller.account\nGyft::Account {\n                      :id =\u003e \"abc123\",\n       :global_shop_cards =\u003e true,\n\n                :username =\u003e \"foobar\",\n                    :name =\u003e \"FooBar\",\n        :application_name =\u003e \"FooBar\",\n            :contact_name =\u003e \"FooBar Developer\",\n           :contact_email =\u003e \"foo@example.com\",\n                 :balance =\u003e 50000.0,\n    :balance_updated_when =\u003e 1469051680000\n}\n```\n\n### `GET /reseller/transactions`\n\nReturns a list of all the transactions for the reseller.\n\n```rb\n\u003e transactions = client.reseller.transactions.all\n[#\u003cGyft::Transaction id=123, type=1, amount=25.0, created_when=1469034701000\u003e, ...]\n\u003e transactions.first\nGyft::Transaction {\n              :id =\u003e 123,\n            :type =\u003e 1,\n          :amount =\u003e 25.0,\n    :created_when =\u003e 1469034701000\n}\n```\n\n### `GET /transactions/last/:number_of_records`\n\nReturns a limited list of recent transactions for the reseller.\n\n```rb\n\u003e transactions = client.reseller.transactions.last(1)\n[#\u003cGyft::Transaction id=123, type=1, amount=25.0, created_when=1469034701000\u003e]\n\u003e transactions.first\nGyft::Transaction {\n              :id =\u003e 123,\n            :type =\u003e 1,\n          :amount =\u003e 25.0,\n    :created_when =\u003e 1469034701000\n}\n```\n\n### `GET /transactions/first/:number_of_records`\n\nReturns a limited list of initial transactions for the reseller.\n\n```rb\n\u003e transactions = client.reseller.transactions.first(1)\n[#\u003cGyft::Transaction id=122, type=1, amount=25.0, created_when=1469034701000\u003e]\n\u003e transactions.first\nGyft::Transaction {\n              :id =\u003e 122,\n            :type =\u003e 1,\n          :amount =\u003e -25.0,\n    :created_when =\u003e 1469034701000\n}\n```\n\n### `GET /transaction/:id`\n\nReturns a full details for a sent transaction\n\n```rb\n\u003e client.transactions.find(123)\nGyft::Transaction {\n                     :id =\u003e 123,\n          :merchant_name =\u003e \"Grotto\",\n\n                 :amount =\u003e 25.0,\n                :sent_to =\u003e \"customer@example.com\",\n         :auto_delivered =\u003e \"N\",\n               :revealed =\u003e \"N\",\n            :gift_status =\u003e 6,\n            :card_status =\u003e 0,\n    :transaction_created =\u003e 1469034701000,\n           :gift_created =\u003e 1469034701000\n}\n```\n\n### `POST /transaction/refund`\n\nRefund transaction and get card details.\n\n```rb\n\u003e client.transactions.refund(123)\nGyft::Refund {\n                            :id =\u003e \"OTlkOGM1...k5W\",\n                        :status =\u003e 0,\n\n                :gf_reseller_id =\u003e \"abc123\",\n    :gf_reseller_transaction_id =\u003e 123333,\n                         :email =\u003e \"client@example.com\",\n                   :gf_order_id =\u003e 123456,\n            :gf_order_detail_id =\u003e 345678,\n             :gf_gyfted_card_id =\u003e 678997,\n                   :invalidated =\u003e false\n}\n```\n\n### `POST /partner/purchase/gift_card_direct`\n\nPurchase a gift card returning a direct link to the card.\n\n```rb\n\u003e client.partner.purchase.gift_card_direct(\n      to_email: 'customer@example.com',\n      shop_card_id: 1234\n  )\n\nGyft::Transaction {\n     :id =\u003e 1250483,\n    :url =\u003e \"https://staging.gyft.com/card/#/?c=....\"\n}\n```\n\n## Contributing\n\n 1. **Fork** the repo on GitHub\n 2. **Clone** the project to your own machine\n 3. **Commit** changes to your own branch\n 4. **Push** your work back up to your fork\n 5. Submit a **Pull request** so that we can review your changes\n\n### Development\n\n* `bundle install` to get dependencies\n* `rake` to run tests\n* `rake console` to run a local console with the library loaded\n\n## License\n\nThis library is released under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbetta%2Fgyft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbetta%2Fgyft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbetta%2Fgyft/lists"}