Integration of post variable automatically
Dododu01
New Community Member
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Nov-22-2018
07:01 AM
<br>
Hello paypaliens friends,
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?
Thanks a lot for your help !!
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.
Related Content
- I need to integrate a recurring payment with a variable for a pay-as-you-go product in REST APIs
- How to redirect user to paypal checkout form for card payment? in PayPal Payments Standard
- Advance integration form field processing in REST APIs
- Build a integration to PayPal Settlement API for automatic bookkeeping of payouts in REST APIs
- Pay with Venmo integration is recently broken: Buyer access token not present in SDKs