I'm almost done creating a WorldPay payment provider plugin for an ecommerce site I'm building. However I've run into an issue that I'm now struggling to solve.
I created a WorldPay plugin project which has all necessary classes (i.e. provider, methods, controller, etc.). I have created a PaymentForm.cshtml
file to capture WorldPay customer details - This resides under FastTrack.UI
plugins folder.
In WorldPayCheckoutPaymentGatewayMethod
I added the attribute[GatewayMethodUi("WorldPay.WorldPayCheckout")]
to the class, and the same for WorldPayPaymentController
and WorldPayPaymentController.PaymentForm
method too.
The controller got the attribute [PluginController("MerchelloWorldPay")]
and in FastTrackUi I created the area MerchelloWorldPay. Under MerchelloWorldPay I have the necessary js files as well as dialogs folder and WorldPayment folder with PaymentForm.cshtml file.
In the Umbraco backend I have set up WorldPay as the desired payment gateway. Now, on the front end customers could select WorldPay as the payment method and click next to be redirected to the payment form page, which should display the paymentform.cshtml file of WorldPay payment form - The latter doesn't happen!
Note WorldPayPaymentController
inherits from CheckoutPaymentControllerBase
and WorldPayCheckoutPaymentGatewayMethod
inherits from RedirectPaymentMethodBase
And when I debug CheckoutPaymentMethodControllerBase.ResolvePayment
I get att = "WorldPay.WorldPayPayment"
just like I set it up for GatewayMethodUi
Can anyone advise?
I posted this on Umbraco Merchello forum last week but haven't got an answer yet.
Sorted. It maybe is obvious but it took me few days to figure it out. If you are building such plugin like me, in Merchello FastTrack.Ui project there is ResolvePayment.cshtml file which checks Alias property of GatewayMethodUiAttribute model in a switch statement - You will need to add your GatewayMethodUi alias there and link html.Action to your paymentform. Time for testing my worldpay plugin :)