PayPal checkout and PHP |
PayPal checkout and PHP |
tudsy |
Aug 4 2022, 03:48 AM
Post
#1
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
Hi
I am trying to process transactions using PayPal SDK. I also want to pass php variables to the PayPal code found on their (PayPal) website. Attached is process1.txt(php) which has the php and the paypal code for a paypal button inside. Any help will be appreciated. Thanks. Attached File(s) process1.txt ( 5.64k ) Number of downloads: 448 |
CharlesEF |
Aug 4 2022, 07:13 PM
Post
#2
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
If this is a paypal process script 'process1.txt(php)' then why all the javascript? PHP (server side scripting) can't run javascript, only the browser can (that's why it's called client side scripting). Javascript can call a PHP script but only if you use AJAX.
Do you want the form to submit when the paypal button is clicked? Or, do you want the form to stay in place when the paypal button is clicked? |
tudsy |
Aug 5 2022, 08:11 AM
Post
#3
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
Hi
Thanks for that. When the form is submitted and the PayPal button is clicked, I want the Price, Graphic and url information appearing in the PayPal environment. I might take up your suggestion to use AJAX. Thanks. If this is a paypal process script 'process1.txt(php)' then why all the javascript? PHP (server side scripting) can't run javascript, only the browser can (that's why it's called client side scripting). Javascript can call a PHP script but only if you use AJAX. Do you want the form to submit when the paypal button is clicked? Or, do you want the form to stay in place when the paypal button is clicked? |
CharlesEF |
Aug 5 2022, 02:29 PM
Post
#4
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
Hi Thanks for that. When the form is submitted and the PayPal button is clicked, I want the Price, Graphic and url information appearing in the PayPal environment. I might take up your suggestion to use AJAX. Thanks. If you want the form to submit then all you have to do is make sure that each value you want to send to the PHP script is in some HTML element that will be part of the $_POST array. Price and Graphic might already be in an HTML element. URL might need to be placed in a hidden input so it will be sent to the server in the $_POST array. You might not need the URL in the $_POST array at all, just hard code it in the PHP script. I'm not sure what information is in the URL but do you want users to 'view source' and see it? |
Lo-Fi Version | Time is now: 29th May 2024 - 01:54 AM |