Copied to clipboard

Flag this post as spam?

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


  • Paul Burns 16 posts 88 karma points
    Feb 08, 2016 @ 21:26
    Paul Burns
    0

    AuthorizePayment not working for Stripe Payment Provider

    Hey Rusty,

    I am at the final stages of the checkout and I am having a problem at the AuthorizePayment part. The error states:

    System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.

    This error occurs at this line:

    var attempt = preparation.AuthorizePayment(paymentGatewayMethod.PaymentMethod.Key);
    

    Here is a snippet of the code:

    var paymentGatewayMethod = MerchelloContext.Current.Gateways.Payment.GetPaymentGatewayMethods().FirstOrDefault();
    if (paymentGatewayMethod != null)
    {
                                //Save
                                preparation.SavePaymentMethod(paymentGatewayMethod.PaymentMethod);
    
                                var attempt = preparation.AuthorizePayment(paymentGatewayMethod.PaymentMethod.Key); //CUTS OUT HERE
    
                                if (attempt.Payment.Success)
                                {
    
                                }
                                else
                                {
    
                                }
                            }                    
                        }
    

    When I debug the code, it is definitely getting the Stripe Payment Provider that I am retrieving.

    I cannot find any similar error online. Any idea how this could happen? I obviously know what the out of bounds error is but I'm just wondering how it can happen on that line. It doesn't look like there's an array present.

    Also what exactly does AuthorizePayment do? What is AuthorizeCapturePayment?

    Any help at all would be great!!

    Thanks in advance!

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Feb 08, 2016 @ 21:37
    Rusty Swayne
    0

    Hey Paul,

    I did not write the Stripe provider. That was originally done by a New York agency named FlightPath.

    I think this is Alex's repository https://github.com/alindgren/MerchelloStripeProvider

    It may be that it just needs to have it's dependencies updated with current version of Umbraco and Merchello - both of which can be done via NuGet.

    If not, at least you'd be able to step through it =)

  • Paul Burns 16 posts 88 karma points
    Feb 08, 2016 @ 21:53
    Paul Burns
    0

    Wow, thanks for the super quick response! Ok, i'll try that! Thanks again Rusty!

  • Ben McKean 272 posts 549 karma points
    Aug 03, 2016 @ 10:20
    Ben McKean
    0

    Hi Paul

    What version of Merchello was this? I'm trying to use the Stripe provider with v 2.1 of Merchello but its no longer working

    Thanks

    Ben

Please Sign in or register to post replies

Write your reply to:

Draft