codeigniter paypal url - codeigniter

I have downloaded the codeigniter paypal lib. I have few questions regarding this library.
My paypal url is set to this, $this->paypal_url = 'https://www.paypal.com/cgi-bin/webscr', Is it for testing!? How can I change it for actual transactions?!
My return url is set to a success controller, but I am not able to view the post information returned by paypal. Could anyone tell, what exactly is the problem?!
I want to store the transaction details (Amount paid,paid by whom, on what date and for which product), How exactly I can achieve this?
thanks

A lot of my answers relate to the Adaptive Payments API, so apologies if it doesn't correspond 1:1 but hopefully it will point you in the right direction.
The URL you're pointing to is the live site I believe, if you want to run api calls against the sandbox the proper URL is https://www.sandbox.paypal.com/cgi-bin/webscr
The return URL is the page that Paypal redirects to after a transaction or cancel. There is no POST request associated with this, however..you can pass parameters into the URL (such as http://mysite.com/succes.php?amount=xxx) so that you can retrieve them later. This is a rather inconsistent way of doing things, though. Which leads to...
Look up the IPN documentation on Paypal (starting point: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNIntro) This allows you to specify a URL which Paypal will POST the transaction details to after a transaction request.
Before you can store these details you need to do send back a request to Paypal to validate that the IPN was generated from Paypal (this is in the docs). After that you can store the details into your database.

Related

PayPal integration in Laravel site

I need to implement PayPal payment in my Laravel site. I was going for the server side integration, in order to save all the data, transactions and know what they actually bought. But turns out that [the older] server-side integration method [that I was looking at] is archived, and not really the preferred method anymore. Instead, they suggest using the smart buttons, with front end integration only.
Questions:
Is front end only safe? what prevents the user from messing with the JavaScript and editing the sum with whatever they want?
How do I know what they ordered if it is all front end?
What would I have to do if the payed sum does not correspond to the articles in the cart?
What should I be aware of with this system?
Smart Payment Buttons can be used with or without a server-side component.
Here is the front-end pattern that communicates with a server-side integration: https://developer.paypal.com/demo/checkout/#/pattern/server
Notice the fetches to two '/demo/...' placeholder endpoints, which need to be replaced with actual routes of yours. The first should create a v2/order via API and return the orderID. The second should capture that order after the payer approves it via Smart Payment Buttons.
The answers to your questions re: a serverless (client-side only) pattern are:
Nothing
Only what you program the JavaScript to tell you and which it actually successfully tells you, or what you read via email or in your PayPal account or app notifications
Refund the transaction
It's for people who don't want to do the work of implementing server-side routes and API calls.

PayPal checkout options

I've been working on a secure shopping cart and checkout for a website. I'm using PayPal, and I'd read that PCI requirements aren't as much of an issue if we don't store card data on our site, so if possible I'd like to avoid that.
HTML buttons seemed like a promising option, but upon further investigation, it seems like maintaining control of active user sessions may not be possible. Below are my sources that seem to confirm this.
PayPal button return url usage
delete session variables when session id is known but not able to start session
PayPal payments pro is mentioned in the second post, but I'm wondering if it or anything else meets my 2 design constraints as they're implications for the implementation don't seem to gel very well.
If they are losing session data when returned from PayPal with a standard button then they have something else going wrong. That should not be happening.
That said, if you're comfortable working with APIs I always recommend Express Checkout and Payments Pro.
If you prefer REST APIs you can use that for PayPal payments and direct credit card payments.
If you prefer NVP / SOAP you can use the Classic API.
In any case, keeping session data alive won't be an issue, and as you mentioned, as long as you aren't storing any credit card data on your server in log files, in the database, or anywhere then you won't have to worry about PCI compliance.

Google Analytics Issue for Magento to PayPal

So, having discovered that customers are not returning to our website after making their PayPal payments, our Google Analytics reports are wonky as the landing page (success.phtml) which generates the order completion history/goal is never achieved.
Is there a PayPal APi callback to Magento which can generate the correct Google Analytics data? Is there a way to generate GA code at the PayPal end?
Any pointers appreciated!
Thanks, Joe.
a better question for you is why are your customers not reaching the success.phtml?
Go to Website Payments under Profile on the PayPal website. Setup your return URL and enter the succes url there...
If your customers don't return because they close their browser before returning to the shop:
You could remove the script from success.phtml and add a serverside-call to GA using something like serversidegoogleanalytics but you'll have to implement this for all paymentmethods you are accepting... This serversidecall would be done in the success-action within the controller of the paypal module

Payments in booking system

I am trying to figure out how I can use Paypal to process payments in a booking system I am building. I think Paypal has a very messy documentation, and I can't seem to get a good overview over what to do. Firstly, I'm from Norway, and it seems Paypal has some restrictions when it comes to what kind of solution I can choose. These two are the ones that seem in the right corner:
Website Payments Standard
Express Checkout
What I generally wants is to send the user to paypal. If the payment is confirmed, the user should be sent to a confirmation page. As I understand it, that won't be a problem. But how can my system know that the payment is okay? Is there any id being sent back and forth? The system needs to save some information about the payment in the database.
What solution should I choose?
And how can I associate the payment with the current booking?
Paypal sends response "Verified" for successful payments when you use ipn_url, using this response you can check if the payment is ok or not.
For more info pls check the link:
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNIntro
For Codeigniter you can use paypal library: this might be of help:
https://github.com/orderly/codeigniter-paypal-ipn

Guidance related to Paypal Integration Using Codeigniter

I need some guidance related to PayPal Integration. It's not similar to a regular cart.
After checkout, the site offers a form for payment option. Either it's PayPal, or some other payment process. The form directs to controller after the user submits. An array exists, which contains all item values.
From here on how can I proceed to the Paypal site?
Just to let you know that we've just open-sourced our replacement CodeIgniter PayPal library, called codeigniter-paypal-ipn. (We use this library in production.)
It performs more validation than PayPal_Lib, and it also saves the orders down to your database (using either CI active record or Doctrine).
I hope you find it useful!
There is an existing library for integration with Paypal using CodeIgniter:
http://codeigniter.com/wiki/PayPal_Lib/
I asked the same kind of question here.
And http://www.phpfour.com/blog/2009/02/php-payment-gateway-library-for-paypal-authorizenet-and-2checkout/ is good resource.
Please have a look.

Resources