Copied to clipboard

Flag this post as spam?

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


  • Aaron Drinkwater 5 posts 75 karma points
    May 21, 2017 @ 16:19
    Aaron Drinkwater
    0

    I have a website which currently has the PayPal payment option, but I'd like to modify this to use PayPal Express instead so that the customer never leaves the website during the checkout flow. https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/

    PayPal Express handles the entire payment process through JavaScript and triggers a callback function which would allow me to redirect to the Payment Complete page once the payment has been authorized and executed.

    As everything is handled through JavaScript, TeaCommerce doesn't handle any callbacks from PayPal which means it can't know that the order has been finalized.

    Is there a way I can manually finalize the order in TeaCommerce, or is there a better way to go about this?

  • Anders Burla 2560 posts 8256 karma points
    May 30, 2017 @ 08:04
    Anders Burla
    0

    Hi Aaron

    The best way to make support for a payment gateway in Tea Commerce is to make a Payment Provider. That is where you can do server secure callbacks/finalize and handle all that logic. You would start by making the GenerateHtmlForm method and then work you way through to make a callback and do the security check there and then TC will finalize it.

    https://github.com/TeaCommerce/Payment-providers/tree/master/Source/TeaCommerce.PaymentProviders

    Let me know if you hit any walls.

    Kind regards

    Anders

  • Matt Taylor 873 posts 2086 karma points
    Jan 22, 2020 @ 10:37
    Matt Taylor
    0

    Has anyone got Tea Commerce working with PayPal Express yet?

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Jan 27, 2020 @ 09:28
    Matt Brailsford
    0

    Hey Matt,

    Not that I know of no. It probably won't be worked on by us to be honest, as it makes things a whole heap more complicated to implement and also puts the security related setup on your shoulders, which due to recent regulatory changes, specifically SCA in EU, is a responsibility we don't want to give people OOTB.

    From our perspective, the redirect model of the current provider makes it much simpler to integrate and much less for us to commit to maintaining (which when you consider how many payment providers we are supporting, each with their on way of doing things, is already a big commitment).

    Now, all this said, this is not to say it is not possible, so if you did want to go this approach yourself, you most certainly can. The best I could suggest would be to take a look at the Stripe payment provider to see how that one works as that is one of the only providers that works inline (and it's from here that we've learnt all the issues about doing inline payments). Hopefully between that and the PayPal provider itself you should be able to piece something together.

    Here are some links to the main things you'll need to look into.

    https://github.com/TeaCommerce/Tea-Commerce-Payment-Providers/tree/master/Source/TeaCommerce.PaymentProviders.Stripe

    https://github.com/TeaCommerce/Tea-Commerce-Payment-Providers/blob/master/Source/TeaCommerce.PaymentProviders.UI/Views/Partials/StripePaymentForm.cshtml

    https://github.com/TeaCommerce/Tea-Commerce-Payment-Providers/tree/master/Source/TeaCommerce.PaymentProviders.PayPal

    Hope this helps

    Matt

  • Matt Taylor 873 posts 2086 karma points
    Jan 28, 2020 @ 16:51
    Matt Taylor
    0

    Thanks for the update Matt.

    It's a shame that there's no PayPal Express solution especially as Tea Commerce is developed in the UK now (I believe) and PayPal is very common in the UK.

    It seems it would be mutually beneficial for both TC & PP.

    Cheers,

    Matt

  • Aaron Drinkwater 5 posts 75 karma points
    Jan 28, 2020 @ 19:46
    Aaron Drinkwater
    0

    Hi Matt,

    I did manage to implement a PayPal Express solution that (looking back) feels fairly hacky, but did and does work!

    I'll update later this evening with a link to some of the files in github, and feel free to tear it apart and make it work as you need it to :)

    Cheers, Aaron

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Jan 28, 2020 @ 20:24
    Matt Brailsford
    0

    That's awesome.

    Thanks for sharing Aaron 🙌

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Jan 28, 2020 @ 17:48
    Matt Brailsford
    0

    Hi Matt, we still have a perfectly working PayPal provider it’s just that it’s redirect based rather than inline.

    Ultimately I think the redirect approach is more robust, puts less demand on the implementer and is simpler to maintain so will overall suite most people. If anyone wants to go the extra mile to do inline PayPal Express then there is nothing stopping them as payment providers are completely pluggable, it’s just that it will have to be community contributed + maintained.

  • Matt Taylor 873 posts 2086 karma points
    Jan 29, 2020 @ 11:24
    Matt Taylor
    0

    I agree with what you say Matt regarding PayPal Standard working just fine.

    It's just that PayPal have been contacting those using Standard for a few years now and trying to get them to switch to Express.

    Perhaps they are trying to phase it out.

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Jan 29, 2020 @ 11:36
    Matt Brailsford
    0

    Hi Matt,

    Ahh, sure, then I understand your concern. Interesting that they are pushing you to Express though as I've been working on a Vendr payment provider recently for PayPal and all their docs seem to push you down their Checkout Smart Button implementation which is another inline solution.

    Regardless, they do still have a valid payment's API that work via redirects which is what we will be using in Vendr and should it come time to update the TC payment provider, will be what we back-port.

    I don't think they will be getting rid of the redirect approach completely though as it is necessary for specific environments.

    Matt

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Jan 28, 2020 @ 17:54
    Matt Brailsford
    0

    PS we get no assistance from payment gateways in creating our providers so whilst it would provide benefit for both parties, all the maintenance falls on us and when you are talking 20+ payment providers that’s a lot of responsibility so choosing the simpler, safer and most widely used implementations just makes most sense for us.

  • Aaron Drinkwater 5 posts 75 karma points
    Jan 28, 2020 @ 23:05
    Aaron Drinkwater
    1

    Hi Matt and Matt,

    Here is a link to my github containing my slightly modified implementation of PayPal Express: https://github.com/AzzA-D/TeaCommerce.PayPalExpress

    There's a few caveats mentioned in the readme.md but I hope this at least helps get you pointed in the right direction!

    Cheers, Aaron

  • Matt Taylor 873 posts 2086 karma points
    Jan 29, 2020 @ 11:28
    Matt Taylor
    0

    That's great Aaron, thanks.

Please Sign in or register to post replies

Write your reply to:

Draft