GitHub PullRequestReviewCommentEvent at 2014-02-24 19:49:04
Repository: developer.offerengine.com
Actor: jgehrett
Payload: {"comment":{"url":"https://api.github.com/repos/demandchain/developer.offerengine.com/pulls/comments/10006566","id":10006566,"diff_hunk":"@@ -0,0 +1,98 @@\n+module OfferEngine\n+  def self.new_reseller_card_linked_purchase\n+    {\n+        :deal_id               => \"deal1234\",\n+        :transaction_amount    => \"3599\",\n+        :transaction_date      => \"2014-06-06T20:30:05Z\",\n+        :transaction_reference => \"trans1234\",\n+        :first_name            => \"Hank\",\n+        :last_name             => \"Rearden\"\n+    }\n+  end\n+\n+  def self.new_reseller_daily_deal_purchase\n+    {\n+        :deal_id               => \"deal1234\",\n+        :quantity              => \"2\",\n+        :transaction_date      => \"2014-06-06T20:30:05Z\",\n+        :transaction_reference => \"trans1234\",\n+        :first_name            => \"Hank\",\n+        :last_name             => \"Rearden\"\n+    }\n+  end\n+\n+  def self.new_reseller_daily_deal_shipped_purchase\n+    {\n+        :deal_id               => \"deal1234\",\n+        :quantity              => \"2\",\n+        :transaction_date      => \"2014-06-06T20:30:05Z\",\n+        :transaction_reference => \"trans1234\",\n+        :first_name            => \"Hank\",\n+        :last_name             => \"Rearden\",\n+        :address_name          => \"Home\",\n+        :address1              => \"123 Any St.\",\n+        :address2              => \"Suite 100\",\n+        :postal_code           => \"12345\",\n+        :city                  => \"Any Town\",\n+        :state                 => \"CA\",\n+        :country               => \"US\"\n+    }\n+  end\n+\n+  $reseller_purchase_id = \"af063ec2\"\n+\n+  def self.reseller_purchase\n+    {\n+        id:                    $reseller_purchase_id,\n+        transaction_reference: \"client_ref_id\",\n+        amount:                OfferEngine.deal[:current_price] * OfferEngine.deal[:number_sold],\n+        number_bought:         OfferEngine.deal[:number_sold],\n+        fulfillment_state:     \"fulfilled\",\n+        created_at:            \"Fri Dec 16 19:11:15 UTC 2011\",\n+        deal:                  {\n+            id:            OfferEngine.deal[:id],\n+            title:         OfferEngine.deal[:title],\n+            image_url_abs: OfferEngine.deal[:primary_image][:large][:url]\n+        },\n+        :coupons               => [OfferEngine.reseller_coupon]\n+    }\n+  end\n+\n+  def self.reseller_purchase_error_all\n+    {\n+        :status     => \"error\",\n+        :error_type => \"validation_failed\",\n+        :error_msg  => \"validation failed\",\n+        :errors     => [\n+            {\n+                :type     => \"invalid\",\n+                :message  => \"cannot purchase that many\",\n+                :field    => \"quantity\",\n+                :resource => \"purchase\"\n+            },\n+            {\n+                :type     => \"not_found\",\n+                :message  => \"does not exist\",\n+                :resource => \"shipping_address\"\n+            }\n+        ],\n+    }\n+  end\n+\n+  def self.reseller_purchase_error\n+    {\n+        :status         => \"error\",\n+        :error_type     => \"validation_failed\",\n+        :error_msg      => \"validation failed\",\n+        :user_id        => OfferEngine::USER[:id],\n+        :errors         => [\n+            {\n+                :type     => \"invalid\",\n+                :message  => \"cannot purchase that many\",","path":"lib/resources/reseller_purchase.rb","position":91,"original_position":91,"commit_id":"6f49f2437aeb5072152328cb66eebca12b847c10","original_commit_id":"6f49f2437aeb5072152328cb66eebca12b847c10","user":{"login":"jgehrett","id":38362,"avatar_url":"https://gravatar.com/avatar/d4c0cc99016d7a92adcda6822fe4ae04?d=https%3A%2F%2Fidenticons.github.com%2Fed16bc5bad6025e0777eeedb1e0cd6bc.png&r=x","gravatar_id":"d4c0cc99016d7a92adcda6822fe4ae04","url":"https://api.github.com/users/jgehrett","html_url":"https://github.com/jgehrett","followers_url":"https://api.github.com/users/jgehrett/followers","following_url":"https://api.github.com/users/jgehrett/following{/other_user}","gists_url":"https://api.github.com/users/jgehrett/gists{/gist_id}","starred_url":"https://api.github.com/users/jgehrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgehrett/subscriptions","organizations_url":"https://api.github.com/users/jgehrett/orgs","repos_url":"https://api.github.com/users/jgehrett/repos","events_url":"https://api.github.com/users/jgehrett/events{/privacy}","received_events_url":"https://api.github.com/users/jgehrett/received_events","type":"User","site_admin":false},"body":"@csherrard & @hunpin  As I reviewed the sample error response I had a question.  Should we fail if the purchase limit was exceeded?  I assume not as this is a recording of a transaction that has already happened.","created_at":"2014-02-24T19:49:04Z","updated_at":"2014-02-24T19:49:04Z","html_url":"https://github.com/demandchain/developer.offerengine.com/pull/33#discussion_r10006566","pull_request_url":"https://api.github.com/repos/demandchain/developer.offerengine.com/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/demandchain/developer.offerengine.com/pulls/comments/10006566"},"html":{"href":"https://github.com/demandchain/developer.offerengine.com/pull/33#discussion_r10006566"},"pull_request":{"href":"https://api.github.com/repos/demandchain/developer.offerengine.com/pulls/33"}}}}