Copied to clipboard

Flag this post as spam?

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


  • stefanie27 13 posts 71 karma points
    Sep 12, 2022 @ 01:39
    stefanie27
    0

    Vendr Payment Provider - Capture payment without Webhook

    We're using Vendr for a while and implemented PayPal Advanced (including Credit card form) as PaymentProvider. All is working as expected, but we would like to avoid finalising payment via webhooks as it creates a few issues for us.

    Is there an option to call ProcessCallbackAsync within the payment step when user clicks Confirm button?

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Sep 12, 2022 @ 07:31
    Matt Brailsford
    0

    Hi Stefanie,

    You'll have to check the PayPal API docs and see if they have a method of informing you of successful transaction as part of the redirect (some older payment providers do this) but it's a pretty common pattern to use webhooks these days as it's the most reliable way of information your system of successfull transaction.

    The problem with handling it via the confirmation redirect is that it's entirely possible for a customer to pay and just close the window before they are redirected back and so this would prevent the order finalizing, where as a webhook solution will always fire in the background and will notify you even if they close the window.

    As I say, it may be possible via PayPals API buy you'll likely need to implement your own payment provider to make it worl that way.

    Hope this helps

    Matt

  • stefanie27 13 posts 71 karma points
    Sep 12, 2022 @ 08:01
    stefanie27
    0

    Hi Matt,

    Thanks for your response.

    We're using PayPal Advanced, which isn't redirecting to PayPal page, but open a popup for PayPal or render credit card form on the page. The second part is very similar to other payment gateways like Braintree, Stripe etc.

    This means there's no redirect involved here, but a front end call to indicate that the client side payment interaction was successful.

    The reason we want to avoid webhooks is twofold.

    1) In some cases finalised date/time (in Vendr) doesn't match the payment confirmation date/time in PayPal and could be across two days if transaction just happens before midnight and webhook confirmation happens after midnight. This causes the daily payment reconcilation between website and PayPal to fail.

    2) The webhook calls for i.e. PAYMENT.CAPTURE.COMPLETED happen multiple times for same payment transaction. This causes some internal issues with a third party service, if timing in unfortunate.

    I understand webhooks make it possible to streamline payment code for multiple providers, but in our case, we would like to avoid them if possible.

    Regards, Stefanie.

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Sep 12, 2022 @ 08:46
    Matt Brailsford
    0

    Hi Stefanie,

    Ok, so if this is all custom already, you could probably have your own client side code that is notified once the payment window is closed to call Vendr's continue URL (the one that is passed in the payment method context object) passing a flag that indicates payment was successful.

    If you then configure your payment provider to have its "FinalizeAsContinue" property set to true then when you redirect to the continue URL it will also call the ProcessCallback method where you can finalize the order there and then.

    If you check the flow chart on this page https://vendr.net/docs/core/2.1.0/umbraco-v9/key-concepts/payment-providers/ you can see how having finalize on continue affects the flow. The whole purpose of that flag is for scenarios where you want to finalize as you continue (ie, no webhook) so that should hopefully be what you need.

    Hope this helps

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft