In this picture,there are 3 main steps:SetExpressCheckout,GetExpressCheckoutDetails and DoExpressCheckoutDetails,I'm now sure SetExpressCheckout is to be called by myself,what about GetExpressCheckoutDetails and DoExpressCheckoutDetails,is it called by paypal or by myself?
The api is provided to be called by non-paypal I think,but the problem is seems it's redirected to paypal after calling SetExpressCheckout.
(source: paypal.com)
Yes, you are expected to be the one calling these APIs. After you call SetExpressCheckout, you'll get a token back that represents the checkout you're performing. You'll need to use that token and redirect the user to Paypal to approve the payment. After they approve it, Paypal will redirect back to your site and then you can call GetExpressCheckoutDetails and/or DoExpressCheckoutPayment. The GetExpressCheckoutDetails call is useful for getting things like shipping address, etc, since the buyer can set that stuff as part of the approval flow. Once you have all the info you need, the buyer has approved the payment and you're ready to get paid, then call DoExpressCheckoutPayment to get your money.
See the ExpressCheckout docs for an example of a simple integration.
Related
We are using Woocommerce along with PayPal Pro on our website.
We are using the CloudIQ basket abandonment system and need to add a PayPal API request call to be made after the customer completes the checkout process.
Does anybody know if this is possible in PayPal and how I do this?
Thanks
Not quite sure about your exact request. But if you are referring to the data collection API call in PayPal, you can refer to the link below about PayPal Instant Payment Notification (IPN).
https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNIntro/
In addition, PayPal have Classic API and REST API for your reference in the link below.
https://developer.paypal.com/docs/classic/api/
https://developer.paypal.com/docs/api/
According to the documentation the paypal payment method should be able to do Authorization & Capture just fine. The following excerpt under the PayPal authorizations excerpt specifically states how to go about it:
First get payment approval and execute the payment as you normally would do for a PayPal payment. Once you successfully execute on the payment authorization, PayPal responds with a new set of HATEOAS links, including a capture link that you use to capture the payment.
So if im following correctly the flow for doing Authorize & Capture is as follows:
Create a Payment
Redirect User to HATEOAS link approval_url to get them to sign into paypal.
Be returned to success (or cancel, but not in this example) link.
Get the Payment to see what's changed, get the shipping address / etc....
Let the customer review the details
Execute The Payment to commit to the hold on funds.
At this point an AuthorizationID / HATEOAS Link should hold information about the authorization.
Some time later use the authorization ID to Capture, and voila, we're done.
Now this is all fine and dandy, but in my tests on the sandbox environment I'm having trouble retrieving the authorization ID anywhere.
Here's my HATEOAS Links I receive from my Execute Step:
As you can see, only the self reference is returned, according to the documentation there should be one capture link at the least that should have the authorizationID in it.
Also, nowhere in the response body is any authorization ID. However, If I look at the payment in my sandbox paypal dashboard:
And once I drill down into it:
Sure enough if I call the Authorization.Capture API call against 8B633793L37511009 it captures as you would expect. However I can't find a programmatic way to determine this number.
How am I supposed to store the authorization number so my tooling can capture later when our business conditions have been met?
In the beggining, when you create the payment with intent authorize you should be getting an authorization object within the response. This object has the id you need for the capture later.
Check this blog post to see if you're missing something fundamental in the picture.
I followed the tutorial and executed the sample requests via curl. As you can see, I got the authorization id under transactions->related resources->authorization->id
Then I used the id in the URL and successfully captured the payment.
Hope this helps, if it doesn't, please elaborate and maybe I will be able to help you further. Good luck!
Please help. I have recently updated the paypal express checkout system on my website (where it leaves the website to go to paypal for payment, then returns).
It was all working fine in sandbox. I went to put it live, and I have found the correct API credentials, but it won't work.
It takes me to the paypal page fine. It takes payment and returns me to the payment return url. All fine. But no payment actually moves anywhere.
What am I doing wrong?!
Thanks.
It takes me to the paypal page fine. It takes payment and returns me to the payment return url. All fine. But no payment actually moves anywhere.
From you declaring that, it seems that you are either not performing the DoExpressCheckout API call, which is the call that moves the money, OR you are getting an error with your DoExpressCheckout call. The flow and error codes for Express Checkout can be found here.
On PayPal pay attention to the button text -
If it reads "Agree and Pay" - then you have configured PayPal to take payment
If it reads "Agree and Continue" then you have only set up the transaction but PayPal is waiting for you to send a confirmation to take payment (there is no DoExpressCheckoutCall)
I am creating a website and instead of using a fully featured shopping cart I want to use the Paypal API to "automate" some functionality.
By that, the user clicks on the "buy now" button goes and makes payment to paypal, and I want them to be redirected back to my site so I can process some info for my database. I looked into IPN but it seems like an overkill. Is there any simpler way of doing it?
You should look at either IPN or Express Checkout.
If you are using web standard payments it is important to note that a customer does not have to return to your page, once they hit pay on the Paypal site - the transaction is complete. Hence relying on them to return to your page to do a database update is a bad idea. This is where IPN comes into play.
Express Checkout gets around this by allowing the customer to authorize on Paypal and complete a transaction on your site. Passing the data directly to your site once the transaction is complete.
I'm building a small cart app in PHP which needs to have PayPal integrated into it for payments.
Checking the PP developer site you get 100 different APIs for every kind of job, however there is no clear answer as to which is the GENERIC API I should use to accept payments in the classic manner most webshops implement:
1. Client clicks pay
2. Redirected to PP site where he is asked to login.
3. After login he is presented with confirmation, he clicks OK.
4. Browser redirects back to my cart which presents user with a "Thank you" message, order code etc, while in the background a request is sent to my cart with the transaction credentials (transaction id, success status etc).
By the way, I'm not looking for Express Checkout since in this case PP provides the shipping info.
You could use the DoDirectPayment API to process payments. This will keep the buyer on your site, and they will enter in the information on your site. Then you will pass the details over to PayPal through an API call, and PayPal will then send the response back to you if the payment is approved.
If you are not wanting to use the DoDirectPayment API and are wanting to direct the buyer over to PayPal's pages to complete the payment but do not want to use Express Checkout, you could use PayPal Payments Adv/Payflow.
Express Checkout is what you want. Shipping info can be set on your end or Paypal end. It makes no difference.