Integration of post variable automatically

Dododu01
New Community Member
 <br>

Hello paypaliens friends, Smiley Very Happy

I come to you because I have a problem which I can not find a solution.

I want to send $_POST from the previous apage to paypal's RSET pay page.

For that, at first, I create entries in php, to be able to access it in Javascript.

<?php
foreach ($_POST as $cle => $valeur) {
echo "<input type='hidden' id='" . $cle . "' name='" . $cle . "' value='" . $valeur . "'></input>";
}
?>

Then in my JAVA script, I will look for these values to integrate them into return paypal.request.post(

<script>
var infos_post = "";
for (var i = 1; i <= document.getElementsByTagName("input").length; i++){
if (document.getElementsByTagName("input").item(i-1).type == "hidden") {infos_post += document.getElementsByTagName("input").item(i-1).value;}
}
window.alert(infos_post);
[...] PAYPAL [...]
onAuthorize: function(data, actions) {
return paypal.request.post("Paypal.php",{
infos_post,
//paymentID: data.paymentID,
//payerID: data.payerID,
});
},
</script>

But obviously, it does not work, do you know how can I do it? Smiley Embarassed

Thanks a lot for your help !! Heart

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.