https://github.com/thiagoesteves/applev
This app validates Apple receipts with the App Store. The code is written in Erlang
https://github.com/thiagoesteves/applev
apple apple-validation erlang erlang-library
Last synced: 8 months ago
JSON representation
This app validates Apple receipts with the App Store. The code is written in Erlang
- Host: GitHub
- URL: https://github.com/thiagoesteves/applev
- Owner: thiagoesteves
- License: apache-2.0
- Created: 2020-10-29T17:45:01.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-17T01:31:44.000Z (over 5 years ago)
- Last Synced: 2025-10-14T00:04:18.790Z (8 months ago)
- Topics: apple, apple-validation, erlang, erlang-library
- Language: Erlang
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](http://travis-ci.org/thiagoesteves/applev)
[](https://coveralls.io/github/thiagoesteves/applev?branch=main)
[](https://github.com/erlang/otp/releases/tag/OTP-23.0)
# This application validates apple receipts with App Store. [How to validate](https://developer.apple.com/documentation/storekit/in-app_purchase/validating_receipts_with_the_app_store)
## Getting started ##
You need to clone the repository and download rebar/rebar3 (if it's not already available in your path).
```
git clone https://github.com/thiagoesteves/applev.git
cd applev
```
To compile and run
```
make
```
### How to use the application
The application has two modes of operation: Sync and Async. If you decide to use the sync mode, when validation function is called, the function will be blocked until it finishes (or timeout). If async mode is selected, you must pass the PID (or process name) of the destination process in order to receive the result and any argument to identify the validated receipt. See the examples:
```erlang
1> applev:validate(<<"Your Receipt Here">>).
{ok,#{<<"bid">> => <<"com.es.Purchaser">>,<<"bvrs">> => <<"3">>,
...
<<"unique_vendor_identifier">> =>
<<"5C275B5A-3E66-4026-9523-845B225755FC">>}}
2> applev:validate_async(self(), <<"Your Receipt Here">>, [arg1, arg2]).
{ok,<0.247.0>}
3> flush().
Shell got {apple_receipt_return,{ok,#{<<"bid">> => <<"com.es.Purchaser">>,
...
<<"unique_vendor_identifier">> =>
<<"5C275B5A-3E66-4026-9523-845B225755FC">>},
[arg1, arg2]} }
ok
```
### How to test the application using the sandbox receipt example
In order to test the connectivity, there are test functions using sandbox receipt
```erlang
1> applev:validate().
{ok,#{<<"bid">> => <<"com.es.Purchaser">>,<<"bvrs">> => <<"3">>,
...
<<"unique_vendor_identifier">> =>
<<"5C275B5A-3E66-4026-9523-845B225755FC">>}}
2> applev:validate_async().
{ok,<0.247.0>}
3> flush().
Shell got {apple_receipt_return,{ok,#{<<"bid">> => <<"com.es.Purchaser">>,
...
<<"unique_vendor_identifier">> =>
<<"5C275B5A-3E66-4026-9523-845B225755FC">>}
none}}
ok
```
### Unit Test and coverage
The following command will invoke common test and coverage.
```
make test
```