I'm currently integrating the Paypal Express Checkout gateway in one of my website.
I'm using the .NET Paypal SDK (NUGET/Visual Studio 2013). I read Paypal's documentation and followed their guidelines and examples. I was able to get it working (after a little trial and error). But, the thing is, i'm not sure that my flow of operation is optimal. Let me explain the flow:
1) Customer logs in to the website
2) Customer chooses a Monthly plan to advertise on our website and click the paypal button (API CALL: SetExpressCheckout).
3) Customer is redirected to Paypal login page. Enter credentials and logs in.
4) Customer (still on Paypal page) reviews buying informations and clicks 'Continue' button (or Cancel link)
5) Customer is redirected to a Confirmation/Success Callback page on my website (API CALL on pageLoad event: GetExpressCheckoutDetails).
6) Customer (still in Confirmation Callback page) clicks an 'Accept transaction' button (or a cancel button). (API CALL: DoExpressCheckout)
7) Payment is processed and Paypal sends last payment details (status Completed, Pending, etc) to my Instant Payment Notification Callback URL on my website.
Now, the thing is, i've recently bought a digital album on Bandcamp and their flow was different at one part and more concise, and well, more 'express' than mine:
1) Customer clicks Name you price link. A modal opens.
2) Customer enters the amount and clicks the 'Checkout now' button.
3) Customer is redirected to Paypal login page. Enter credentials and logs in.
4) Customer (still on Paypal page) reviews buying informations and clicks 'PAY' button (or Cancel link)
5) Customer is redirected to a Confirmation/Success Callback page Bandcamp website. Payment is already processed and nothing more is asked of the customer.
So the question is how do change the 'Continue' button on Paypal to a 'Pay' button?
I can't seem to find my way on Google to answer this question, nor do i see this flow in my documentation?...
Note that these are both digital goods and no shipping is required.
Thank you!
When redirecting to PayPal add useraction=commit to the URL:
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&useraction=commit&token=<TOKEN>
or
https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&useraction=commit&token=<TOKEN>
A similar question was asked just a few days ago: Here If you want a more detailed answer you are going to have to post the part of your code where you redirect users to PayPal.
Related
Expected behvior:
Just like a registered user, a guest user is also expected to come back to order details page or checkout completed (if enable) page after a successful payment.
Actual behavior:
However, the guest user when "guest checkout is enabled" won't bring back user to the order details or checkout completed page. It's taking user back to home page.
Location:
What I noticed is that the "InsertGuestCustomer" from CustomerService is getting called after redirect.
Same behavior on below browsers:
1. Chrome
2. Firefox
3. IE
Steps to reproduce:
Enable any plugin that does URL redirect.
Enable one-page-checkout
Enable guest checkout
Start adding items to cart
Checkout using OPC page
Confirm and wait for PG to redirect back to site.
I am facing this on both localhost and hosted site.
Note: I am running SSL on localhost & using RemotePost to submit form to payment gateway.
I start to working with the Facebook graph API and I have question:
I make Facebook Authentication, so after user approve my application I got accessToken and the facebookUserID. note: The accessToken is expire after One hour(!!!).
Then, in another webpage "index.html", I want to show all the users who approved the application with their full name and profile picture taken from Facebook.
Now I don't understand.. if someone will enter the "index.html" page to see list of users who accepted the application - 5(!!) month after their authentication, when i will make the HTTP call to get thier fullname and profile picture, the accessToken is now expire(a lot time before) so the HTTP call will not succeed.
The last option is to save the full name just in the One hour between user accept the application and before the accesstoken expiration. but if the user will change his name sometime... I don't have the updated Name!
if its important - I'm usind the javascriptSDK with asp.net project.
Please help me to understand how to solve this situation.
It would appear that it is not possible to generate a long-lived token with the JS SDK directly, you will have to involve the server side, see this page for details.
I have setup a Personal and Business account using Paypal Sandbox. When I run a test purchase for, for example,$309539.24, in Business account balance and $4740.01 in Personal account balance. when i m purchase any thing purchasing process is running successfully. but no amount deduct and add in personal sandbox account and business sandbox account. paypal sandbox profile is successfully created.
Did you check the transaction history for both the accounts(i.e the Seller and the Buyer)?
Is the transaction/ purchase showing up there?
This is how you create sandbox accounts for testing.
Go to https://www.sandbox.paypal.com/
Login to your account.
Under 'Sandbox', click on 'Test Accounts'
For creating a new test account, you have two options:
1) Preconfigured
2) Create Manually
Click on 'Preconfigured'. Fill in the details, and hit on 'Create Account'
Follow the same steps to create the 2nd account.
Best practise is to name one account as 'seller' and the other as 'buyer'
This will avoid any confusion
Creating buttons and making purchases:
Click on Seller's account. Enter the password and login.
Go to 'Merchant Services' tab to create the product/button for Seller.
NOTE:For some reason, clicking on the 'Merchant Services' logs you out of that account.
Probably some issue with the PayPal's Sandbox site.
The alternative to this is to go to 'My Account' => click on Profile => Selling Preferences => My Saved Buttons => Create new button
After you finish entering the details of the product, click on 'Create Button'
You will get the HTML snippet. Paste this in a notepad file, and save it with the '.html' extension.
Open the file in the browser, click on the button to purchase the product.
Click on CheckOut with PayPal. Login with Buyer's account, and complete the purchase.
This will affect the account balances of both the Seller and the Buyer.
And you will be able to see the transaction in both the Seller and Buyers Account(Under 'Overview' or 'History')
Hope it helps you out.
Thank you.
I am making a website where we are going to host events and would like a user "USER A" to be able to start an event - enter their paypal account info and set a price. Then other users can register for their event and pay USER A directly, with out us having to process their credit card. We would like users that do not have paypal accounts to be able to pay with a credit card.
It looks like Paypal's Adaptive Payment is the best API for us to use to accomplish this. I have it working in the sandbox environment. My problem is this - a user clicks to register for USER A's event , then they enter all their info (name, address, company, ect.) we need to keep this info in our Database so this needs to be done first. Then they will click on a button that says "Pay with Paypal". This creates a paykey and redirects the user to the Paypal login page where the user has 2 options (a. login paypal or b. enter personal info again and credit card information)
I want to know how I can accomplish having all the fields already filled out in the Paypal page , so the user does not have to enter all of their information again. They will be able to delete data in the text boxes if the billing address happens to be different. But all websites I have ever seen to not make the user enter this information twice if they are identical. Now I know this is possible because I have seen other sites do it. I have looked into SetPaymentOptions API , but it is not very clear how that works , and I need user information to be passed even if they are not known to Paypal already.
I tried adding values as suggested in Paypal tutorials like this
<INPUT TYPE="hidden" NAME="first_name" VALUE="John">
<INPUT TYPE="hidden" NAME="last_name" VALUE="Doe">
<INPUT TYPE="hidden" NAME="address1" VALUE="9 Elm Street">
but that didn't work, Here is the raw data from Fiddler from the request :
POST https://svcs.sandbox.paypal.com/AdaptivePayments/Pay HTTP/1.1
Content-Type: text/xml;charset=utf-8
X-PAYPAL-SECURITY-USERID: scotts_XXXXXXXXX_biz_api1.live.com
X-PAYPAL-SECURITY-PASSWORD: 1344XXXXX
X-PAYPAL-SECURITY-SIGNATURE: AOLbPDojAEUdeQJ3wXagJXkxYeJDARg4IXXXXXXXXXXXXXXXXXXX
X-PAYPAL-SERVICE-VERSION: 1.1.0
X-PAYPAL-APPLICATION-ID: APP-80W2844XXXXXXXXX
X-PAYPAL-REQUEST-DATA-FORMAT: XML
X-PAYPAL-RESPONSE-DATA-FORMAT: XML
Host: svcs.sandbox.paypal.com
Content-Length: 810
Expect: 100-continue
Connection: Keep-Alive
I think for you the problem is not really the login to paypal in a popup, but the paypal registration process to be able to pay with the credit card. There is an api call in the adaptive payment api that allow you to process a registration on the behalf of a user.
You can directly prefil paypal informations on a page using your own design. On submit you create a paypal account using adaptive payment api, and the last step of this process will need you to open a paypal popup which will ask the user to complete his registration by adding a password and credit card information.
After this point you will find back the same payment behavior you have using the simple paypal login.
Please note to even more integrate all your website through paypal you can add preapproval, then the user will only see the paypal website once: when he will accept the preapproval (two steps in a light paypal popup: login > accept).
When the user checkout the first time:
Select between Create an account (using the way I explained above) or Pay with paypal
Create a preapproval key (see the doc on the api, you don't need to know the user paypal login), as returnUrl, specify a url with the local user_id
Open a paypal popup client side using the url returned by the previous step. The user will need to login with his paypal account and then accept the characteristics of your preapproval (limit in time, limit in money)
Paypal will redirect to the returnUrl of step2, it can be a page when you just say "This window will close automaticaly" with a js to close the page
You can now use the preapproval key to make payments on the behalf of the user
When the user checkout after the first time:
Ask for a confirmation "$XX will be taken on your linked paypal
account"
Pay using the preapproval key, and it's done!
Hope it will help!
Offical Response from PayPal:
" Adaptive Payments does not have any feature in the documents which does this. I apologize for the inconvenience this might cause."
I will leave this question open though in case someone has a better route for me to go to accomplish what I have explained in the question.
EDIT:
Incase someone else comes across this , it is offically 100% not possible - I ended up using Express Payment API , using this it is very easy to pass user parameters.
Dont use Adaptive Payment API
Adaptive payments was discontinued as of 01/12/2017 and PayPal Marketplace is the equivalent to adaptive payments.
You can learn more about the Marketplaces product on the PayPal Developer Portal: https://developer.paypal.com/docs/marketplaces/pp4mp/?mark=marketplaces
hello I think following link will help to you
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_APIntro
I am trying to integrate paypal gateway in my aspx page having shopping cart. I succeed to commit transaction using express checkout method generated by paypal integration wizard but what I am being unable to do is sending product quantity and details to paypal page.
And how can I redirect to my own review page where shipping and billing address is present after log in into the paypal?
how can i redirect to my own review page where shipping and billing address
First you need to send a unique number id for the order that is connected to your database with the information that you like to show after the purchase.
Then you send the "return" parametre with the full url with the unique id of your order that your customer will return and you need to show the final informations.
eg:
<input type="hidden" name="return" value="https://www.urls.con/orderinfos.aspx?TID=112999182">
of cource for better protection is good to encode some how your order id. All of that exist on the paypal sdk manual.
Also return url are the "notify_url" to be notify even if the user not return, and "cancel_return" in case of cancel the payment
You can also search for PDT for the return, and IPN for the notify for more advanced information.