I am having some issue posting data to a specific URL when testing payment transactions on the paypal platform. Although much more technically understood, I chose not to use their API and NVP platform because of the requirement to FIRST create a transaction, then come back and have to create a recurring profile (as opposed to all at once - stupid design in my opinion).
Ultimately, I am trying to take data I have encrypted into a specific variable and post that data to a URL of choice WITHOUT having to treat it as a form where user clicks submit.
My HTML form works - the code is:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_blank">';
<input type="hidden" name="cmd" value="_s-xclick"/>';
<input type="hidden" name="encrypted" value="'.$encrypted.'"/>';
<input type="submit" value="Go to checkout" name="submit" class="cartButton" />';
</form>
where $encrypted are my encrypted parameters. While the code works - I do not want to have the user click a link to be sent to the form. Instead, I want the user to click a button which first runs a PHP script to store the data in a temporary database THEN push the required elements (CMD and ENCRYPTED) to the post URL (https://www.sandbox.paypal.com/cgi-bin/webscr).
Any ideas how to accomplish this? Is it possible? I use PHP and mySQL for my site. Using Javascript of any kind is not a solution.
EDIT 1
I have it set up to use cURL as a possible way to POST the data but two things are happening: 1) I am getting no response whatsoever, 2) the consumer actually needs to be redirected to the paypal payment pages with the posted data after the database insert has taken place.