Overveiw
I am writing a script in Python, the goal of the script is to automate the checkout process on a website using requests.
I am 99% done, the final step is submitting payment, to do so I need parameters created by the below JS in the HTML after the page loads.
JavaScript
The JS I can see run in Chrome 'Sources' section is as follows:
https://songbird.cardinalcommerce.com/edge/v1/songbird.js https://secure.louisvuitton.com/static/20.15.1-RC/min/scripts/cardinalCybs.js https://songbird.cardinalcommerce.com/edge/v1/60b72a99f75c34959d37/1.60b72a99f75c34959d37.songbird.js https://songbird.cardinalcommerce.com/edge/v1/60b72a99f75c34959d37/12.60b72a99f75c34959d37.songbird.js https://songbird.cardinalcommerce.com/edge/v1/60b72a99f75c34959d37/11.60b72a99f75c34959d37.songbird.js https://songbird.cardinalcommerce.com/edge/v1/60b72a99f75c34959d37/5.60b72a99f75c34959d37.songbird.js
HTML
<!-- START - The following JSP handles the Cardinal Javascripts , inclusion , initialization and all the other cardinal Specific mechanism -->
<!-- The Below JSP is invoked in case of a Credit Card Payment . Its an integration point with the Cardinal Commerce -->
<script src="https://songbird.cardinalcommerce.com/edge/v1/songbird.js"></script>
<script type="text/javascript" src="https://secure.louisvuitton.com/static/20.15.1-RC/min/scripts/cardinalCybs.js"></script>
<input type="hidden" id="JWTContainer" value=""/>
<input type="hidden" id="cardinalJSLogging" value="off"/>
<!-- END - The following JSP handles the Cardinal Javascripts , inclusion , initialization and all the other cardinal Specific mechanism -->
I can see the requests that this JS creates, these requests then interact with the payment gateway to retrieve the parameters needed to send the complete checkout request.
As JWT tokens are used and I do not possess the secret key, it is impossible for me to replicate the requests without the JS running.
My Question: How can I have the JavaScript files run, send their normal requests and feedback the result parameters to be able to complete the checkout?
My thinking is to use similar method advice from this answer https://stackoverflow.com/a/50612469/8840275 and use Docker + Splash.
I do not want to use Selenium.