Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.5k views
in Technique[技术] by (71.8m points)

python - Invalid requests

I am currently learning the requests module, I'm trying mimic manually buying an item from a shop.

This is the item https://www.footlocker.co.uk/en/p/nike-air-max-zephyr-men-shoes-104428?v=314206287204

I am able to add the item to cart and fill out the order details, but I cant get to the pay page,

Normally the website redirects you to the pay page from the billing page when your doing it manually, but the requests version doesn't, so I tried copying all requests but It still wouldn't work.

The payment goes through the companyaden, and whenever I print the content of the requests I see that the error is

</script>
    <h2 id="stageheader">
     Invalid Request
    </h2>
    <p>
     Unfortunately we were unable to process this request
    </p>
    <!-- error summary: sessionValidity is in the past -->

So there must be something im doing wrong, I would post my code but I would need to post all of it for people to be able to run it, which may look at bit long

But the error should be to do with this line

aden_req = session.post('https://live.adyen.com/hpp/pay.shtml',headers=aden_headers, data=aden_data)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...