Jump to content

Recommended Posts

i have integrated paypal in my cakePHP website which i am building....but i do not want my users to go to paypal for making the payment.....he/she should stay on my website and still be able to pay via paypal....i saw a website payments pro option  which is somewhat similar to what i need except for the mandatory feature Website Payments Pro Shopping Carts...so is it necessary to hav a shopping cart as user doesnt need a shopping cart...he just pays and he becomes a premium user...its just for this purpose....if anyone has done it please guide me

 

Website Payments Pro is an API. You integrate it yourself. It has nothing to do with shopping carts or any other system. It is simply a method to take credit card details from a user on your site, send to Paypal with the transaction amount, and receive a response back.

I have integrated into many sites.

Before you can use Paypal Direct Payments or Express Checkout as part of Website Payments Pro you must first be approved by Paypal. Have you got this far?

 

Once you have been approved and have access to the API, the easiest thing to do is download the SDK. This contains examples on taking payments and should be easy to implement into your own site. Use the Paypal sandbox system to test taking payments. There is quite a lot of documentation you will need to read through.

  • 2 weeks later...

i have done the integration and it works fine for the paypal link which goes to the paypal sandbox site(logged into paypal sandbox in another tab with my test account) when clicked on. After the user clicks the paynow button below in that page it returns a page like which says "You must login to Sandbox to use these features." But i am already logged into paypal sandbox in another tab. what could be wrong?

i am working on cakephp framework. and here is a code i had sourced out. all credits to its developer. its a plugin basically. i need some clarification here too.

 

function express($callback = null) 
		{


				if (isset($callback) && isset($_REQUEST['csid'])) 
				{ 
					// Restore session 
					if (!$this->Paypal->restoreSession($_REQUEST['csid'])) 
					{ 
						$this->redirect('/'); 
						exit; 
					} 
				} 

				// Neither buyer nor credit card information since it is handled by PayPal
				$order = array( 
					'action' => CAKE_COMPONENT_PAYPAL_ORDER_TYPE_SALE, 
					'description' => 'CakePHP Component', 
					'total' => 9.99 
				); 

				// Set up common component's parameters 

				/*
				$this->Paypal->setEnvironment(CAKE_COMPONENT_PAYPAL_ENVIRONMENT_SANDBOX); 
				$this->Paypal->setUser('ApiUser'); 
				$this->Paypal->setPassword('ApiPassword'); 
				$this->Paypal->setCertificate('cert_perm.txt'); 
				$this->Paypal->setOrder($order); 
				*/ 
				$this->Paypal->setEnvironment(CAKE_COMPONENT_PAYPAL_ENVIRONMENT_SANDBOX); 
				$this->Paypal->setUser('nirmal_1276848417_biz_api1.yahoo.com');
				$this->Paypal->setPassword('1276848426'); 
				//$this->Paypal->setCertificate('cert_perm.txt');
				$this->Paypal->setSignature('An5ns1Kso7MWUdW4ErQKJJJ4qi4-AlMpgmZtT9WUC-1RoOTEmAXt1WpE'); 
				$this->Paypal->setOrder($order); 

				if (!isset($callback)) 
				{ 
					// First call, user gets redirected to PayPal 
					$this->Paypal->setTokenUrl('http://www.sandbox.paypal.com/payments/express/pay?csid=' . session_id());
					//$this->Paypal->setTokenUrl('https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token= ' . session_id());
					$this->Paypal->setCancelUrl('http://fanalyze.com/fanalyzetest/users?csid=' . session_id()); 

					// Save current session 
					$this->Paypal->storeSession(); 

					// Make payment via PayPal 
					$result = $this->Paypal->expressCheckout(); 

					if ($result === false) 
					{ 
						echo 'ERROR: ' . $this->Paypal->getError(); 
						exit; 
					} 
				} 
				else if ($callback == 'cancel') 
				{ 
					echo 'SNIFF... Why not?'; 
					exit; 
				} 
				else if ($callback == 'pay') 
				{ 
					// Second call, make payment via PayPal 

					$result = $this->Paypal->expressCheckout(); 

					// Check PayPal status 

					if ($result === false) 
					{ 
						echo 'ERROR: ' . $this->Paypal->getError(); 
						exit; 
					} 
					else 
					{ 
						echo 'TRANSACTION SUCCESFULLY COMPLETED';
						echo '<pre>'; print_r($result); echo '</pre>';
						$k = 2;
						$this->User->updateAll(array('User.user_acct_type_id' => $k),array('User.id' => $_SESSION['Auth']['User']['id']));
						/*$this->Email->from    = 'nirmal@dreamajax.com';
						$this->Email->to      = $this->data['email'];
						$this->Email->charset = 'utf-8';
						$this->Email->sendAs = 'html';
						$this->Email->subject = 'Payment Confirmation for Fanalyze';
						$this->Email->send('You have purchased a premium account from Fanalyze. Glad to welcome you and you will be able to access all premium paid service in our website.');*/
						exit; 
					} 
				} 
		}

 

what should be the address set here?

 

$this->Paypal->setTokenUrl('http://www.server.com/payments/express/pay?csid=' . session_id());

 

i replaced it with sandbox site link i.e., $this->Paypal->setTokenUrl('http://www.sandbox.paypal.com/payments/express/pay?csid=' . session_id()); or should it be say mysitename.com/payments/express/pay???

i replaced it with sandbox site link i.e., $this->Paypal->setTokenUrl('http://www.sandbox.paypal.com/payments/express/pay?csid='  . session_id()); or should it be say $this->Paypal->setTokenUrl('http://www.mysitename.com/payments/express/pay???

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.