First, thanks for taking the time to read this. I've come across a unique situation and I'm hoping someone can help me out, or at least point me in a new direction as I've been fighting with this for a while now to no avail... Hoping I can explain this in a way that it makes sense.
I'm currently doing POST to my index.php file (from our system - not web based), and within that file, I'm using a 3rd party vendor .JS file to tokenize a specific value. At the end of page, I have a javascript function that is handling the tokenization process, and then after it's tokenized, i'm doing a javascript form submit to post the tokenized value to an API page to process the second part of the process.
I created static input fields to test the process, and everything is working as it should when I process from a web page via 'submit' button. However, when I try and test this using the POST process from our system (not web based), it doesn't follow the flow I expected with the javascript.
Additionally, I'm doing the javascript "onload" function because the goal is that as soon as the POST values have been posted to the page, and the tokenization process has completed, it will automatically submit the form.
Thanks in advance for any help - If you have questions, please let me know, as I'll be watching this thread closely.
Example Code:
<form method="POST" id="APIPOST" action="api.php">
Mode: <input name="mode" value="<?php echo $_POST['mode']; ?>">
Key: <input name="key" id="key" value="<?php echo $key; ?>">
Client Name: <input name="client_name" value="<?php echo $_POST['client_name']; ?>">
</form>
<script>
window.onload=(function(){
//Tokenization code is here
document.getElementById("APIPOST").submit();
});
</script>