PayPal API - How to keep the payment process on my website? - paypal

I run a small marketplace with multiple sellers where buyers can buy items and pay with PayPal. The problem is, when someone makes a payment, they are then displayed the "Payment Confirmation" on the PayPal website and are given a choice to either return to their PayPal account, or return to the website.
Is there any way to keep the payment flow on my website, except for the payment part? I notice when buying on Etsy for example, the buyer goes to PayPal to make the payment and is then immediately returned to Etsy for the payment confirmation. They never see the PayPal payment confirmation page.
I assume it could be because Etsy and PayPal have a special arrangement that isn't available to other sites? Or am I missing something in the API?
Right now, with the normal PayPal API, this is what buyers see:
NAME, you've just completed your payment.
Your transaction ID for this payment is: XXXXXXXXXXXXXXXXXXXX.
We'll send a confirmation email to your#email.com
Go to PayPal account overview.
Go back to "seller#email.com".
I can't even figure out how to change the "Go back to..." link to my website name in the hidden fields. PayPal just chooses to display the seller's (the person that received the payment) email address.
Is there any way to at least set a website name for them to return to with hidden variables? Keep in mind that I have different sellers, so it's not something I could set inside each seller's PayPal account.
Thank you :)

I assume you are using Express Checkout with Set/Get/Do EC API integration. Please check the below document for experience options available with Express Checkout API.
https://developer.paypal.com/webapps/developer/docs/classic/express-checkout/integration-guide/ECCustomizing/
The 'useraction=commit' in the PayPal payment auth url triigers the 'Buy' button. If you do not send that request paramter then it will show 'continue' button and you can complete rest of the process on your site.
However, if you are using Paypal Payment Standard product then you need to use Express Checkout to accomplish the outcome you are seeking.

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.

Use PayPal From Website Form

Requirements state that I build a form that collects user's PayPal login info and charges the user's PayPal account a fixed price without having the user leave the website.
I am beginning to think this is not possible. Can someone kindly suggest a solution that comes close to meeting the requirements? I am not certain what's possible and what's not possible with PayPal.
There isn't a solution for what you are trying to do. In order for the buyer to login and pay with PayPal, they would have to leave your site and go to the PayPal login page. You could set up a billing agreement so that they only have to log into PayPal once. With a billing agreement, you would be able to charge the buyer's PayPal account when you are needing to. You would just need to have the buyer go through the flow initially and get sent over to PayPal to login and agreen to the billing agreement. Then when you want to charge them again in the future, you would just need to reference the billing agreement id.
The closest solution to having the user pay without leaving the website is PayPal digital goods express checkout.
Here is an example to show you how it works:
http://jmsliu.com/1307/integrate-paypal-digital-goods-express-checkout-into-website.html

useraction parameter in URL

Please some one explain what happens if we send useraction=commit in paypal site url.
> And what parameters we need to send to paypal in SetExpress checkout request to make visible purchase value at PayPal site page.
With Express Checkout, you can shorten your checkout flow to let buyers complete their
purchases on PayPal. Then, you can skip your order confirmation page.
Generally, buyers select payment methods as the last step before they complete their
purchases. If you collect no additional information after buyers return from PayPal, you can
skip the confirm-order page on your website. If you collect additional information that does
not affect the payment, PayPal recommends that you collect it after buyers complete their
purchases.
The useraction URL parameter in your redirect to PayPal determines whether buyers
complete their purchases on PayPal or on your website. If you set useraction to commit,
PayPal sets the button text to Pay Now on the PayPal Review your informaton page. This
text lets buyers know that they complete their purchases if they click the button.
As for your other question about what parameters you need to send to PayPal in SetExpressCheckout request to make visible purchase value at PayPal site page, I am not sure I completely understand what you are asking. If you pass over the amount, this will show up on the checkout page. If you are wanting items to show up on these pages, you would need to pass over the line item details. These variables can be found in the Express Checkout Developers Guide, they will be slightly different depending on if you are using SOAP or NVP.
NVP Developers Guide
SOAP Developers Guide

Paypal express-checkout with option useraction=commit not creating transaction

I have integrated paypal express-checkout in a website. All seems to work fine. When customer is redirected to paypal for payment, the button Pay Now appears, since I am using:useraction=commit, i.e.:
https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=MYTOKEN&useraction=commit
Customer logs in from Paypal and clicks on the Pay Now button. Paypal gives no error, everything seems to be successful and customer is redirected at the RETURNURL, but no transaction is created in the buyer or in the seller account.
I'm afraid I missed some points from Paypal API documentation.useraction=commit will NOT complete the transaction. After returning from Paypal, we still need to execute DoExpressCheckoutPayment in order to complete the transaction.
Like George said, useraction=commit does not complete the transaction. It only changes the PayPal UI so the customer feels they have confirmed it there, so you don't have to add confirmation UI on your site. You still need to make the request behind the scenes to confirm it.
PayPal's docs say this:
The useraction URL parameter in your redirect to PayPal determines
whether buyers complete their purchases on PayPal or on your website.
If you set useraction to commit, PayPal sets the button text to Pay
Now on the PayPal Review your informaton page. This text lets buyers
know that they complete their purchases if they click the button.
After PayPal redirects buyers to your site, call
GetExpressCheckoutDetails and DoExpressCheckoutPayment to have PayPal
complete the payment successfully. Call DoExpressCheckoutPayment
without waiting for buyer interaction. Use information in the
GetExpressCheckoutDetails response to fill out your order confirmation
page.

How to check Payment failure for Paypal Express Checkout

We are using Paypal recurring billing service (using Express Checkout) at our website for monthly subscription.
Since we have an Australian account so we are not able use the DPRP (Direct Payment Recurring Payment) service offered by Paypal because it seems, DPRP service is limited
to only few countries (US, UK and Canada).
In Express checkout payment details are received at Paypal Website. So we do not have any information, whether the payment failed, user pressed the Back button in browser or He/She intentionally clicked the cancel payment.
After speaking to Paypal support team we get know that there could be multiple possible reason for Payment failure, and seller has to contact Paypal by themself. So we can
not provide any troubleshooting for that at our website.
So we want to know, Is there any possible solution to avoid this or atleast can we diffrentiate between the user for whom payment failed and who intentionally moved to
our website back without doing payment because this way we are not only unable to followup with them but also loosing a part of the customer base, interested in our service.
Any help in this is Appreciated.
Thanks
You should implement the Pay Pal IPN (Instant Payment Notification).
You configure the IPN url address on your PayPal merchant account settings. This page is simple HTML page with server-side programming that is listening for requests coming from PayPal.
There's no need to do something extra in the checkout process for making IPN work. Once you set this up, it will automatically work.
Every time something happens with a transaction in your merchant account, e.g. transaction completed/failed/canceled, PayPal will send an HTTP Post to your IPN listener URL.
Here you can get all the relevant information about the transaction, like the payer ID, the payment status. With this information you can decide what to do with your customer's order.