Copied to clipboard

Flag this post as spam?

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


  • Henry 21 posts 141 karma points
    Oct 07, 2016 @ 10:33
    Henry
    0

    FastTrack error on payment form

    Hi,

    Running Umbraco 7.5.3, Merchello and FT 2.2.1.

    I get right through the checkout process, but after hitting save on the "Cash" payment method I get:

     Cannot bind source type Merchello.FastTrack.Models.Payment.FastTrackPaymentModel to model type Umbraco.Web.Models.RenderModel. 
    

    Edit: Same thing happens with Paypal method.

    Thanks, Henry

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Oct 07, 2016 @ 15:34
    Rusty Swayne
    0

    Hi Henry,

    That looks like an error in the view.

    Your able to select the type of payment and then render the the respective payment form? Or do you mean, when you select the payment form you see this?

  • Henry 21 posts 141 karma points
    Oct 07, 2016 @ 15:38
    Henry
    0

    Hi Rusty,

    It's happening on the "/checkout/payment" page. So I am able to select the payment type, but when I click save it's throwing up the error.

    I haven't changed any of the view files so far so everything should be default FastTrack.

    Cheers!

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Oct 07, 2016 @ 15:46
    Rusty Swayne
    0

    In the back office, what view is the Payment page set to render? Also what is your models builder setting? LiveMode, Dll, ... ?

  • Henry 21 posts 141 karma points
    Oct 07, 2016 @ 15:50
    Henry
    0

    The payment page is set to the FtPayment template.

    Model Builder set to LiveDll.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Oct 07, 2016 @ 15:53
    Rusty Swayne
    0

    Your FtPayment view should have an inherits line like:

     @inherits Umbraco.Web.Mvc.UmbracoViewPage<Merchello.FastTrack.Models.Payment.FastTrackPaymentModel>
    
  • Henry 21 posts 141 karma points
    Oct 10, 2016 @ 11:00
    Henry
    0

    Hi Rusty,

    Views/FtPayment.cshtml:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{
        Layout = "ftFinalSaleSummary.cshtml";
    }
    
    @Html.Action("ResolvePayment", "CheckoutPaymentMethod", new { area = "FastTrack" })
    

    App_Plugins/FastTrack/Views/CheckoutPaymentMethod/ResolvePayment.cshtml

    @using System.Web.Mvc.Html
    @using Merchello.FastTrack.Ui
    @model Merchello.Core.Gateways.GatewayMethodUiAttribute
    @{
        switch (Model.Alias)
        {
            case "CashPaymentMethod":
                @Html.Action("PaymentForm", "CashPayment", new { area = "FastTrack" })
                break;
            case "BrainTree.StandardTransaction":
                @Html.Action("PaymentForm", "BraintreeStandardCc", new { area = "FastTrack" })
                break;
            case "BrainTree.PayPal.OneTime":
                @Html.Action("PaymentForm", "BraintreePayPal", new { area = "FastTrack" })
                break;
            case "PayPal.ExpressCheckout":
                @Html.Action("PaymentForm", "PayPalExpressPayment", new { area = "Merchello" })
                break;
        }
    }
    

    App_Plugins/FastTrack/Views/CashPayment/PaymentForm.cshtml

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<Merchello.FastTrack.Models.Payment.FastTrackPaymentModel>
    @using System.Web.Mvc.Html
    @using Merchello.FastTrack.Controllers.Payment
    @using Merchello.FastTrack.Ui
    @using Merchello.Web.Models.Ui
    @using Umbraco.Web
    @{
        Model.SuccessRedirectUrl = ExampleUiHelper.Content.GetReceipt().Url;
    }
    <h3>Cash Payment</h3>
    @using (Html.BeginUmbracoForm<CashPaymentController>("Process", new { area = "FastTrack" }))
    {
        <div>
            @Html.AntiForgeryToken()
            @Html.HiddenFor(x => x.SuccessRedirectUrl)
            <a href="@ExampleUiHelper.CheckoutWorkflow.GetPageForStage(CheckoutStage.PaymentMethod).Url" class="btn btn-default">Back</a>
            @Html.Partial("_RequireJsSubmitBtn", Model)
        </div>
    }
    

    Does that all seem correct to you? I've completely removed FastTrack and installed it again and it's throwing up the same error.

    Thanks for your help!

  • Henry 21 posts 141 karma points
    Oct 10, 2016 @ 12:09
    Henry
    0

    Moved the CashPayment views from App_Plugin/FastTrack directly into my views and that seems to have fixed it - so a solution I guess?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Oct 10, 2016 @ 14:57
    Rusty Swayne
    0

    I'll double check. That looks like a routing glitch somewhere - have not seen it myself, but I'll review again.

Please Sign in or register to post replies

Write your reply to:

Draft