Copied to clipboard

Flag this post as spam?

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


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Daniel Howell 21 posts 42 karma points
    Nov 01, 2012 @ 04:57
    Daniel Howell
    0

    Process eWAY payment using on-site form (no redirect to eWAY).

    Hi there,

    I need to process an eWAY payment using a form on our website (it is not acceptable to redirect off to eWAY to process the payment). I have read Integrating with a Payment Gateway using External Payment Windows, which I believe is talking about how to do this, and it seems to say that I need to implement a RenderPage method, and call that instead of RequestPayment...

    I looked in the source for the EWayPaymentMethodService, and this is the RenderPage method:

    // UCommerce.Transactions.Payments.EWay.EWayPaymentMethodService
    public override string RenderPage(PaymentRequest paymentRequest)
    {
        throw new NotSupportedException("EWay does not need a local form. Use RequestPayment instead.");
    }

    Similarly, when I look at AcquirePaymentInternal (which I believe I would need to call), it ominously shows:

    // UCommerce.Transactions.Payments.EWay.EWayPaymentMethodService
    protected override bool AcquirePaymentInternal(Payment payment, out string status)
    {
        throw new NotImplementedException("Acquire not supported from EWay payment provider.");
    }

    What I want, is something similar to what is described in this article - Setup uCommerce to Include Braintree Payments as a Payment Method - which shows that you can call RenderPage as so: @Html.Raw(paymentWindow.RenderPage(new PaymentRequest(payment.PurchaseOrder, payment)))

    So is this possible to do with eWAY?

  • The eWAY Team 1 post 21 karma points
    Nov 02, 2012 @ 02:58
    The eWAY Team
    0

    Hi Daniel,

    This is definitely possible using Rapid 3.0. If you call eWAY support on 1800 10 65 65, they can help you set it up.

    Kind regards,

    The eWAY Team

  • Søren Spelling Lund 1797 posts 2786 karma points
    Nov 02, 2012 @ 09:59
    Søren Spelling Lund
    0

    Hi Daniel,

    Did you get it sorted with eWAY?

  • Daniel Howell 21 posts 42 karma points
    Nov 05, 2012 @ 01:39
    Daniel Howell
    0

    Well, I called them, and they explained that Rapid 3.0 is the way to post data off to eWAY - but that doesn't help me with the uCommerce side of things. My question is, if eWAY supports it, why wasn't it implemented in the EWayPaymentMethodService (which says eWAY doesn't support it)? Do I have to write a whole new payment method service (not a simple task by the looks of things) just to add this kind of functionality? If so, are there any other resources available other than this article?

     

  • Daniel Howell 21 posts 42 karma points
    Nov 09, 2012 @ 03:42
    Daniel Howell
    0

    Any help on this would be greatly appreciated. I think that the article I mentioned is not even relevant - so I have no idea where to go from here.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Nov 09, 2012 @ 11:55
    Søren Spelling Lund
    0

    We did our eWAY integration before the new eWAY APIs were introduced so the default integration supports only what was supported back then.

    All our default payment providers use the "hosted payment form" method for integration to reduce security requirements on your end, specifially avoiding PCI requiremnts for your server environment.

    What this means is that you're looking at building your own payment method service to support RAPID 3.0 and payment form local on your store.

    Fortunately doing the local payment form is a much simpler process than doing "hosted payment forms" so you really only need this information to do so: Integrating uCommerce with a Payment Provider

    You really only require RequestPayment as everything is done in a synchronous manner when you're integrating with the RAPID APIs in this way.

    You can add creditcard, cvc, expiration, etc. info to the payment request using the "AdditionalProperties" collection.

    Here's what the client bit would look like:

    // Get the amount to request
    var basket = SiteContext.Current.OrderContext.GetBasket().PurchaseOrder;
    var amountToRequest = new Money(basket.OrderTotal.Value, basket.BillingCurrency); 

    // Get the payment method and set up a new payment request
    var paymentMethod = PaymentMethod.SingleOrDefault(x => x.Name == "eWay Rapid");
    var paymentRequest = new PaymentRequest(purchaseOrder, paymentMethod, amountToRequest);

    // Get the service
    IPaymentMethodService ewayService = paymentMethod.GetPaymentMethodService();

    // Request payment with eWAY
    Payment payment = ewayService.RequestPayment(paymentRequest);

    // Check that it's OK
    var okPaymentStatus = PaymentStatus.Get((int)PaymentStatusCode.Authorized); 
    bool ok = payment.PaymentStatus == okPaymentStatus;

    Hope this helps.

  • Daniel Howell 21 posts 42 karma points
    Nov 13, 2012 @ 05:42
    Daniel Howell
    0

    Thanks Soren. That seems to make a lot more sense. Ill let you know how I go.

  • Ramon O. Navarro III 6 posts 26 karma points
    Nov 14, 2012 @ 10:00
    Ramon O. Navarro III
    0

    Hi Soren, I use eWay as a gateway. . I used the code above but i'v got an error only in this line:

    Payment payment = ewayService.RequestPayment(paymentRequest);

    the error is "Object reference not set to an instance of an object."

    can you please help me on this.


    Thank you.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Nov 19, 2012 @ 11:16
    Søren Spelling Lund
    0

    Hi Ramon,

    The code above is just an example. It requires a payment method to be set up called "eWAY Rapid".

    If you want to set up the standard eWAY provider please take a look at the docs at Setting up eWAY Australia.

    Hope this helps.

Please Sign in or register to post replies

Write your reply to:

Draft