Receive Notifications in Market Payment with Flask

0

The documentation indicates that we can receive a post of market payment in Python this function:

def index(req, **kwargs):
    mp = mercadopago.MP(CLIENT_ID, ACCESS_TOKEN)
    paymentInfo = mp.get_payment_info(kwargs["id"])
    if paymentInfo["status"] == 200:
        return paymentInfo["response"]
    else:
        return None

How should I use marketpay methods in Flask?

@app.route("/", methods=['GET', 'POST'])
def index(req, **kwargs):
 mp = mercadopago.MP(CLIENT_ID, ACCESS_TOKEN)
        paymentInfo = mp.get_payment_info(kwargs["id"])
        if paymentInfo["status"] == 200:
            return paymentInfo["response"]
        else:
            return None
    
asked by Rimo 29.01.2018 в 12:18
source

0 answers