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.

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Jan 10, 2013 @ 13:03
    Matt Brailsford
    0

    Order number series: "Default Payment Reference" does not exist.

    Hey Guys,

    I'm trying to test a custom payment provider, however when I try to call:

    TransactionLibrary.CreatePayment(newPaymentMethodId, requestPayment: false);

    I get a YSOD

    Order number series: "Default Payment Reference" does not exist.

    Now, the exception is true, it doesn't exist, but equaly, nothin references it, so I don't even know why it's looking for it? The catalog is told use a custom numbering series, so I don't know why it isn't just getting that.

    Any thoughts?

    Matt

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Jan 10, 2013 @ 13:03
    Matt Brailsford
    0

    PS If I process payments using the default payment process, the order goes through ok

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Jan 10, 2013 @ 13:23
    Matt Brailsford
    100

    Ok, a little digging, and it seems the ExternalPaymentMethodService which my payment provider inherits from is hard coded to use "Default Payment Reference" to grab an order number if one isn't set in the method GetReferenceId.

    Looks like it's virtual though, so I was able to override it with the following:

    protected override string GetReferenceId(PaymentRequest paymentRequest)
    {
        return string.IsNullOrEmpty(paymentRequest.PurchaseOrder.OrderNumber) ? new CheckoutService().GetOrderNumber(paymentRequest.PurchaseOrder.ProductCatalogGroup.OrderNumberSerie.Name) : paymentRequest.PurchaseOrder.OrderNumber;
    }

    Might be worth one of the uCommerce guys updating it in the base class though?

    Matt

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jan 14, 2013 @ 09:44
    Søren Spelling Lund
    0

    Hi Matt,

    we use the payment reference counter to make sure that we send unique values to the payment gateways if the same order needs to pass through the payment gateway twice.

    If a customer were to initiate payment with the gateway, then cancel payment, return to the web site, and later try payment again the payment gateway would fail because the same order number would be passed in twice. That's why we're using the payment reference and also assign an order number after payment is accepted with the gateway.

    You've got a valid point about the default payment reference counter though. The default providers shouldn't fail just because it's deleted.

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Jan 14, 2013 @ 09:47
    Matt Brailsford
    0

    Hi Soren,

    Would my fix be suitable then? It should be getting the number serie from the current site, so it should still abide by the rules you laid out, it's just grabing the number serie from the cart setup.

    Matt

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jan 14, 2013 @ 10:02
    Søren Spelling Lund
    0

    If you're recreating the payment on each request you'll be fine.

    You may want to consider whether the store manager is happy with order numbers skipping a beat from time to time. There are no accounting requirements for them to be sequential so you can pretty much do whatever you want.

    If you're doing invoicing with uCommerce remember to keep the invoice numbers sequential.

    Hope this helps.

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Jan 14, 2013 @ 10:06
    Matt Brailsford
    0

    I'm not sure how you mean order numbers would skip a beat? This is the same code as standard, the only thing I've done is made it choose the numbering serie based upon the current cart, as this provider will be used in a multi site config, and I want different number serie per site.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jan 21, 2013 @ 21:40
    Søren Spelling Lund
    0

    If the order number is assigned prior to redirecting to the gateway you'd have to reassign a new order number if the customer cancels the first payment attempt on the gateway, returns to the store, and then takes another pass with the payment gateway. It won't happen often, but it will happen.

    This all assumes that the gateway requires unique order numbers. If that's not the case you won't have to reassign order number and you don't have to worry about broken order number series.

Please Sign in or register to post replies

Write your reply to:

Draft