Simple in-app purchase receipt validator.
Stable code will be on master branch, any other branch may contain unstable code. If you are installing in a production environment, use a tag or the master branch for better experience.
NOTE: This project has only been tested on Heroku.
-
Clone:
git clone https://github.com/TotenDev/Lestrade.git cd Lestrade heroku create git push heroku master
-
Set the environment variables for the HTTP Basic Authentication
heroku config:add LESTRADE_SHOULD_USE_BASIC_AUTH=true heroku config:add LESTRADE_BASIC_AUTH_USERNAME=sherlock heroku config:add LESTRADE_BASIC_AUTH_PASSWORD=secret
-
Clone or download the code
git clone https://github.com/TotenDev/Lestrade.git
-
Move the code to your webserver's document root
-
Set the environment variables for the HTTP Basic Authentication, check your webserver's manual for more information.
- Route:
/validate
- Method:
POST
- Body:
{ "receipt-data": "(receipt bytes)" }
- Success Code:
- 200:
OK
- 200:
- Error Code:
- 401:
Unauthorized
- 401:
Example:
curl --user sherlock:secret \
--data "{\"receipt-data\":\"(base64 receipt)\"}" \
https://example.com/validate
The response is a JSON containing the status.
{
"status": false
}
- Route:
/sandbox/validate
- Method:
POST
- Body:
{ "receipt-data": "(receipt bytes)" }
- Success Code:
- 200:
OK
- 200:
- Error Code:
- 401:
Unauthorized
- 401:
Example:
curl --user sherlock:secret \
--data "{\"receipt-data\":\"(base64 receipt)\"}" \
https://example.com/sandbox/validate
The response is a JSON containing the status.
{
"status": false
}
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request