Пример #1
0
def confirm(order_obj, token, paypal_cfg):
    interface = PayPalInterface(PayPalConfig(**paypal_cfg.CONFIG))
    details = interface.get_express_checkout_details(**{
        "token": token,
    })
    dic = {
        "token": token,
        "desc": paypal_cfg.ORDER_DESCRIPTION,
        "amt": "%.2f" % (order_obj.nett_price),
        "currencycode": paypal_cfg.CURRENCY_CODE,
        "paymentaction": "sale",
        "payerid": details["PAYERID"],
    }
    confirmation = interface.do_express_checkout_payment(**dic)
    return details, confirmation["ACK"] == u'Success', confirmation