Use paypal Express checkout in minimum steps using nvp in asp.net - paypal

I want to use paypal express checkout in my application in minimum steps
like:
click on paypal button-> verify account on paypal-> back with token to my application ->
confirm the payment->successful msg ->credited into my account(user not redirect to paypal) only get success message on application
currently paypal confirm the payment of user in paypal site but i want it to my application
and user only once redirect to paypal site for account verification rest all process done in to my backhand side of asp.net application

I guess that's the way Paypal works.And where is a call to getExpressCheckoutDetails.
If you want paypal shipping details on your webpage you need to make call to this method.
It will return you shipping detail and then create a button for say "Pay" and call doExpressCheckout method of PaypalAPI to complete your transaction :D

You can try this as a starting point: https://paypal-labs.com/integrationwizard/ecpaypal/main.php (SSL is expired or invalid so you'll have to add security exception, but it works)

Related

paypal express checkout notify url without api

I have a situation I am unable to fine the answer. I am using Paypal Express checkout method by simple form method not api . when user/buyer reaches the paypal payment page and after successful payment it give user/buyer two button option ( your paypal account ) - ( return to site) If user returns to site good enough get all the transaction details but incase he does not there is no way to capture the transaction result. Is there a return url that can be specified in the html express checkout method also does it require the seller to enable Ipin in his account or is it enable by default .
My issue is its a thirdparty application where seller adds his paypal account to accept payment but one successful payment it needs to return the website . issue cant ask seller to enable any specific things to his paypal account as if he does or does not there is no way for me to verify while he sets up the account to my service or platform .
You need to be using Instant Payment Notification (IPN) to handle that instead of Payment Data Transfer (PDT). They're essentially the same thing except that PDT only works on the return URL (which isn't guaranteed to get hit as you're finding out) and IPN will be triggered in the background regardless of whether or not the buyer makes it back to your return URL.
You can include the "notify_url" parameter in your HTML form code to pass the URL you'd like the IPN's to get sent to. This will override any setting the merchant might have setup in their own PayPal account.

Paypal PhP api security issue

I was trying to use the express checkout php api. Everything is working well in the sandbox environment. My question is regarding security.
After payment the sample code redirects to GetExpressCheckout.php?token=...$PayerID=.....; But after clicking "confirm payment" in my site and logging in to paypal account (did not confirm payment in paypal); I directly opened the same page in another tab, and it showed payment successful (which is not the case). Is there a way to prevent this or am I missing some thing.
I'm not following exactly what you're trying to say here.
The process needs to be...
1) Call SetExpressCheckout to retrieve your token and redirect to PayPal accordingly.
2) PayPal will return the user back to your ReturnURL if they confirm payment, at which point you can call GetExpressCheckoutDetails (optionally) and DoExpressCheckoutPayment to finalize the payment.
Not until DECP is completed does any transaction actually take place. The success message you're seeing probably came from GetExpressCheckoutDetails, which does nothing more than retrieve the buyer/order info so that you can finalize the payment on your site.

Paypal shipment details

I am using PayPal Adaptive payments (chained payments).
If I set:
1. CREATE payment
2. In the SetPaymentOptions -> Requires shipping address selection = true
3. When I redirect user for the https://www.sandbox.paypal.com/webscr&cmd=_ap-payment&paykey=[PA KEY] user after authentication is not shown any prompt for shipping address
why?
Accordingly to the
https://www.x.com/developers/paypal/documentation-tools/api/pay-api-operation
when using CREATE I should do: CREATE – Use this option to set up the payment instructions with SetPaymentOptions and then execute the payment at a later time with the ExecutePayment.
But as soon as I try to run ExecutePayment I get the following information:
This payment request must be authorized by the sender
How can I set additional payment options then?
The ExecutePayment call would only be used if you're utilizing delayed chained payments. Otherwise, the payment still happens as soon as the buyer logs in and approves it, so there is no need for ExecutePayment. Calling it at that point results in the error you're getting, that the paykey was already used.
Did the sender actually authorize the payment?
The flow should be like:
Call Pay API operation with actionType as CREATE
If paymentExecStatus=CREATED and ack=SUCCESS, obtain payKey (here, keep detailLevel=ReturnAll in RequestEnvelope field of your Pay API request)
Redirect user to Paypal https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey=YOUR_PAYKEY_ABOVE
If user approves payment, you will be redirected to your returnURL sent as a part of Pay API request
Verify approval status using PaymentDetails API operation
Later you can execute the payment thus setup in step 4 using ExecutePayment API operation. Send the same payKey you obtained in step 2.
You have got error code 550001 since the user approval seems to be not yet done successfully. It may be due to:
The application did not redirect user/sender to Paypal for authorization
OR
The user did not enter correct login details
OR
There were not sufficient funds available
etc.

Getting Paypal to do an immediate redirect?

When the PayPal transaction is complete, PayPal shows this:
Thanks for your order
Your payment of $XXXX.XX USD is complete.
You're now going back to MYSITE.
If you are not redirected within 10 seconds, click here.
I don't want the client to even see this page. Is there any way to either avoid it completely, or set the redirect time to 0?
You will also need a Website Payments Pro subscription for that.
https://www.paypal.com/webapps/mpp/website-payments-pro
Once you have it, get the API signature, API username & API password from the My Profile area of your paypal account.
Then, use the Direct Payment method as described in the following manual
https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_WPP_IntegrationGuide.pdf
As mentioned by Watermark, you might need to review PCI requirements and at least have SSL on your site before you can do this.
Check out https://developer.paypal.com/. You can build your own interface using PayPal's API. The user will never know that PayPal handled the transaction.
Be sure to review PCI-DSS requirements when using this approach.
What you ask is achievable with PayPal Payments Standard, but the seller account receiving the payment needs to be a PayPal Business/Premier account (a free upgrade), and they need to enable Auto Return and provide a Return URL in their PayPal account > Profile > Profile & Settings > My Selling Tools > Website Preferences.
You can also pass a return URL variable to checkout for each order, which would override any Return URL (or lack thereof) in the seller's PayPal account profile; however, if Auto Return is not also enabled in the seller's account, the buyer would need to click past the end of checkout manually in order to be redirected to that URL.

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.