Jump to content

Recommended Posts

Hi,

I'm trying to create a payment process which uses paypal. Accessing the paypal page and sending correct data to it is easy enough, but is there a way that I can send the data to paypal and do the transaction without displaying the paypal page?

Perhaps the user enters their credit card details or their paypal username and password etc and it sends it through to paypal and carry out the transaction without the customer seeing the paypal page?

 

This isn't so that the user doesn't realise that paypal is being used as I will make it clear that paypal is the payment provider, but because I need some flexibility of what I can do for the payment process by sending multiple payments, one after the other to different accounts. I don't want the customer to have to enter their details and click submit four or five times for each transaction. Instead I just want my script to do it for them.

 

I hope that made some sense..

thanks

ah yes.. I've found it now:

CURLOPT_POST

 

would something like this work?

<?php
// create a new cURL resource
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "https://secure.paypal.com/cgi-bin/webscr");
curl_setopt($ch, CURLOPT_POST, $myvariable1);
curl_setopt($ch, CURLOPT_POST, $myvariable2);
curl_setopt($ch, CURLOPT_POST, $myvariable3);

// grab URL and pass it to the browser
curl_exec($ch);

// close cURL resource, and free up system resources
curl_close($ch);
?> 

Hi there mate I worked along side a php programmer that was the one that (he recons) implemented the paypal system for the paypal service for the php code and I got right into it had a bull.

 

we both done statistics if users would use a website on it own using the paypal form on the service providers server or was it best to let users go to paypal and use the default form that paypal provided.

 

we set up a selling website to sell books that xxxxsxx provided and then studed the sales from a service using the form on the site and a payment was sent directly to paypal without any forms or images from paypal.

 

We also used another website with the same books and used the paypal default page.

 

This was only a test run and the site was advertised on xxxx main page.

 

the sales for the website using paypal with no default page was 3 in 10 sales

 

the sales for the website using paypal default page was 9 in 10

 

we also done a survey on the sites and most users using the website that had

no default paypal page thort the site was a scam.

 

Very interesting stuff.

 

Look up ipn php paypal ok.

 

thanks for that advice redarrow. I just think that forcing the customer to input there details four or five times would put them off a bit. I also need the prices to charge them to be different each time, which I don't think I can do using the default page, without them entering there details, going through the payment process, clicking submit, then doing all over again.

 

Chigley.. wouldn't I only do it all at once if I'm using $_GET? and even then I think from looking at it that get variables should simply be added to the end of the url in CURLOPT_URL.

Hi,

been a while since I've said anything about this because I've been waiting for my sandbox account to activate.. paypal were having problems with it.

 

I've set up a form which sends the bussiness name for the correct merchant so it knows who to pay the money to and also the amount and shipping cost. It includes the currency, payment cancelation page and completion page etc.

 

What I'm wanting to do is have a foreach statement to send the data to paypal.

So my customer enters their username and password into the form and then it sends them to paypal. I've written the foreach statement and believe I've the the curl part right. The problem I've got is using curl it tries to open the paypal page.

What I'm wanting is for the script to access paypal, behind the scenes as it were, and carrying through the process and foreach process it completes it echoes to the customer:

payment for MERCHANT NAME complete.
charge: AMOUNT

 

Here's my code:

				echo 'Your payment is being processed';
				foreach($_SESSION['manufacturer'] as $key => $value){
					// create a new cURL resource
					$ch = curl_init();

					// set URL and other appropriate options
					curl_setopt($ch, CURLOPT_URL, "https://www.sandbox.paypal.com/cgi-bin/webscr");
					curl_setopt($ch, CURLOPT_POST, 'cmd=_xclick&business=' . $_SESSION['paypalid_user'][$key] . '&item_name=' . STORE_NAME . ' (' . $value . ')&amount=' . $_SESSION['price'][$key] . '&shipping=' . $_SESSION['shipcost'] . 'currency_code=' . $my_currency . '&return=' . tep_href_link(FILENAME_PAYPALMULTIBANK, '', 'SSL') . '&cancel_return=' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

					// grab URL and pass it to the browser
					curl_exec($ch);

					// close cURL resource, and free up system resources
					curl_close($ch);
					echo 'payment for: ' . $value . ' complete.';
					echo 'charge: ' . $my_currency . $_SESSION['price'][$key];
				}

 

can anyone tell me if it's possible to do this either behind the scenes so the user just submits the form on my page and the foreach takes places or perhaps opens it in a new window and carries it out, without the customer having to submit multiple times.

Thanks

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.