devilinc Posted June 10, 2010 Share Posted June 10, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/204379-payment-via-payl-without-going-to-paypal-website/ Share on other sites More sharing options...
JonnoTheDev Posted June 10, 2010 Share Posted June 10, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/204379-payment-via-payl-without-going-to-paypal-website/#findComment-1070342 Share on other sites More sharing options...
devilinc Posted June 10, 2010 Author Share Posted June 10, 2010 thanks mate...yes i have been reading through a lot today....getting the hang of it.... Quote Link to comment https://forums.phpfreaks.com/topic/204379-payment-via-payl-without-going-to-paypal-website/#findComment-1070345 Share on other sites More sharing options...
devilinc Posted June 21, 2010 Author Share Posted June 21, 2010 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??? Quote Link to comment https://forums.phpfreaks.com/topic/204379-payment-via-payl-without-going-to-paypal-website/#findComment-1074867 Share on other sites More sharing options...
devilinc Posted June 21, 2010 Author Share Posted June 21, 2010 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??? Quote Link to comment https://forums.phpfreaks.com/topic/204379-payment-via-payl-without-going-to-paypal-website/#findComment-1074868 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.