Copied to clipboard

Flag this post as spam?

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


  • Peter Hansen 29 posts 72 karma points
    Oct 07, 2018 @ 20:40
    Peter Hansen
    0

    Getting the redirect to PayPal work.

    Hi there, I'm pretty new to Tea. I had a friend creating an example website that includes the entire step-by-step and finally redirection to PayPal to finalize and check out the cart.

    The point was that I was about to build my own page (so that I also got to learn something) and basically use his website example as a baseline and go-to site if I needed help.

    I'm almost there. Infact I couldn't be any closer now - but I cannot figure out how to create the final confirm button that will redirect you to PayPal.

    I know it's all about the @Html.Raw(TC.GeneratePaymentForm() but when page is rendered the HTML-form is pretty much not as expected.

    My complete GeneratePaymentForm()-code goes as:

    @Html.Raw(TC.GeneratePaymentForm(store.Id, "<input type=\"submit\" class=\"btn btn-primary btn-block btn-xlg\" name=\"checkout-place-order\" id=\"checkout-place-order\" value=\"Place order\" data-value=\"Place order\">"))
    

    Am I doing it right? I get:

    <form action="" method="post">
    <input id="cmd" name="cmd" value="_s-xclick" type="hidden">
    <input id="encrypted" name="encrypted" value="" type="hidden">
    <input class="btn btn-primary btn-block btn-xlg" name="checkout-place-order" id="checkout-place-order" value="Place order" data-value="Place order" type="submit">
    </form>
    

    ... but was expecting (from my friends go-to page):

    <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
    <input id="cmd" name="cmd" value="_s-xclick" type="hidden"><input id="encrypted" name="encrypted" value="-----BEGIN PKCS7-----MIIJ2wYJBmD 
    [TRUNCATED]
    ==-----END PKCS7-----" type="hidden"><button type="submit" class="btn btn-success pull-right">Confirm and pay</button>
    </form>
    

    ...which is what my friends GeneratePaymentForm() returns.

    So my questions are:

    • What does it take to get GeneratePaymentForm() to render the correct HTML?
    • I've been looking into the umbraco log in the db but there's really nothing to look at. Last entry was 14 days ago - probably last time I had a look at this but no log entries regarding Tea. Just publish and save-entries. Should I be looking elsewhere?

    • I've setup the PayPal payment provider data exactly as my friends baseline page with exact same values.

    I've debugged during runtime and I can see that the order object is loaded with correct data like payment, delivery address, name, etc. Nothing is left out.

    Can anyone guide me into some sort of direction?

    -p

  • Rune Grønkjær 1372 posts 3103 karma points
    Oct 08, 2018 @ 09:17
    Rune Grønkjær
    0

    PayPal can be hard to work with. Have you checked out the step by step guide: https://docs.teacommerce.net/v3.0.0/docs/paypal

    /Rune

  • Peter Hansen 29 posts 72 karma points
    Oct 08, 2018 @ 15:28
    Peter Hansen
    0

    Hi Rune, And thanks for answering. Yeah! I've been through that guide. I've even copied settings from my friends umbraco website to my dev-site, yet no cigar, although his demo umbraco works very well with redirection to paypal. My friends umbraco site is running online so it's out there for everyone - but not using SSL or anything fancy. I don't know if that makes a difference but my dev site is running localhost.

    So to begin with I am very curious about how the HTML-form is generated in Tea. Is it only rendered correctly if the settings in the 'Payment provider' tab is 100% correct (like login, password, signature etc)? or am I missing another step? If so I can sort of rely on that my settings are not correct even though I copied them.

  • Peter Hansen 29 posts 72 karma points
    Oct 08, 2018 @ 18:08
    Peter Hansen
    0

    ...and btw PayPal changed their website long time ago... can you please update your guide to fit new PayPal-design. I cannot seem to find anyting mentioned in your guide anymore :)

  • Rune Grønkjær 1372 posts 3103 karma points
    Oct 09, 2018 @ 13:07
    Rune Grønkjær
    0

    Ah. I think your site must be online to be able to run a payment all the way through.

    Paypal cannot call your local domain.

    /Rune

  • Peter Hansen 29 posts 72 karma points
    Oct 17, 2018 @ 15:46
    Peter Hansen
    0

    Hi Rune, Sorry for not replying. I've had a small vacation. Anyways: the demo site (the online template my friend made) I've been using works very well, and I just managed to put my to be site online (so it's not running localhost anymore). Nothing really changed though. The <form> is still the same as before stated. I've checked settings in Tea > Stores > [my store] > Settings > Payment methods > PayPal, and they all match up with the working demo site.

    Any ideas?

  • Rune Grønkjær 1372 posts 3103 karma points
    Oct 22, 2018 @ 12:47
    Rune Grønkjær
    0

    Hi Peter,

    Can you describe the steps to the problem and when and how it fails? Maybe ask your friend how it should work :) Your version is clearly missing something if it does not work.

    /Rune

  • Peter Hansen 29 posts 72 karma points
    Jan 06, 2019 @ 19:42
    Peter Hansen
    0

    Hello Rune, I have had some really busy months at work and I decided to shelf most of my projects and gaming. For the better I hoped.

    Well. I thought that shelving it might bring a clear vision when I returned, but no cigar. I am still stuck. Meanwhile I've tried several things without luck. I know this is not how you would normally do stuff but is it possible to hand you a login and then go through the code. I am pretty sure it's a specific page that contains an error and I think I am pretty blinded. I've been looking at the same error for so much time now and I just can't figure out what I am doing wrong. Since last I've tried to built the page from scratch, I've tried to have a SurfaceController returning the entire HTML-form that the button is suppose to generate (still no cigar - the HTML-form is still almost empty).

    I'm getting desperate now, and it's so frustrating.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jan 06, 2019 @ 21:04
    Matt Brailsford
    0

    Hi Peter,

    Is the PayPal provider the only provider you have setup? Or do you have some other setup too?

Please Sign in or register to post replies

Write your reply to:

Draft