YetiPoll for ClaimBits / CryptoFaucet
=====================================

Paid surveys on your faucet. Your users earn credits, you earn with every
completed survey.

What you need: a YetiPoll account with an app (https://yetipoll.com) and
access to the files of your site.


1. Upload two files
-------------------
Copy the folder "system" from this download over the "system" folder of
your site. It adds two files and changes none:

    system/gateways/yetipoll.php
    system/gateways/yetipoll-postback.php


2. Your keys
------------
Open system/gateways/yetipoll.php. If you downloaded this while signed in
and chose your app, the keys are already in it and in the paste files. If
you see YP_LIVE_SECRET_KEY and the like, replace them with the keys from
the page of your app in the YetiPoll dashboard.


3. Show the surveys
-------------------
paste/offers.php.txt  the case for the switch in
                      template/default/pages/offers.php
paste/button.txt      the button on that page, and a menu link


4. Tell YetiPoll where to send rewards
--------------------------------------
In the YetiPoll dashboard, open your app and set the postback URL to

    https://YOUR-SITE/system/gateways/yetipoll.php

and nothing else. All values are added for you.


5. Set your currency
--------------------
Set the reward currency of the app in the YetiPoll dashboard to your
credits: one unit is one credit on your site.


6. Check it
-----------
Press "Send a test completion" on the page of your app in the YetiPoll
dashboard. The postback log should show it as delivered, with status
code 200. (403 means a wrong secret key, 503 that the keys are missing.)

To watch a reward arrive on a balance: set $yetipollMode to 'test' in
system/gateways/yetipoll.php, use the two sandbox keys in the case you
pasted into offers.php, open the surveys as a user and finish a practice
survey. Put both back before real users see it: in 'test' mode practice
rewards are added to balances.


How rewards are handled
-----------------------
- Every message is checked to really come from YetiPoll.
- A reward is added once, however often it is sent.
- A reward that is taken back after a quality check is deducted once, and
  never below zero. It is stored next to the reward in completed_offers,
  under the same id with "-R".
