ReynierPM
ReynierPM

Reputation: 18680

Understanding PayPal Express Checkout flow

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.

  1. Pick "Express Checkout PayPal"
  2. Setup parameters by setting: PHP as language, return_url as Return URL, cancel_url as Cancel URL and leave the rest as they are
  3. 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
  4. Review the code in "Step 3. Add PayPal to your billing page (payment option)" and download the code to integrate later in my application
  5. Review the code in "Step 4. Order Review - get shipping address from PayPal" and download the code to integrate later in my application
  6. 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,

  1. What did I miss in the process?
  2. Should I add a billing step, an order review and an order confirmation step to my payment flow?
  3. Why does SetExpressCheckout guide me through PayPal directly and not through the wizard?

Upvotes: 1

Views: 697

Answers (2)

Ind_KevinG
Ind_KevinG

Reputation: 1945

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.

Upvotes: 2

Vimalnath
Vimalnath

Reputation: 6463

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

Upvotes: 0

Related Questions