Giter Club home page Giter Club logo

applev's Introduction

Build Status Coverage Status Erlant/OTP Release

This application validates apple receipts with App Store. How to validate

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:

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

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

applev's People

Contributors

thiagoesteves avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.