PayPal Express Checkout - paypal

Is it necessary to have a confirm page after returning from PayPal with token and PayerID? Or there is no problem in calling directly DoExpressCheckoutPayment without showing confirm page to buyer?

You could use the useraction=commit variable in your SetExpressCheckout API call. The purpose of "useraction=commit" is to allow you to finalize the transaction automatically, immediately when the buyer returns, instead of offering them one more confirmation screen. You would do this in a scenario where you don't need to do things such as calculating shipping charges based on the address returned from GetExpressCheckoutDetails, and you are sure the original payment amount is the final amount.

Related

Am I allowed to fire DoExpressCheckoutPayment automatically for PayPal Express Checkout?

My client wants us to automatically return the user to PayPal during the Express Checkout process, effectively clicking the "confirm and pay" button at the review stage if the transaction price has not changed during the process.
I can do this, but I am wondering if it is against the PayPal terms of service as it seems to me that this could be used to trick the user into paying more than they are expecting.
I have searched on the PayPal site and had a Google, but found nothing saying it is against their terms. Does anyone else do this or know whether it's acceptable practise?
You mean that you want to change the amount in the DO Express API call against the amount that you specified in SET EXPRESS API call . Yes you can change the amount in the Do Express API call because most of the time Merchant needs the shipping address information from the buyer's PayPal account. And once they get the shipping address via the Get Express Checkout API call ,shipping fee is added to the authorized amount and then DO Express API is called .
That is just fine yes, and for those instances you should set useraction=commit in your redirect URL to PayPal. This will make the button on the PayPal review page say "Pay" instead of "Continue" so the user knows that is the final review. Then back on your site you can make the call to DECP and simply display the final receipt / thank you page when that's done.

Paypal: technique to obtain buyer's country for establishing postage prices without introducing extra steps

This is probably a stupid question, I think I'm having a mental block.
I want to use Paypal's express checkout for buyers to make purchases with as few steps as possible (also using Paypal's optional account feature). The problem is: for me to direct the user to paypal, I will need to have calculated shipping costs, which depends on the country they're in. Obviously I cannot know this unless I have been told one way or another. What are common solutions to this problem?
Ideas:
Use their IP address. Not reliable - various types of proxies, VPNs, anonymizers etc.
Have the user select their country from a drop-down box before I redirect them to paypal
Force them to log in using Paypal's Identity service before calculating postage
Use 1. or 2. and once payment is received, if country is different to expected,
Refund buyer the difference in postage cost or request an additional payment. (Hardly ideal)
Similar to 4., instead of "Sale Payment Action for Express Checkout" Use 1. or 2. in conjunction with one of Paypal's delayed express checkout payment methods and if necessary reduce or increase the amount charged:
Authorization Payment Action for Express Checkout
Order Payment Action for Express Checkout
I'd like to know what solutions other developers have chosen - maybe I've missed an idea. As a consumer, I cannot remember seeing solutions to this.
The general way people do this is simply to use GetExpressCheckoutDetails to obtain the buyer's shipping address, apply any shipping/tax as necessary, and display a final review page on your site that the user would confirm before calling DoExpressCheckoutPayment.
If you want to eliminate the additional review page (PayPal's and then your own) you can use the Instant Update API.
In this case you would include an additional parameter on the URL when you redirect to PayPal (useraction=commit) and this will change the button on the PayPal review page to say Pay instead of Continue.
Also in your SEC request you'll include the CALLBACK parameter and include a URL to your callback listener. PayPal's review page will POST the buyer's shipping address to this callback URL so that you can receive the data, calculate shipping and tax accordingly, and send a response of those options back to the PayPal review page. This will populate the PayPal review page's drop down menu for the shipping option and the user can choose accordingly.
This method allows you to utilize the PayPal review page entirely and finalize the payment there so that the only thing the user sees once they're returned to your site (after you call DECP) is a final thank you / receipt page.

Handling unknown shipping costs via PayPal Express nvp API

Can some confirm something for me; I've searched PayPal's docs and just can't find the answer.
If calling SetExpressCheckout with the parameter 'TOTALTYPE'= 'EstimatedTotal', how much headroom does PayPal allow for finalizing the transaction?
For example, someone carts an item that has a cost of $1. They click PayPal Express and get sent to PayPal to authorize an estimated amount of $1. Then they return to the merchant site and now that their address is known, the cart says shipping is +$20.
Is that acceptable? I'd really like to understand the groundrules on this, as I don't want to risk any authorization errors due to insufficient order amount when making the request.
Well, I have to answer my own question here. I called PayPal. The answer is "it's handled, don't worry about it". They would rather not publish the details on their proprietary algorithm because there are fraud tests, etc. going on -- but said it is a key design point for them and it is absolutely handled no worries.
If you are not passing a SHIPPINGAMT variable with the SetExpressCheckout call, then we will not display or "calculate" shipping on the PayPal page. When they are transferred to the PayPal page the customer is not authorizing the payment per se, rather they are selecting their payment method/funding source to be used when the DoExpressCheckout call is passed.
Only after the customer is transferred back to your page, and the final order total is known and passed via the DoExpressCheckout is the payment initiated. The difference between the total amount in the Set call and the Do call does not matter. Perhaps the agent with whom you were speaking with under the impression of an authorize/capture structure being in place. This will limit the final capture amount to the authorized amount +/- 20%.
Of course this is all turned on its head if you are passing the USERACTION=COMMIT variable which will "finalize" the payment on the PayPal page, while the DoExpress call is run transparently on your end. This will change the text on the button on the PayPal page to "Pay Now" instead of "Continue: You're almost done. You will confirm your payment on yourwebsitehere.com"
I hope this helps!

Paypal: Is there a way to check a cart right before a user pays?

Is there any way currently for Paypal's API to send my site an authorization request before completing a user's payment?
I think the answer here would be that there is no way to do this, but one can set "authorization" as a cart parameter instead of "sale". This still leaves the question of how to complete the authorization in the callback.
May be this would clarify your doubt up to a certain extent.
Authorization & Capture starts when your buyer authorizes a payment amount during checkout.
For example, you can use the PayPal Express Checkout API with the PAYMENTACTION element set to Authorization or Order.
After your buyer completes checkout, you can then use the payment’s transaction ID with Authorization & Capture APIs. You can:
Capture either a partial amount or the full authorization amount.
Authorize a higher amount, up to 115% of the originally authorized amount (not to exceed an increase of $75 USD).
Void a previous authorization.

PayPal SetExpressCheckout vs. payment buttons

What is the benefit of calling PayPal API SetExpressCheckout method to get a payment link and forwarding a customer there instead of using payment buttons?
The PayPal buttons can be modified by the visitor's browser client. It is just basic HTML. All of the variables to place the order can be manipulated by the customer. For instance, it takes 3 seconds to change the order total from $900 to $1.
Using the API, you tell PayPal to create an incomplete transaction for a certain amount, with certain information, that can then be referenced/completed later and there is no way (short of expert hacking) to change the order. Instead of trusting the visitor's browser, PayPal trusts your server.