Example #1
0
def buy_intent(product_name):
    products = Product(context.System.apiAccessToken)
    logger.info("PRODUCT: {}".format(product_name))
    buy_card = render_template('buy_card', product=product_name)
    productId = products.productId(product_name)
    if productId is not None:
        session.attributes[PRODUCT_KEY] = productId
    else:
        return statement("I didn't find a product {}".format(product_name))
        raise NotImplementedError()
    return buy(productId).simple_card('Welcome', question_text)
Example #2
0
def refund_intent(product_name):
    refund_card = render_template('refund_card')
    logger.info("PRODUCT: {}".format(product_name))

    products = Product(context.System.apiAccessToken)
    productId = products.productId(product_name)

    if productId is not None:
        session.attributes[PRODUCT_KEY] = productId
    else:
        raise NotImplementedError()
    return refund(productId)