Copied to clipboard

Flag this post as spam?

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

  • Ben McKean 272 posts 549 karma points
    Aug 02, 2016 @ 13:43
    Ben McKean

    PayPal - get invoice key in controller


    I'm using the build in PayPal payment gateway. I have two checkout flows in my site therefore I can't hardcode the return URL in the PayPal settings. I've set this to go to an Umbraco suface controller.

    I want to be able to get the invoice key so I can look this up in my controller and then pass it to my View.

    I can see that PayPal does return this information like this:


    and then performs a 302 redirect to the value of the Return URL field in Merchello's settings.

    Is there anyway to get these values or pass these onto my controller?



  • Ben McKean 272 posts 549 karma points
    Aug 03, 2016 @ 10:10
    Ben McKean

    For anybody who is interested I managed to get around this storing in the invoice key in ExtendedData before I redirect the user off to PayPal like so:


    I then retrieve on my view that I return the success to like :

    var invoiceKey = customerContext.GetValue("invoiceKey");

    Hope that helps somebody in the future

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Aug 03, 2016 @ 15:21
    Rusty Swayne

    Hey Ben,

    Yep - your basically storing the value in the encrypted Merchello cookie. That's a perfect use for it. This will also help with your receipt page.

  • Simon 692 posts 1068 karma points
    Nov 24, 2016 @ 12:21

    Hi Ben,

    On which view are setting that invoice key?

    Can you be more specific please?

    Kind Regards

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Nov 28, 2016 @ 18:35
Please Sign in or register to post replies

Write your reply to: