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.

  • Jan Molbech 40 posts 126 karma points
    Apr 10, 2014 @ 11:59
    Jan Molbech
    0

    The steps needed to execute a call to my paymentprovider escapes me

    I need some help here with the next steps to take.

    1. I need to get a order number assigned to my order. I can see the basket in the backend but it hasn't been assigned a ordernumber yet? What to do?

    2. The customer is finished with adding items to their basket and navigates to the order summary page. The customer clicks the "pay" button. What should happen then? My paymentprovider wants me to make a javascript call with all the needed parameters to their payment gateway. I can do this but it escapes me what steps i need to take to interact with uCommerce at this point. What methods to call in what order?

    Byw i use EPay as my paymentprovider.

    Anyone?

     

     

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Apr 10, 2014 @ 12:10
    Nickolaj Lundgreen
    100

    Hi Jan

    There is a build-in EPay provider giving you all? the points you mention, out of the box.

    You need to configure the config files: http://www.publicvoid.dk/SetupUCommerceToIncludeEPayAsAPaymentMethod.aspx

    When that is done, you need to add the payment to the order and call UCommerce.Api.TransactionLibrary.CreatePayment(paymentMethod.Id, basket.OrderTotal.Value, true, true);

    This will make the payment request, and when the payment is cleared your checkout pipeline will get executed (adding a order number, and many other thing).

    Hope it makes sense :)

  • Jan Molbech 40 posts 126 karma points
    Apr 10, 2014 @ 12:38
    Jan Molbech
    0

    So that means i can't have a orderNumber before the payment has returned from the payment provider?

    I have configured the EPay.config as described.

    How do I add the payment to the order?

     

    Like this?

    var pMethod = PaymentMethod.SingleOrDefault(x => x.Name == "EPay");
    
    UCommerce.Api.TransactionLibrary.CreatePayment(pMethod.Id, basket.OrderTotal.Value, true, true);

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Apr 10, 2014 @ 12:58
    Nickolaj Lundgreen
    0

    You can call

    UCommerce.Api.TransactionLibrary.CreatePayment
    

    with "false" to Request payment.

    Also, uCommerce own RazorStore contains a lot of code examples: https://bitbucket.org/uCommerce/ucommerce-razor-store/src/cea5521ae294?at=default

  • Jan Molbech 40 posts 126 karma points
    Apr 11, 2014 @ 08:51
    Jan Molbech
    0

    What does the RequestPayment and OverwriteExisting parameters on the createPayment method do? How do I use them? Can seem to find documentation explaining this.

  • Morten Skjoldager 440 posts 1499 karma points
    Apr 11, 2014 @ 08:52
    Morten Skjoldager
    0

    Hi Jan.

    Why do you wan't an order number assigned when the user hasn't purchased anything yet? The checkout pipeline are ment to be run when the user has returned from the shop. It's basically then one converting the basket to an actual order. 

    If you only have one payment method allowed (EPay), then you could do it that way. Clicking the "pay" button should call the basketpipeline and requestpayment like so: 

            TransactionLibrary.ExecuteBasketPipeline();
        TransactionLibrary.RequestPayments();

    Please note that you need to have created the payment. Do it like Nickolai suggests. 

    If anything is missing uCommerce will fail fast and tell you :)

    Regards

    Morten

Please Sign in or register to post replies

Write your reply to:

Draft