OFFERWALL.GG FOR VIEFAUCET
==========================

Adds the Offerwall.GG offerwall to your VieFaucet site. Users earn on the
wall, and every reward lands on their balance automatically. Reversed offers
are taken back automatically.

Takes about five minutes. Back up the two files you are about to edit.


1. CREATE A PLACEMENT
---------------------

On offerwall.gg go to Publisher -> Apps & placements -> New placement.

  Currency name     USD
  Units per USD     how much of every $1 you earn goes to the user,
                    e.g. 0.60 to give users 60% and keep 40%.

  VieFaucet balances are in USD, so the reward Offerwall.GG sends is
  credited as USD.

  Postback URL      https://YOUR-SITE/wh/offerwallgg

Keep the placement page open: you need its public key and secret key.
(If you downloaded this addon while signed in, the keys are already filled in.)


2. THE POSTBACK
---------------

Open  application/controllers/Wh.php
Copy everything from paste-into-Wh.php.txt, starting at
"public function offerwallgg()", and paste it just before the LAST "}" in
the file.

Set $secretKey to your placement's secret key (if it is not filled in).


3. THE OFFERWALL PAGE
---------------------

Open  application/controllers/Offerwall.php
Copy everything from paste-into-Offerwall.php.txt, starting at
"public function offerwallgg()", and paste it just before the LAST "}".

Set $publicKey and $secretKey (if they are not filled in).


4. THE MENU LINK
----------------

Open  application/views/user_template/template.php
Next to the other offerwalls in the sidebar, add:

  <li><a href="<?= site_url('offerwall/offerwallgg') ?>" key="t-offerwallgg">Offerwall.GG</a></li>


5. LET THE POSTBACK THROUGH CSRF
--------------------------------

Open  application/config/config.php
Find the line that starts with  $config['csrf_exclude_uris']
and add 'wh/offerwallgg' to the list, the same way the other offerwalls are
listed there.


6. TEST IT
----------

On your placement page at offerwall.gg press "Send test postback".
It should answer OK. A test credits nobody.

Then open https://YOUR-SITE/offerwall/offerwallgg while logged in. You
should see the offers.


WHAT THE ANSWERS MEAN
---------------------

  OK                          credited, reversed, or a test
  DUP                         already credited, nothing changed
  Signature doesn't match     wrong secret key in Wh.php
  Unknown user                the user id does not exist on your site
