Understanding PayPal Express Checkout flow - php

I'm trying to use PP Express Checkout Flow on my website to sell items through PayPal and I use this wizard, but I have some doubts around the process itself. I'll explain what I did and then ask for doubts.
Pick "Express Checkout PayPal"
Setup parameters by setting: PHP as language, return_url as Return URL, cancel_url as Cancel URL and leave the rest as they are
Then in "Step 2. Add PayPal to your shopping cart page" the wizard generates two files "expresscheckout.php" and "paypalfunctions.php" I did what they said there about download files and setup the rest like API Username and API Password among others
Review the code in "Step 3. Add PayPal to your billing page (payment option)" and download the code to integrate later in my application
Review the code in "Step 4. Order Review - get shipping address from PayPal" and download the code to integrate later in my application
Review the code in "Step 5. Order Confirmation - confirm payment from PayPal" and download the code to integrate later in my application
Now in expresscheckout.php they call the method CallShortcutExpressCheckout() which call inside SetExpressCheckout. With just that piece of code and without doing anything with code from point 4, 5 and 6 step the application redirects to PayPal and aparently did something in Sandbox but when I call the method GetExpressCheckoutDetails() I get PaymentActionNotInitiated in CHECKOUTSTATUS so transaction wasn't made. Then,
What did I miss in the process?
Should I add a billing step, an order review and an order confirmation step to my payment flow?
Why does SetExpressCheckout guide me through PayPal directly and not through the wizard?

This page has a diagram that may help you visualize how the flow was intended to work: https://developer.paypal.com/docs/classic/express-checkout/gs_expresscheckout/ it illustrates 3 API calls, the SetExpressCheckout is called to set up the transaction and define the URL to which the customer is returned after the customer authorizes payment. The GetExpressCheckoutDetails call to get customer shipping info so you can calculate tax and shipping information to display to customer for final approval. Then, DoExpressCheckoutPayment is called to complete the transaction.

Basically, after the setexprescheckout you need to do DoExpressCheckout in order to complete the payment.

Related

Can I create PayPal shopping cart for different vendor

I have items and vendors table each vendors have different items to sell and all the vendors have their own email and password for login. I want to create shopping cart with PayPal when the user want to buy something they will click buy and it will add it to paypal shopping cart and then when they process to payment the money will go to the vendor. I'm not really sure how to start or is this good idea or not any suggestion?
Based on the info provided I would recommend using the Express Checkout API. Specifically, you'll be using:
SetExpressCheckout
GetExpressCheckoutDetails
DoExpressCheckoutPayment
In the SEC and DECP request you'll use the PAYMENTINFO_n_SELLERPAYPALACCOUNTID parameter to specify the account the money should go to.
Using this method you will use your own API credentials in the API calls, and you will not need to worry about setting up permissions or anything for the vendors.
Since you're working with PHP I'd recommend using this PayPal PHP SDK. It will make the API calls very quick and easy for you.

PHP SDK Adaptative Payment How to set Quantity if not embed

We use Paypal PHP SDK adaptative payment service to process payments in our site as we receive the payment, take a commission and send the remaining to the listing owner.
We got the PayRequest and the SetPaymentOptions working. The problem is the ReceiverOptions InvoiceData accordingly with the documentation only work with embed pay flow.
So how am I supposed to pass quantity to be paid if I am not using embed pay flow but I need adaptative payment because of the commission we take?

Paypal getting option payment through credit card(PHP)

Hi i am getting two options while integrating the paypal with my PHP code
1. Pay via paypal
2. Create a paypal account
Whereas i Need an option Of
Payment through Debit/Credit Card
How can i get that,,
i reffer to thisThis Link But unable to find the paypal profile and more options option, Can anyone help me
The only way to force Guest Checkout (which is what PayPal calls it when somebody uses a credit card from their checkout pages without signing in to a PayPal account) is to use the Express Checkout APIs.
This will allow you to set parameters that provide the Guest Checkout experience in all instances where it's available. Keep in mind that even with this configured correctly, Guest Checkout is simply not available for all buyers in all countries, so you still won't get it for 100% of your customers if you're selling world wide.
Guest Checkout is available in PayPal Standard Payments, too, but it's cookie based, so it's very unreliable. If the browser in use has ever had anybody sign in to a PayPal account then it will assume the current user will be signing in, too, and it will not prominently display the Guest Checkout option. This is what you are able to avoid by using the Express Checkout APIs.
This PayPal PHP SDK will make the Express Checkout calls very quick and easy for you. Specifically, you'll be working with:
SetExpressCheckout
GetExpressCheckoutDetails
DoExpressCheckoutPayment
In your SetExpressCheckout request you'll make sure to include the follow parameters:
SOLUTIONTYPE=Sole
LANDINGPAGE=Billing
USERSELECTEDFUNDINGSOURCE=CreditCard
This will ensure that the user sees the Guest Checkout experience.
Direct processing of Credit Cards is deprecated.
But people can pay without PayPal account - it's called guest payments.
Use the PayPal API and allow the optimal checkout to YES and then customers can pay either through credit card / paypal account.
https://developer.paypal.com/docs/integration/direct/payments/guest-payments/#

PayPal Express Checkout shipping calculation

I have designed a store using PayPal Express Checkout. They have recently decided that they want separate shipping rates for local and international orders. I am currently pulling all shipping information from PayPal. Is it possible to send the total to PayPal AFTER receiving the buyer's shipping information?
What you want is the PayPal Instant Update / Callback API.
This is a callback from PayPal to your website to prepopulate shipping options on the PayPal website while the buyer is doing the checkout on PayPal.
It allows you to specify the specific shipping cost for the transaction after the SetExpressCheckout API has already been called.
How the Express Checkout flow would work with Instant Update / Callback implemented:
See "Setting up the Callback" on https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECInstantUpdateAPI for detailed instructions.
This page also includes an example API call and an example response for the callback; the response your callback file should return.
Let me know if anything is not clear and I'll try to hunt for some example files.
Note: In Live mode, the callback URL on your site must be SSL-secured (HTTPS). In Sandbox you can use both HTTP and HTTPS.
You can send, in the DoExpressCheckoutPayment request, a final payment amount of up to 115% of the original amount of the payment you specified in the SetExpressCheckout request.
I don't have access to paypal at the moment, but you can setup shipping in the merchant services section of paypal (I get confused as to where it is). If it is not there you can check under My Profile, My selling tools and under shipping in there.
There you should be able to setup shipping through paypal.
If you don't want to do it through paypal, you need to bring the customer back to your webpage where they can confirm the shipping and do the paying there. Sorry for the non answer, hope this leads you the right direction.

Paypal integration on website

My need: I want users to click on button and goes to paypal, where they can login or add the credit card details and payment should be get done. In short, I don't want to store credit card info on my website.
I found 'Express Checkout' is a suitable paypal method for the same. Am I right?
Does this method requires return urls on https only or can work with simple urls?
Can anyone help me with tutorial or something for the same?
Thanks for all of your support.
Here is an excellent PHP Class for PayPal IPN I've used countless times, which doesn't require user registration: http://www.micahcarrick.com/php-paypal-ipn-integration-class.html
Incidentally, IPN lets you set a return URL via PayPal, though with that class you can send a return URL to IPN before the user pays.
If you want a tutorial or more help though you'll need to tell us which language you're using.
The easiest and most flexible solution that comes without a monthly fee, and is available globally, is PayPal Express Checkout. Express Checkout does not require a https return/cancel URL.
Here is how it works:
Express Checkout is based on three API calls; SetExpressCheckout, GetExpressCheckoutDetails and DoExpressCheckoutPayment.
SetExpressCheckout sets up the payment and returns a token.
You redirect the buyer to https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=TOKEN-HERE, where TOKEN-HERE is the token you received earlier
After the buyer has agreed to the payment, he is returned back to your site.
You can call GetExpressCheckoutDetails and supply the token as a parameter to get the PAYERID of the buyer.
Call DoExpressCheckoutPayment with the token and PAYERID supplied to finalize the payment
Note: If you want to force the 'card details' screen to be displayed initially, and allow buyers to pay without having a PayPal account, ensure you're setting SOLUTIONTYPE to 'Sole' and LANDINGPAGE to 'Billing' in your SetExpressCheckout API request.
In addition, the 'PayPal Account Optional' setting must be switched to 'On' inside the Payment Receiving Preferences of your PayPal Profile.
You can find additional documentation for Express Checkout at https://www.x.com/community/ppx/documentation#ec as well as the SDK's and sample code at https://www.x.com/community/ppx/sdks#NVP

Categories