Copied to clipboard

Flag this post as spam?

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


  • Sam Gooch 24 posts 116 karma points
    Mar 09, 2021 @ 15:44
    Sam Gooch
    0

    Zero Value payment with Gift Card

    I have a CustomZeroValuePaymentProvider which inherits from ZeroValuePaymentProvider.

    I've noticed since upgrading to v1.5.2, all orders using a gift card, now makes this payment provider error.

    Looking at what returns from the ProcessCallback method, the amount authorized isn't 0.00 as expected. It's the total value of the order. Manually intervening and setting it to 0.00 stops the order from erroring.

    Is this a bug?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Mar 09, 2021 @ 15:50
    Matt Brailsford
    0

    Good spot.

    This does look like it's a bug as we seem to have forgotten to update this post 1.4.0 when we introduced the TransactionAmount property.

    Given you are overriding the default ZaroValuePaymentProvider you can probably override the ProcessCallback method with the following implementation as a workaround:

    public override CallbackResult ProcessCallback(OrderReadOnly order, HttpRequestBase request, ZeroValuePaymentProviderSettings settings)
    {
        return new CallbackResult
        {
            TransactionInfo = new TransactionInfo
            {
                AmountAuthorized = order.TransactionAmount.Value,
                TransactionFee = 0m,
                TransactionId = Guid.NewGuid().ToString("N"),
                PaymentStatus = PaymentStatus.Captured
            }
        };
    }
    

    I'll report this on the issue tracker though and get an update pushed out soon.

    Thanks for reporting this 👍

    Matt

    UPDATE: Issue has been raised here https://github.com/vendrhub/vendr/issues/281

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Mar 18, 2021 @ 09:54
    Matt Brailsford
    0

    Just to let you know, I released Vendr 1.5.2 yesterday with this fix in so this should all be sorted now 👍

Please Sign in or register to post replies

Write your reply to:

Draft