def get(self): # Request varZ from Shopify charge_id = self.request.get( 'charge_id' ) store = ShopifyStore.get_by_uuid( self.request.get('s_u') ) if ShopifyAPI.verify_charge( store.url, store.token, charge_id ): store.onetime_charge_id = charge_id store.put() self.redirect("%s?s_u=%s&thx=true" % (url('StoreSupport'), store.uuid) ) else: self.redirect( "%s?s_u=%s&onetime=true" % (url('StoreOneTimeCancelled'), store.uuid) )
def get(self): # Request varZ from Shopify charge_id = self.request.get( 'charge_id' ) store = ShopifyStore.get_by_uuid( self.request.get('s_u') ) if ShopifyAPI.verify_recurring_charge( store.url, store.token, charge_id ): if store.charge_id is None: store.do_install() store.charge_id = charge_id store.put() self.redirect("%s?s_u=%s" % (url('StoreWelcome'), store.uuid) ) else: self.redirect( "%s?s_u=%s" % (url('StoreRecurringCancelled'), store.uuid) )
def post( self ): menu = self.request.get('menu').strip() type = self.request.get('type').upper() rating = self.request.get('rating') if menu is not "": # Update the current meal to become an old meal current_meal = Meal.get_current() if current_meal: current_meal.status = 'past_meal' current_meal.rating = int( rating ) current_meal.put() # Create the new meal new_meal = Meal.create( type, menu ) # Tell people the meal is here!!! users = User.all().filter( 'notification =', True ).filter( 'email !=', '' ) for u in users: taskqueue.add( queue_name = 'notificationEmail', url = url( 'NotifyUsers' ), params = {'first_name' : u.first_name, 'email' : u.email, 'menu' : menu } )