Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Oct 02, 2018 @ 16:42
    Shaishav Karnani from digitallymedia.com
    0

    We have made a payment via PayPal and order is successfully processed but on thank you page we are not getting OrderID.

    var FinalisedOrder = TC.GetCurrentFinalizedOrder(StoreId); @Model.FinalisedOrder.OrderNumber

    Please can you suggest how can we get this value to state transaction is completed.

    Attached is settings of the PayPal too. Looking forward to it.

    enter image description here enter image description here enter image description here enter image description here enter image description here

  • Rune Grønkjær 1371 posts 3102 karma points
    Oct 03, 2018 @ 08:39
    Rune Grønkjær
    0

    Hi Shaishav,

    Sounds like PayPal isn't fast enough with it's confirmation answer. It happens async. PayPal is slower to answer than other payment providers and you can easily get to the confirmation page without an actual confirmation from PayPal.

    The process goes like this: * user is sent to paypal and completes the payment * Paypal starts it's checks and sends user back to webshop. At this point Tea Commerce moves the order to finalized in the session. That's why you have can GetCurrentFinalizedOrder * Paypal calls webshop with a confirmation. NOW the order is actually finalized and gets it's OrderId. This is also when the confirmation e-mail will be triggered.

    This means you should show a different message to the user if the payment method i paypal and there's no order id.

    /Rune

  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Oct 03, 2018 @ 09:20
    Shaishav Karnani from digitallymedia.com
    0

    Hi Rune,

    Many Thanks. I can understand now.

    Is their no way to get order ID so that user has something to refer back?

    Cheers, Shaishav

  • Rune Grønkjær 1371 posts 3102 karma points
    Oct 03, 2018 @ 10:52
    Rune Grønkjær
    0

    No, there will be no order ID before PayPal answers back. In theory other the payment could still be cancelled by Paypal and then there won't be an order at all. Paypal is really bad at that compared to all other payment gateways.

    They will get the order id when the confirmation e-mail is sent to them.

  • Tor Langlo 189 posts 532 karma points
    Oct 03, 2018 @ 23:56
    Tor Langlo
    0

    So your order may appear to be finalized and your user is shown the confirmation page. Then, a little later (for unknown reasons) Paypal cancels/fails the order.

    1) The user has been "mislead". How do we avoid this (not showing the confirmation page until Paypal confirms a successful transaction)?

    2) How does Paypal communicate back to our site/and code? On success? On cancel/fail? (asking to understand how things work)

    -Tor

  • Rune Grønkjær 1371 posts 3102 karma points
    Oct 04, 2018 @ 05:53
    Rune Grønkjær
    0

    Hi Tor,

    You don't use Paypal. Or you don't promise the user that the order is completely confirmed. It will be when he or she recieves the confirmation e-mail. You will get an event when the order is finalized, so you could also let the user wait for the confirmation at fetch a status from the server with regular intervals.

    It's a real issue with Paypal. Most of the other payment gateways handle this much smarter.

    /Rune

  • Tor Langlo 189 posts 532 karma points
    Oct 04, 2018 @ 15:46
    Tor Langlo
    0

    Staying on the payment page and polling the server for updates is probably the way to go. Then when you receive the callback/webhook confirming a successful transaction, you go to the confirmation page (or show a confirmation message on the payment page). Stripe's demo site is doing this.

    When paying with iDEAL (Netherlands) you are redirected to the customer's bank for payment. If the customer then cancels, we should not send them to the confirmation page, and instead return to the original page. We won't know what action the customer takes until we receive the webhook after some delay. So the issue is not just with Paypal.

    What's the recommended workflow for handling this scenario (staying on payment page/polling) in TeaCommerce? By workflow I mean which url's to use and which TeaCommerce Javascript/server side calls to use?

    I think I know how to do this for my code, but it will be with my own ajax calls, etc. combined with using TeaCommerce's API.

    -Tor

  • Rune Grønkjær 1371 posts 3102 karma points
    Oct 05, 2018 @ 06:47
    Rune Grønkjær
    1

    I think GetCurrentFinalizedOrder would be the way to go. You can call it using the JavaScript API and check for the change you need.

    /Rune

  • Tor Langlo 189 posts 532 karma points
    Oct 05, 2018 @ 07:08
    Tor Langlo
    0

    You mean to make this call in the polling process to get the status of the order?

    -Tor

  • Rune Grønkjær 1371 posts 3102 karma points
    Oct 05, 2018 @ 07:52
    Rune Grønkjær
    0

    Yes. Exacly. If you wan't more information than that you can make your own controller and get information from various sources including from the current finalized order. Then send it all back to the UI in one go.

    /Rune

  • Tor Langlo 189 posts 532 karma points
    Oct 05, 2018 @ 19:01
    Tor Langlo
    0

    Cool! Where do I find the server-side source for GetCurrentFinalizedOrder? I'm thinking of the Controller action method or similar. I might want to use the same coding pattern in my own code.

  • Rune Grønkjær 1371 posts 3102 karma points
    Oct 08, 2018 @ 09:08
  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Oct 03, 2018 @ 11:25
    Shaishav Karnani from digitallymedia.com
    0

    Make Sense - Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft