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.

  • Bjørn Fridal 274 posts 784 karma points
    Feb 14, 2011 @ 14:42
    Bjørn Fridal
    0

    Trouble getting to payment page

    Hi,

    This is my first time working with uCommerce. I have it installed, created products, delivery and payment methods. Now I have created a User Control where the customer will select product, enter address (the payment method is always the same - DIBS) and then proceed to the payment page.

    My problem is that I am never transfered to the payment page. My code runs without errors and to the end of the file.

    Here is the code. If anyone has a hint or can sheed some light over the problem I would greatly appreciate it:

     1: // get product catalogue and product
    2:
    ProductCatalog pc = ProductCatalog.SingleOrDefault(d => d.Name.ToLower() == catalogue.ToLower());
    3: Product p = Product.SingleOrDefault(d => d.Sku.ToLower() == product.ToLower());
    4: if (pc == null || p == null) {
    5: return;
    6: }
    7:
    8:
    9: // clear basket and add the product
    10:
    Library.ClearBasket();
    11: Library.AddToBasket(pc.Name, 1, p.Sku, rblVariants.SelectedValue, false);
    12: Library.ExecuteBasketPipeline();
    13:
    14:
    15: // add address
    16:
    Country country = Country.SingleOrDefault(c => c.Name.Equals("Denmark"));
    17: if (country == null) {
    18: return;
    19: }
    20: Library.EditBillingInformation("firstname", "lastname", "[email protected]", "phone", "cellphone", "company", "address1", "address2", "zipcode", "city", "state", "note", country.CountryId);
    21: Library.EditOrderAddress("LeveringsFri", "firstname", "lastname", "[email protected]", "phone", "cellphone", "company", "address1", "address2", "zipcode", "city", "state", "note", country.CountryId);
    22:
    23:
    24: // choose payment method
    25:
    PaymentMethod dibs = PaymentMethod.SingleOrDefault(pm => pm.PaymentMethodServiceName.Equals("dibs") && pm.Enabled);
    26: if (dibs == null) {
    27: return;
    28: }
    29: Library.CreatePayment(dibs.PaymentMethodId, -1, true, true);
    30: Library.ExecuteBasketPipeline();
    31:
    32:
    33: // checkout
    34:
    Library.Checkout();

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 14, 2011 @ 14:43
    Søren Spelling Lund
    0

    Have you checked whether the dibs variable ever contains a value?

  • Bjørn Fridal 274 posts 784 karma points
    Feb 14, 2011 @ 14:45
    Bjørn Fridal
    0

    Hi Søren,

    It does. The code runs without problems to the Library.Checkout(); call.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 15, 2011 @ 13:00
    Søren Spelling Lund
    0

    Hi Bjørn,

    You'll want to remove code after the call to create payment.

    Basically uCommerce will redirect the customer to the payment gateway, which will handle the rest of the transaction. We decided to not interrupt page processing, so the redir happens once the rest of the page is processed. If for some reason the code redirects somewhere else you'll never be redirected to the payment gateway.

  • Bjørn Fridal 274 posts 784 karma points
    Feb 15, 2011 @ 13:13
    Bjørn Fridal
    0

    Hi Søren,

    I have just tried that, but its the same result.

    Is it possible to somehow look at order and see if something is missing?

    Also its a Developer version I am currently using. I don't know if that will have any impact on the above code?

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 15, 2011 @ 13:47
    Søren Spelling Lund
    0

    Developer Edition shouldn't affect you, but you can check umbracoLog for any errors.

  • Bjørn Fridal 274 posts 784 karma points
    Feb 15, 2011 @ 13:57
    Bjørn Fridal
    0

    The only message (besides installation messages) logged is "The uCommerce license file is either empty or missing."

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 15, 2011 @ 14:52
    Søren Spelling Lund
    0

    This is a silly question, but I have to ask: Did you follow the instructions on setting it up, i.e. set up the service in the backend?

    Setup uCommerce to Include DIBS as a Payment method

  • Bjørn Fridal 274 posts 784 karma points
    Feb 15, 2011 @ 15:19
    Bjørn Fridal
    0

    Silly questions are welcome too : )

    I have followed the instructions on adding the DIBS payment method and I can fetch that payment method via the API. I haven't selected a Pipeline for it though, should I?

    Only thing I found going through the DIBS instructions again, was that one of my keys has a @ in it. I am not quite sure what that should be replaced with.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 15, 2011 @ 15:33
    Søren Spelling Lund
    0

    Looks like there's an error in the documentation. It should actually say & not @ :)

    Could I ask you to zip the site and database and e-mail it to me at soren ATT ucommerce DOT dk so I can take a closer look?

    Thanks.

  • Bjørn Fridal 274 posts 784 karma points
    Feb 15, 2011 @ 15:40
    Bjørn Fridal
    0

    Thanks. I'll do that if I haven't made any progress by tomorrow.

Please Sign in or register to post replies

Write your reply to:

Draft