PayPal API Website integration with or without CURL - php

PayPals documentation is quite confusing:
I need to integrate PayPal API into my website so the customer can pay for a final sum. And im using the sandbox for testing.
Now, technically, i found two different methods of integrating the API:
Without curl - using header('location', $urlwithvars)
With curl https://developer.paypal.com/docs/classic/express-checkout/gs_expresscheckout/
Now what confuses me - is curl only used because you can do a POST call to the paypal server? Because using the first option i also get directed to the paypal procedure and get the JSON response successfully on my notification url.
Im using following library: https://github.com/jersonandyworks/Paypal-Library-by-RomyBlack
Is that enough or should i use the complete curl process like here http://www.sanwebe.com/2012/07/paypal-expresscheckout-with-php
So basically the main question: DO i have to use curl process or is the header-location-url idea enough?
Thanks in advance

That library you're using is actually just using Payments Standard, not Express Checkout. That may be where part of your confusion comes from. This isn't even hitting the actual API's. Not sure if you care about that or not, but I personally prefer the full Express Checkout API as it provides a lot more options and freedom to integrate however you want.
I'd recommend you take a look at my PHP Class library for PayPal, which has all of the actual API's built in. I have a CodeIgniter specific version of it, too. It will do all the API work for you and you can integrate pretty much all of their calls within minutes.

Related

PayPal REST setup is too advanced for my users, is there an alternative?

I'm building a site on which I'll provide users with their own webshop.
The webshops need to be able to accept payments, and I've made the integration using PayPal's express checkout (Client-side REST).
I thought all was well, up until the point where I was writing the setup guide for my users.
In order for them to create REST credentials, they need to log into the developer portion of PayPal, create a sandbox account, and then create an app.
Compare that to how it was/is when using NVP/SOAP, where you log into your PayPal Business account, and basically just follow the flow to get your API credentials.
Furthermore the NVP/SOAP implementation of Express Checkout is deprecated, so I'd really like to avoid that implementation, if possible.
I feel like my options boil down to this:
Use REST and force my users to go through a somewhat confusing setup process.
OR
Use NVP/SOAP, which is deprecated, but has a much more streamlined setup process.
Am I missing something, or is this just how it is?
EDIT/UPDATE
I also reached out to PayPal support and received the following answer:
There is no other method to obtain REST API credentials other than logging into PayPal Developer and creating a REST application.
The only other 'method' available, would be to use Braintree Payments instead, which provides PayPal integration.
https://www.braintreepayments.com/en-dk?locale=en-dk
So all in all, there doesn't seem to be an "easy" way to get REST credentials
I'll accept the answer by neuromatter, as he is correct, it's always better to use non-deprecated APIs
Go with REST. When you're developing something new you should always avoid using something already deprecated. Usually large organizations will tell you if they plan to completely turn something off (and perhaps SOAP is too big for PayPal to end anytime soon) but you don't want to take that risk. Even worse than forcing your users to setup REST would be to force your users to setup SOAP then have to setup REST shortly thereafter because they ended support.
For context, have a look at the PayPal setup page for WooCommerce:
https://docs.woocommerce.com/document/paypal-standard/
As you can see they fully expect people to enter in credentials to configure their store. The only way around this really is if you wanted to offer a more full service product where for a fee you (or someone you employ) would be able to configure their store for them. But that's a separate discussion.

Paypal API List Withdraws

I'm implementing a PHP Web application that uses PayPal for payments. I'm using for all the things the REST API.
My problem is how can I get the list of withdraws from PayPal API?
I'm going to use the functionality to withdraw to a bank every day, but I will need to see, with the API, those withdraws...
Any idea? I'm a little bit lost after spending two days searching and trying page on google.
Thank you in advance,
Rui
I don't think the REST API supports it yet. The Classic API does, though, with the TransactionSearch API.
Our PayPal PHP SDK will make this very quick and easy for you to setup.

PHP + PayPal: make payment by PayPal without screen login

I have a new question. This is my context:
I want to make my own API REST, where I can call this method with information about my product as parameters. My backend method do the typical purchased process but it doesn't show the PayPal screen which show information about my product, just do the process directly and I receive an answer. Is it possible?
I'm using the PayPal SDK for PHP, and looking for at Google I just have gotten that the PayPal page shows, but I'm new in this. Your answer will be so good!
Yes, this is very possible. There are plenty of tutorials online for building your own REST service, and within your service methods you can hit other APIs or do anything you need to do.
Your service can parse the results from the 3rd party service you're hitting (you could hit 10 different services if you wanted to) and then you would generated your own basic response which includes a collection of all that data back to whatever client hits your service.

PayPal Chained Payment PHP

I'm looking at setting up a PayPal chained payment request but I'm struggling right at the start (doesn't look good) haha.
Basically I'm using these API docs: https://developer.paypal.com/webapps/developer/docs/classic/adaptive-payments/ht_ap-delayedChainedPayment-curl-etc/
I'm just wondering where I get the APi details from? With the .developer console you don't get the signature or at least I can't find it.
Can anyone give me any examples of this?
Thanks
You can use this link to easily obtain API user, pass, and signature.
You might also be interested in taking a look at my PHP class library for PayPal. It will make the API calls very simple for you.

Integrating paypal standatd payment gateway issue using twig template engine php

Please can anyone tell me how to integrate standard paypal payment gateway in twig template engine(framework) using PHP.
Please help me. Right now i am in big trouble and even i am beginner.
The quickest and easiest thing to get basic payments working on your site would be to use PayPal Standard buttons. You can create them from within your PayPal account profile, and then it just gives you a snippet of HTML to copy/paste into your site where you'd like the button to show up.
Since you're using PHP, if you want to get a little more advanced with the payment integration you could go with PayPal Express Checkout API's instead of Standard. The documentation can be a little bit daunting, however, with the use of my PHP class library for PayPal you can handle everything very easily with nothing more than the knowledge of working with PHP array data.

Categories