Created
August 11, 2015 17:08
-
-
Save prrraveen/eedd09a67b49df432087 to your computer and use it in GitHub Desktop.
All the order flow api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_user(request): | |
''' | |
POST method url : '/user/facebook/add' | |
@parms : { user: a dict containing user facebook details | |
} | |
@Response parms : {status : True/False , message : response text if any} | |
''' | |
user = user.create(request.POST['user']) | |
status = True | |
return Httpresponse(status) | |
def is_checkoutable(request): | |
''' | |
POST method url : 'order/check/checkoutable' | |
@parms : { user_id : 1234 , item_id : 56565 } | |
@Respons parms : { is_checkoutable : True/False , message : respose or error text} | |
I think on app side if `is_checkoutable` is True , add item to the cart and make a api to add it to order table | |
''' | |
def add_to_cart(): | |
''' | |
POST method url : 'order/cart/item/add' | |
@parms : { item_id : 56565 } | |
@Respons parms : {staus : True/False , message : respose or error text} | |
''' | |
We will write method to add it to cart and -1 from inventory | |
def add_user_details(request): | |
''' | |
POST method url : '/user/details/add' | |
@parms : { user : a dict of all the user details} | |
@response : {status : TRUE and FAlse , message : response text} | |
I think if its true than you need to take him to cart and checkout page | |
''' | |
def get_total_price(request): | |
''' | |
GET method url : 'order/cart/total' | |
@parms : { } | |
@Response : { total : 1050 } | |
''' | |
def apply_offer(request): | |
''' | |
POST method url : 'order/cart/apply_offer' | |
@parm : { offer : 'FOO' } | |
@Response : { is_aplicable : TRue /FALSe , total : , after_offer , message : error or succes message } | |
''' | |
def place_order(request): | |
''' | |
GET method url : 'order/cart/place_order' | |
@parm : {} | |
@response : { status : true/false , message : } | |
''' | |
def remove_item(request): | |
''' | |
POST method url : 'order/cart/item/remove' | |
@parm : { item_id : 4343} | |
@Respone : {status : 0/1 , message : ''} | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment