Do you mean displaying the payment capture fields on your site vs redirecting? or, just handling transactions in the background and skipping the payment detail collection process entirely?
Sure it's possible. You can create a payment provider that rather than redirecting to a 3rd party instead redirects you to a page on your site and on that page run whatever code you need to in order to setup the payment. Then you can redirect to Vendr's continue URL to continue once payment is successful.
Depending on how your payment gateway finalized orders (either at the point of detail capture / via webhook) you'll want to use the payment providers callback handler for this. If a webhook handler, it'll be like all other providers that use webhooks, but if it's instant, you'll either need to communicate back to it yourself (probably over a JS AJAX request) or enable FinalizeOnContinue and pass some kind of token through to the continue URL to handle this.
Thanks for that - on the page on our site, is it possible to fire off the callback url instead? As the ProcessCallback we previously wrote for the shared page is working well.
Also, how can we lookup the callback variable from the payment gateway page we have created on the site? In the GenerateForm function call I can't seem to figure out how to either add this as a property to the order or just save it in a session variable.
The callback url does seem to be formed using currentOrder.Id / currentOrder.OrderNumber / random number - is it possible to lookup this last random number?
Custom API Payment Gateway
Is it possible to create a custom payment gateway that handles transactions in the background without redirecting through a shared payment page?
Ideally, we don't want to bounce the user off to the payment gateway.
If so, are there any basic examples of this in Github?
Thanks so much, Warren
Hey Warren,
Do you mean displaying the payment capture fields on your site vs redirecting? or, just handling transactions in the background and skipping the payment detail collection process entirely?
Matt
Yes, displaying the credit card input fields on the site as part of the checkout process. Cheers
Hey Warren,
Sure it's possible. You can create a payment provider that rather than redirecting to a 3rd party instead redirects you to a page on your site and on that page run whatever code you need to in order to setup the payment. Then you can redirect to Vendr's continue URL to continue once payment is successful.
Depending on how your payment gateway finalized orders (either at the point of detail capture / via webhook) you'll want to use the payment providers callback handler for this. If a webhook handler, it'll be like all other providers that use webhooks, but if it's instant, you'll either need to communicate back to it yourself (probably over a JS AJAX request) or enable
FinalizeOnContinue
and pass some kind of token through to the continue URL to handle this.See this post regarding
FinalizeOnContinue
https://our.umbraco.com/packages/website-utilities/vendr/vendr-support/108325-using-the-callback-url-and-other-urls-in-a-paymentprovider#comment-336471Hope this helps
Matt
Thanks for that - on the page on our site, is it possible to fire off the callback url instead? As the ProcessCallback we previously wrote for the shared page is working well.
Also, how can we lookup the callback variable from the payment gateway page we have created on the site? In the GenerateForm function call I can't seem to figure out how to either add this as a property to the order or just save it in a session variable.
The callback url does seem to be formed using currentOrder.Id / currentOrder.OrderNumber / random number - is it possible to lookup this last random number?
Thanks again.
Sure, Id' probably pass it down to the generated form as potentially a data attribute.
I'm not quite sure what you mean in terms of "lookup the callback variable"?
Ignore that, as I think I was going mad last night - as for passing it down to the generated form, how can I do that?
Thank you
Hey Warren,
Use the
WithAttribute
of the form result to pass a data attribute to render on the form (See the stripe provider for an example where it sets an onsubmit attribute https://github.com/vendrhub/vendr-payment-provider-stripe/blob/v2/dev/src/Vendr.PaymentProviders.Stripe/StripeCheckoutPaymentProvider.cs#L315)Hope this helps
Matt
is working on a reply...