Giter Club home page Giter Club logo

watchslotsserver's Introduction

#Server for watch slots

##Balance Gets the balance and indicates if a return bonus is available but does not award it.

http://watchslots.herokuapp.com/balance/<identifierForVendor>

returns

{
   success:true,
   balance:<value>,
   bonusWaiting:<true|false>
   nextBonus:<date>,
}

nextBonus is only there when bonusWaiting is false.

##balanceWithRBAward Gets the balance and awards return bonus if it is time.

http://watchslots.herokuapp.com/balanceWithRBAward/<identifierForVendor>

returns

{
   success:true,
   balance:<value>,
   nextBonus:<date>,
   returnBonus : {
    wheelPosition: <value:1-8>,
    winnings: <value>
    afterBonusBalance: <value>
   }
}

the return bonus section is optional and only occurs if the bonus was awarded.

##Spin Spins and returns reel positions and new balance.

http://watchslots.herokuapp.com/spin/<identifierForVendor>/<betAmount>

returns

{
   success:true,
   newBalance:<value>,
   reels:[<reel1>,<reel2>,<reel3>],
   winnings:<amount>,
   nextBonus:<date>,
   returnBonus : {
    wheelPosition: <value:1-8>,
    winnings: <value>
    afterBonusBalance: <value>
   }
}

the return bonus section is optional and only occurs if the bonus was awarded.

Here is the mapping from symbols numbers to icons

##Purchase Increases users token balance due to a purchase. Will eventually verify receipt with apple.

curl -X POST \
       -H "Content-Type: application/json" \
       -d '{"transactionId":"foo", receipt:"<base64encodedString>","productId":"<productId>"}' \
       http://watchslots.herokuapp.com/purchase/<identifierForVendor>

curl -X POST \
      -H "Content-Type: application/json" \
      -d '{"transactionId":"foo", "receipt":"base64encodedString","productId":"WatchSlotsTokenPurchase99"}' \
      http://10.0.1.100:3000/purchase/foo

returns:

{
   success:true,
   newBalance:<value>
}

Admin functions

TODO: some way to restrict these.

###resetReturnBonus Sets the users last return bonus to 1 day ago. So next spin will trigger a return bonus.

http://watchslots.herokuapp.com/admin/resetReturnBonus/<identifierForVendor>

###setOutcome Sets the users outcome on the slot machine until it is cleared.

http://watchslots.herokuapp.com/admin/setOutcome/<identifierForVendor>/<outcome>

outcome - should be 1-8 or clear to return to random behavior

###setBalance Sets the users balance

http://watchslots.herokuapp.com/admin/setBalance/<identifierForVendor>/<balance>

##Todo

  • add daily return bonus: for get balance
  • add support for facebook integration

watchslotsserver's People

Contributors

jhullfly avatar

Stargazers

Ash Downing avatar

Watchers

Rusty Sammon avatar James Cloos avatar  avatar  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.