Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Quick one, if for some or other reason (third party providing payment gateway integration) we can't call this form
<button type="submit">Continue to Payment</button>
because we need to call a surface controller to do some stuff first then send off to third party.
How can we get the necessary things tied up in the surface controller that would have been taken care of by this call.
We not able to get order numbers and I am sure it is as a direct result of this.
I think there are two possibilities here, one is where you need to do something before a payment provider does it's normal thing, in which scenario the payment provider still want to render a payment form.
In this scenario, I think you might need to introduce a middle page such that on the final checkout screen you post back to your controller to do it's thing, then this renders a view that renders the Payment Form, but instead of rendering a button, you render some JS to auto submit the form (I have an example of this if you need it as this is essentially what we do on the Vendr.net site)
The second is where you are integrating your own provider that isn't fitting into the payment provider interface and so you are wanting to bypass the rendering of the payment form entirely and redirect straight from your controller.
In this case, we don't have the right method exposed yet, but there is a workaround. Essentially an order needs it's transaction initializing before being redirected to the gateway. This is normally done by the Payment Form renderer and as such is currently internal. We do have an open issue to expose this method for such occasions but we haven't managed to resolve it just yet. That said, there is a work around on the issue for calling the method via reflection https://github.com/vendrhub/vendr/issues/102
It's not ideal, but it might at least get you working and we'd love the feedback to see if this does the trick.
I hope this helps
Much appreciated will keep this I am sure it will come in handy again.
Sorry another one, busy today :)
So after updating to the latest version of vendr the reflection for initializing an order does not work any more.
It comes back as null.
Has the method name or something changed?
Yea, check the changelog, it got made public in 1.2.5 :)
Ah nice should have checked the log :D
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted