• Welcome to KonaKart Community Forum. Please login or sign up.
 

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - sputnikgota

1
Thanks for the quick reply and that makes sense.

We'll change the implementation accordingly and will let you know.

We're happy to send you the link when done! it should be around the end of Feb ~ Mar.

Thanks again.

Go



2
Hi,

We've been working on the Konakart integration with OpenCMS using the web service and having some issues in changing order details.

Our user story:

- create a cart for a customer by calling getTempCustomerId, addToBasket, getBasketItemsPerCustomer, removeFromBask etc.
- check if the customer exists upon checkout by calling doesCustomerExistForEmail
- if the email exists, let the customer log in, otherwise collect the customer info required for CustomerRegistration
- in both ways, call createAndSaveOrder to create an order
- provide billing details page to edit the billing address and save it by editCustomerAddress
- provide delivery details page to edit the delivery address and save it by changeDeliveryAddress
- provide order item summary to verify the order by getOrder
- provide the payment page to edit the payment details
- when the above is completed, process the payment transaction by using our payment module API (external from Konakart)
- change the order status according to the transaction by calling changeOrderStatus(

The issue is

- provide delivery details page to edit the delivery address and save it by changeDeliveryAddress

returns the order object with the correct delivery address specified but this is not saved in the database

My understanding is that once an order is created by createAndSaveOrder, there is no way to modify the order object since there is no editOrder in the service and all what we can change are the delivery address and the order status by calling changeDeliveryAddress and changeOrderStatus.

changeOrderStatus does the job fine but changeDeliveryAddress doesn't.


Could you please let us know if this is a bug or my usage is wrong.


The following is my test case which passes but the data is not saved (konaKartService is our interface to encapsulate KK Web service):

    @Test
    public void testChangeDeliveryAddress() {
        System.out.println("testChangeDeliveryAddress - start");
        try {
            Integer customerId = konaKartService.getTempCustomerId();

            assertNotNull(customerId);
           
            Basket[] baskets = createBasketsByCustomerId(customerId);
           
            String sessionId = konaKartService.login(email, password);
           
            System.out.println("testChangeDeliveryAddress sessionId=" + sessionId);

            assertNotNull(sessionId);
            assertTrue(konaKartService.checkSession(sessionId));
           
            //order
            Order order = konaKartService.createAndSaveOrder(email, password, baskets);

            assertNotNull(order);
            assertNotNull(order.getId());

            Address address = konaKartService.createAddress();
            address.setFirstName("Hirok");
            address.setLastName("Got");
            address.setStreetAddress("112 Hoddel st");
            address.setCity("Abbotsford");
            address.setSuburb("Abbotsford");
            address.setPostcode("3067");
           
            Zone[] zones = konaKartService.getZonesPerCountry();
            address.setState(zones[3].getZoneName());
           
            Order orderRetrieved = konaKartService.changeDeliveryAddress(sessionId, order, address);
           
            assertEquals(order.getId(), orderRetrieved.getId());

            System.out.println("testChangeDeliveryAddress order.getId()=" + order.getId());
           
            assertEquals(orderRetrieved.getDeliveryStreetAddress(), address.getStreetAddress());
           
        }catch (Exception e) {
            System.out.println("testCreateAndSaveOrder4ExistingCustomer exception! konakartService.getKKWSEngIf())=" + konaKartService.getKKWSEngIf());
            e.printStackTrace();
            assertTrue(false);
        }
    }