Copied to clipboard

Flag this post as spam?

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


  • Gordon Saxby 1315 posts 1555 karma points
    Jul 19, 2015 @ 10:30
    Gordon Saxby
    0

    Help with SagePay controller

    I am using Chris's version of the SagePay plugin (https://github.com/chris64digital/Merchello.Plugins.SagePay) and have got to the point where I have a button on the checkout confirm page.

    The problem is I am not sure what I need to do now. I have created a controller which inherits from BazaarPaymentMethodFormControllerBase. I assume I need to add code to this:

    protected override IPaymentResult PerformProcessPayment(SalePreparationBase preparation, IPaymentMethod paymentMethod)
    

    I am currently stuck on what that code should be :-(

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jul 19, 2015 @ 12:54
    Rusty Swayne
    0

    I blogged a bit about the Bazaar setup yesterday -http://uditty.com/articles/archive/merchello-bazaar-resolvable-payment-forms/

  • Biagio Paruolo 1477 posts 1616 karma points c-trib
    Jul 19, 2015 @ 15:24
    Biagio Paruolo
    0

    good

  • Gordon Saxby 1315 posts 1555 karma points
    Jul 19, 2015 @ 15:12
    Gordon Saxby
    0

    Yeah ... sorry, didn't really help :-(

    Although, it did make me wonder if my controller should be inheriting from SagePayPaymentGatewayMethodBase rather than BazaarPaymentMethodFormControllerBase?

    I am currently trying that but I'm not sure I'm right ...

  • Gordon Saxby 1315 posts 1555 karma points
    Jul 19, 2015 @ 18:05
    Gordon Saxby
    0

    Does a plugin need to be written with Bazaar integration built in?

  • Biagio Paruolo 1477 posts 1616 karma points c-trib
    Jul 20, 2015 @ 10:28
    Biagio Paruolo
    0

    No...Plugin is not dipendent from Bazaar.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jul 20, 2015 @ 21:07
    Rusty Swayne
    0

    @Biagio @Gordon

    The only exception to what @Biagio stated is if you are using the controller base that is defined in the Bazaar, you would need to take the Bazaar dll as a dependency.

  • Gordon Saxby 1315 posts 1555 karma points
    Jul 21, 2015 @ 20:06
    Gordon Saxby
    1

    It is now working, here are details of what I needed to do (I am using Merchello 1.9 and Bazaar with the SagePay version from Chris64

    Partial view (SagePayFormPaymentMethodForm.cshtml) in Bazaar theme:

    @using System.Web.Mvc.Html
    @using Umbraco.Web
    @using VintageFineArms.site.Controllers
    @inherits Umbraco.Web.Mvc.UmbracoViewPage<Merchello.Bazaar.Models.CheckoutConfirmationForm>
    
    <!-- SagePay Form Payment Method -->
    @using (Html.BeginUmbracoForm<SagePayPaymentMethodController>("ConfirmSale", null, new { @id = "ConfirmSale" }))
    {
        @Html.AntiForgeryToken()
        @Html.HiddenFor(x => x.ShipMethodKey, new { @class = "selected-shipmethod-key" })
        @Html.HiddenFor(x => x.PaymentMethodKey, new { @class = "selected-paymentmethod-key" })
        @Html.HiddenFor(x => x.CustomerToken, new { @id = "customer-token" })
        @Html.HiddenFor(x => x.ReceiptPageId)
        <div class="control-group">
            <button type="submit" class="btn btn-primary">SagePay</button>
        </div>
    }
    

    A payment gateway controller in my project (VintageFineArmsPaymentMethodController.cs). This is a modified version of the base controller in Bazaar:

    ///

    /// The bazaar payment method form controller base. /// public abstract class VintageFineArmsPaymentMethodController : PaymentMethodUiController
  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jul 21, 2015 @ 21:50
    Rusty Swayne
    0

    Awesome Gordon!

    It was super interesting for me to see how you and Barry did your implementations - and yes it did give me some ideas how to make payment methods that require a redirection easier for Bazaar implementations.

    I'll have a play at it.

Please Sign in or register to post replies

Write your reply to:

Draft