def completed(payload, name, status, token): products = Product(context.System.apiAccessToken) logger.info('on-purchase-completed {}'.format( request)) logger.info('payload: {} {}'.format(payload.purchaseResult, payload.productId)) logger.info('name: {}'.format(name)) logger.info('token: {}'.format(token)) logger.info('status: {}'.format( status.code == 200)) product_name = products.productName(payload.productId) logger.info('Product name'.format(product_name)) if status.code == '200' and ('ACCEPTED' in payload.purchaseResult): return question('To listen it just say - play {} '.format(product_name)) else: return question('Do you want to buy another product?')
def completed(payload, name, status, token): products = Product(context.System.apiAccessToken) logger.info("on-purchase-completed {}".format(request)) logger.info("payload: {} {}".format(payload.purchaseResult, payload.productId)) logger.info("name: {}".format(name)) logger.info("token: {}".format(token)) logger.info("status: {}".format(status.code == 200)) product_name = products.productName(payload.productId) logger.info("Product name".format(product_name)) if status.code == "200" and ("ACCEPTED" in payload.purchaseResult): return question( "To listen it just say - play {} ".format(product_name)) else: return question("Do you want to buy another product?")