Website Payment Pro Hosted Page Solution - paypal

I need to implement Website Payment Pro hosted page solution for my UK client.
After the discussion with the PayPal team and looking through the tech guide I did the following:
Call BMCreateButton API (end point url -https://api-3t.sandbox.paypal.com/nvp) to get the EMAILLINK
Redirect user to EMAILINK(securepayments.sandbox.paypal.com/webapps/HostedSoleSolutionApp/webflow/sparta/hostedSoleSolutionProcess?hosted_button_id=HSSS-jsCeH.xi9R3Q........) for the PP hosted page
User completes the payment at the hosted page
After the payment completion user is redirected back to my confirmation page.
In the response I only see 'tx' (TransactionId) and CSCMATCH(=M).
There is no PNREF or other status param which tells me if payment is 'AUTHORIZED', 'DECLINE' , 'CANCELLED' or any error message'.
I am comparing this solution with the payflow gateway hosted page solution (which is not available in UK) wherein i receive enough of the response params to make proper decision at my end after receiving the response.
Please advise.

PayPal's Website Payments Pro has ways for you to get this information, but they look very different from the Payflow product.
(The Payflow product was built by a different company that was later acquired by PayPal, which is why the two products look entirely different.)
The "PayPal way" to get this information is to use IPNs to securely verify the payment information. Some PayPal products also support PDT (https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/paymentdatatransfer/), which is basically the same as IPN except that you post to PayPal to get the verification rather than waiting for PayPal to post to you.
See also this integration guide, specifically chapter 7 "order processing", which explains how to do this:
https://www.paypalobjects.com/webstatic/en_GB/developer/docs/pdf/hostedsolution_uk.pdf
The separate round-trip to PayPal is to prevent someone from constructing a false transaction ID (and status information) and posting to your return URL to try to convince you they made a payment when they had not in fact done so.

Related

Paypal checkout for marketplace where buyer pays seller directly

I am running a marketplace for video games. When a buyer buys an item they can directly pay the seller through Paypal by setting the 'business' variable to the Paypal account of the seller in the link that will send the buyer over to Paypal to complete the purchase.
While this works most of the times, there are downsides to this approach as the website fully depends on receiving the IPN of the transaction. In very rare cases, Paypal fails to send the IPN (server logs show that there was no such request to the listener script – even hours later).
Is there a way to integrate a direct payment from buyer to seller where the website immediately gets feedback that the purchase has been completed (via JS-API or similar), so the website does not only depend on the IPNs?
I have seen a few similar questions on StackOverflow, but the solutions mentioned in answers have been deprecated as far as I can see (Adaptive Payments are no longer supported for new projects).
Integrate PayPal checkout with a server-side pattern. Here is the front-end UI: https://developer.paypal.com/demo/checkout/#/pattern/server , which will call two routes on your server.
Those routes will in turn call the PayPal API to 'Set Up Transaction and 'Capture Transaction', respectively: https://developer.paypal.com/docs/checkout/reference/server-integration/
The above has no dependency on asynchronous IPN or webhooks.
Since the buyer will be paying the seller and not your account, you can use the custom 'payee' object to specify this: https://developer.paypal.com/docs/checkout/integration-features/custom-payee/

paypal integration types confusion

I new to paypal integration in asp.net . I found very difficult to understand the paypal api .
I under stood two types -
inline html form ( i.e is also called buy button )
payflow api
my questions are :
which one must be used for recurring payment ( subcription packages for end user)?
in first type , few sites suggested to use IPN for confirmation of payment. I want to know is it neccessary since without using IPN, also using notify_url we can confirm the payment success (as per my knowledge notify_url returns to your site when payment is completed at paypal site)?
for recurring payment , do i need to store user account details (i.e credt card or paypal account ) in my databas?
please do reply with you suggestion .
Thanks
1) You can do it with both, actually. If you want to stick with basic HTML forms then you'd be using Payments Standard, and they call it "Subscriptions". You can easily create a Subscription button from within your PayPal account.
If you're using the API then they call it Recurring Payments (or Recurring Billing). You would use Express Checkout for the PayPal signups, and Payments Pro if you want to handle credit cards directly on your site without any redirect to PayPal.
IPN is useful regardless of what integration method you're using, however, don't get it confused with PDT. PDT sends data back to your site's thank you page, or whatever final page you setup for it, and it only works with Payments Standard. When PDT is configured on Payments Standard, even with Auto-Return enabled, there is no guarantee the user will make it back to your return URL. IPN is very similar, but data will always be POSTed to your IPN listener regardless of whether or not the user makes it back to your site.
You'll also want to use IPN to handle updates for future payments on a subscription / recurring profile. For example, the actual payments, cancelations, suspensions, reactivations, etc.
The notify_url parameter you mentioned is used for IPN. Again, though, this is separate from PDT. A common mistake I've seen many times is when people have their PDT and IPN both set to the same URL. Then when people do make it back to your thank you page, the code actually runs twice. Once from the user actually hitting it, and once again from PayPal's IPN server hitting it. So make sure to avoid that sort of thing.
3) No, you will never save credit card details to your server. The subscription / recurring system handles that using the data that PayPal saves on their servers.

Verifying paypal account

I am building website which requires customer to update paypal account.
Is there anyway to check the reality of customer's account?
When my customer fill out their paypal account in my site, I want them to be directed to paypal login page to login and paypal will return the result.
Does paypal api support this situation?
Pretty much any implementation of PayPal you choose would follow the flow you mentioned.
Payments Standard would allow you to create basic buttons or create an HTML form and POST directly to PayPal to process. It would send the user to PayPal for login and approval to complete the payment. The transaction details would include the payer status (verified or unverified) as well as the address status (confirmed or unconfirmed) and lots of other details about the order.
Express Checkout is basically the API version of Standard, but it's much more advanced and open to integrate in the way that works best for your site or application. In this case, some of buyer/transaction data is available during the process within your app through API requests and responses, and then you can also get to it via transaction details after the fact just like payments standard provides.
Another option would be to use Adaptive Payments, but if you're doing a general payment of any kind you probably don't need that. That's what you would use if/when you start wanting to split payments among multiple receivers within the same transaction, setup preapproval profiles, etc.
If you happen to be working with PHP my class library for PayPal will make the API calls very simple for you.
You could do what PayPal itself does when you register. Send them a few cents and have them tell you how many when they get it. The payment itself will fail if the account doesn't exist, and telling you how many cents proves that they own the account.

No shipping info with adaptive payments

I have been able to get a PayPal adaptive payments payment to work with a simple payment call.
But I want to get shipping details.
I have tried setting action type to create, then using the payKey returned sending a SetPaymentOptions call setting RequireShippingAddressSelection = True, then using the returned url from the payment call as before but still no shipping info.
I have seen others with this problem but without an answer.
Thanks
I have the same problem and here's what I got from PayPal Tech Support.
It is not possible for you to supply a shipping address as part of an
Adaptive Payments transaction. However, you can request that the
customer selects a shipping address from the addresses existing on
their PayPal account when they checkout using the embedded flow.
Details of the embedded flow are available here:
https://developer.paypal.com/webapps/developer/docs/classic/adaptive-payments/integration-guide/APIntro/
(Search for Embedded Payments)
If you think this is an option you would also be required to implement
another API call, SetPaymentOptions, which would be sent after the Pay
API request. Within the SetPaymentOptions API request you would add
the parameter requireShippingAddressSelection. Details of the
SetPaymentOptions API are located here:
https://developer.paypal.com/webapps/developer/docs/classic/api/adaptive-payments/SetPaymentOptions_API_Operation/
If your application requires that you supply a custom shipping address
to PayPal at the time of payment then you will need to consider using
Express Checkout instead of Adaptive Payments.
Are you sure the shipping info isn't passing? I don't think it's anything you'll see during the checkout process, but it will show up in the transaction details of the payment in your PayPal account.
I spent hours researching this and it appears to be an API bug from 2011 (great job PayPal!).
Unfortunately, you have to request the shipping info from the user before redirecting them to PayPal.
Source link

Checking if paypal payment was successful

I have downloaded sample code from paypal to allow me to use parallel payments via their sandbox accounts. When I run parallel.php, I get redirected to paypal's sandbox login page.
How am I supposed to know "server side" that the payment has been made successfully, so I can update my database records?
I believe you have to work with PayPals IPN system. This will basically send a confirmation to your server that tells you it has gone through.
https://www.paypal.com/ipn
Paypal lets you register a notification url which is part of the IPN (instant payment notification IIRC) system. So if someone pays by a delayed payment (such as a bank transfer) the transaction will update days later. You need to have an application (web page) on your server that can be called by Paypal with transaction details to update a payment.
You'll need to create an initial transaction record in your system when paypal redirects back to you so refer to their documentation for that. I'd also recommend looking at either OSCommerce or Zen cart for an idea of how they do it as they support the same kind of thing.