{"action":"created","issue":{"url":"https://api.github.com/repos/recurly/recurly-client-net/issues/250","repository_url":"https://api.github.com/repos/recurly/recurly-client-net","labels_url":"https://api.github.com/repos/recurly/recurly-client-net/issues/250/labels{/name}","comments_url":"https://api.github.com/repos/recurly/recurly-client-net/issues/250/comments","events_url":"https://api.github.com/repos/recurly/recurly-client-net/issues/250/events","html_url":"https://github.com/recurly/recurly-client-net/pull/250","id":268113481,"number":250,"title":"Adds giftcard redeem endpoint","user":{"login":"bhelx","id":185919,"avatar_url":"https://avatars2.githubusercontent.com/u/185919?v=4","gravatar_id":"","url":"https://api.github.com/users/bhelx","html_url":"https://github.com/bhelx","followers_url":"https://api.github.com/users/bhelx/followers","following_url":"https://api.github.com/users/bhelx/following{/other_user}","gists_url":"https://api.github.com/users/bhelx/gists{/gist_id}","starred_url":"https://api.github.com/users/bhelx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhelx/subscriptions","organizations_url":"https://api.github.com/users/bhelx/orgs","repos_url":"https://api.github.com/users/bhelx/repos","events_url":"https://api.github.com/users/bhelx/events{/privacy}","received_events_url":"https://api.github.com/users/bhelx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-24T17:08:47Z","updated_at":"2017-10-24T17:55:44Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/recurly/recurly-client-net/pulls/250","html_url":"https://github.com/recurly/recurly-client-net/pull/250","diff_url":"https://github.com/recurly/recurly-client-net/pull/250.diff","patch_url":"https://github.com/recurly/recurly-client-net/pull/250.patch"},"body":"Addresses #249 \r\n\r\n```csharp\r\n// first we create the gift card\r\nvar delivery = new Delivery(Delivery.DeliveryMethod.Email);\r\ndelivery.GifterName = \"Benjamin\";\r\ndelivery.FirstName = \"Sally\";\r\ndelivery.LastName = \"DuMonde\";\r\ndelivery.PersonalMessage = \"Happy birthday!\";\r\ndelivery.EmailAddress = \"sally@example.com\";\r\n\r\n// the first param can be an account code for the gifter (if it exists) or an Account object for a new account\r\nvar giftCard = new GiftCard(\"benjamin-du-monde\", delivery, \"test_gift_card\", 1000, \"USD\");\r\n\r\ngiftCard.Create();\r\n\r\nConsole.WriteLine(giftCard);\r\nConsole.WriteLine(giftCard.RedemptionCode);\r\n\r\n// Now let's create sally's account\r\nvar recipientAccount = new Account(\"sally-du-monde\");\r\n\r\n// you don't need to call create here if the account already exists\r\nrecipientAccount.Create();\r\n\r\n// Now let's redeem the gift card on sally's account\r\n// this will update the giftCard object\r\ngiftCard.Redeem(recipientAccount.AccountCode);\r\n\r\nConsole.WriteLine(giftCard.RedeemedAt);\r\n```"},"comment":{"url":"https://api.github.com/repos/recurly/recurly-client-net/issues/comments/339076954","html_url":"https://github.com/recurly/recurly-client-net/pull/250#issuecomment-339076954","issue_url":"https://api.github.com/repos/recurly/recurly-client-net/issues/250","id":339076954,"user":{"login":"bhelx","id":185919,"avatar_url":"https://avatars2.githubusercontent.com/u/185919?v=4","gravatar_id":"","url":"https://api.github.com/users/bhelx","html_url":"https://github.com/bhelx","followers_url":"https://api.github.com/users/bhelx/followers","following_url":"https://api.github.com/users/bhelx/following{/other_user}","gists_url":"https://api.github.com/users/bhelx/gists{/gist_id}","starred_url":"https://api.github.com/users/bhelx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhelx/subscriptions","organizations_url":"https://api.github.com/users/bhelx/orgs","repos_url":"https://api.github.com/users/bhelx/repos","events_url":"https://api.github.com/users/bhelx/events{/privacy}","received_events_url":"https://api.github.com/users/bhelx/received_events","type":"User","site_admin":false},"created_at":"2017-10-24T17:55:44Z","updated_at":"2017-10-24T17:55:44Z","author_association":"MEMBER","body":"Okay, just pushed that change. I confirmed this code works:\r\n\r\n```csharp\r\nvar giftCard = new GiftCard(\"20IX974AEJLGUON8\");\r\ngiftCard.Redeem(\"sally-du-monde\");\r\nConsole.WriteLine(giftCard.RedeemedAt);\r\n```\r\n\r\nDoes that get you what you need?"}}
{"actor":{"display_login":"bhelx"}}