Paypal Authorization standard and capture through REST API - paypal

I've been asking myself if there is a possibility to use the standard payment page of paypal to redirect user to "Authorize" a payment using their Credit card (using "paymentaction" : "authorization" in the redirect form).
Having IPN setup i could receive the auth_id.
Then later on "Capture" an amount (equals or less) using the Paypal REST API but using the "auth_id" received through IPN ?
It seems the "authorization_id" received through Paypal REST API "Authorize" is the same length. Somehow i suppose it is the same value.
Before implementing such i wonder if anyone tried this before ?
Thank you

You can do this using the standard (Website Payments Standard) page to creat the authorization paired with the "classic" authorization API, but you cannot mix the classic and REST APIs as you described.
The REST APIs store different/additional information on PayPal's server side, so in general you cannot manipulate transactions created through classic APIs via REST APIs (and vice versa is also complicated and generally not advised).

Related

Paypal Payment Standard via Paypal Rest API

I am looking into implementing Paypal Standard Payment product. The basic reason being "offsite payment" (i.e. we dont want payments being captured at our own site, but on paypal's own payment page via redirection).
However, previously I used to get it done via (now called) Classic API.. I wounder if the new REST API supports this offsite / paypal redirect standard payment method? This is because there is no mention of these classic products names on the REST documents (instead, they are listed in Classic API section only)
Secondly, does Paypal Standard (even via REST) support Direct Card payments? or only Paypal Account payment?
Thanks.
REST does not encompass all Classic API features. It's mainly for mobile development (although not exclusive to that), using OAuth, which is more familiar to mobile developers. Payments Standard is not an API product at all but it can be used in conjunction with API calls to a limited extent. Classic API has the Button Manager that lets you set up custom encrypted buttons that can start a Payments Standard payment.
REST does support direct payments and supports almost everything Classic does in that regard.

How to tell if refund was issued via API or through the regular web interface?

Is there anyway to know if the refund was issued directly from PayPal web ui or via API (of some kind)?
Unfortunately there isn't one that I know of. They show up in the website and API the same way.
This is why I log all my API calls. Makes it easier to find out what your API calls have done.
While performing the refund thru API or PayPal account you can make use of the "note" field which will be displayed on the Transaction detail page . So you can pass the different text( some standard text ) while performing refund through API and different text while doing from PayPal account .
In this way you can differentiate between two types of refunds.

Sending information using paypal API without creating a complete payment

Is there a way to use the paypal API to send basic details of a payment without actually creating the payment itself? What I mean is, I'm working with a non profit organization that does not currently employ SSL. They want to use paypal to accept donations, but they want their own branded form on their page, they don't want to use the simple donate button. I had thought I might be able to send basic details, such as name and address along with the amount they wish to donate and a few other details using the paypal API, and then have the actual payment information processed on paypal's secure servers. All the examples I can find on how to use their API however are creating complete payments and sending them to Paypal, something I'm not able to do for obvious reasons. Short of employing SSL, something that we should probably do anyways, and capturing a complete payment, is there a way of sending just select information over the API and handling the rest on paypal's end?
If you want to control the form itself you don't have any choice but to go SSL. Any other route would require sending the user to PayPal, where you would no longer have that control.

How to use Authorization & Capture correct way in woocommerce store

I am currently developing a website for my client and he needs "Authorization & Capture" payment from paypal in his cart.
I have seen that the woocommerce give " PayPal standard " option to their store, and i am confused that Authorization & Capture can be added to paypal standard?
If no, then how can i add it to my site?
You can process Payment Standard transactions as an Authorization. You need to define the variable paymentaction in the code you're passing to PayPal and set the value to authorization.
You'll then need to submit DoCapture API calls to complete the payment or capture them manually through your account.
I don't know what options are in Woocommerce so I can't be sure if they have an option for it but it is possible to process Payment Standard transactions as an Authorization.

Paypal REST api and configuring direct payment page

With the paypal NVP api, we were able to set some options for the generated paypal checkout page using SetExpressCheckout. Is there a way to do the following with the new REST api?
NOSHIPPING to tell paypal that I don't need a shipping address.
LOCALECODE to set the gateway in the user's language.
HDRIMG to change the title of the page to a logo.
EMAIL to pre-populate the email in the gateway. NOTE: I've tried using $payerInfo->setEmail() but apparently this method is only for credit_card and not paypal requests.
SOLUTIONTYPE to set the billing info by default.
LANDINGPAGE to set the landing page.
I cannot find it in the paypal developer REST api docs.
Unfortunately not at this time. We are trying to implement a better mechanism to configure the payment experience than overloading the API calls. Until then please use the classic ExpressCheckout API if these are something that you really need.