README.md in crp-0.0.6 vs README.md in crp-0.0.7
- old
+ new
@@ -23,11 +23,11 @@
Create a new review:
```` ruby
require "crp"
=> true
-review_poster = CRP::ReviewPoster.new("crp.example.com", "client", "key")
+review_poster = CRP::ReviewPoster.new("crp.example.com", "client", "key", "username", "password")
=> #<CRP::ReviewPoster:0x007fa2c1119110 @host="crp.example.com", @client="client", @key="key">
review_response = review_poster.new_description_review("I'm looking for that special someone.", "123ABC", :male, "davy22", 55)
=> #<CRP::ReviewResponse:0x007fa87c1fd020 @response=#<Net::HTTPOK 200 OK readbody=true>>
review_response.successful?
=> true
@@ -35,12 +35,14 @@
=> "123ABC"
review_response.external_id
=> "ABCD1234"
````
-You can skip the host, client and key parameters and specify the `ENV['CRP_HOST']`, `ENV['CRP_CLIENT']` and `ENV['CRP_KEY']` environment variable for convenience.
+The `client` and `key` variables are used to authenticate against the API, the `username` and `password` variables are the credentials for the basic auth used on the CRP server.
+You can skip the host, client and key parameters and specify the `ENV['CRP_HOST']`, `ENV['CRP_CLIENT']` and `ENV['CRP_KEY']`, `ENV['CRP_USERNAME']`, `ENV['CRP_PASSWORD']` environment variable for convenience.
+
Parse the callback received from CRP:
```` ruby
require "crp"
=> true
@@ -55,9 +57,16 @@
review_callback.result_message
=> "Approved"
````
**WARNING** You are responsible for listening for the callback, the gem does not handle that in any way. Note that CRP expects to see an `ok` body when sending its callback or it will keep sending the same callback over and over again.
+
+You can inspect the errors when the review response fails (status response code is not 200):
+
+```` ruby
+review_response.raw_errors
+ => {"_rest_"=>["Invalid signature"]}
+````
## Contributing
Something missing? Found a bug? Horrified by the code? Open a [github issue](https://github.com/agilewings/crp_gem/issues), write a failing test or add some code using pull requests. Your help is greatly appreciated!