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

problems about listing payment methods according the user address

Started by vpod, January 27, 2010, 10:24:01 pm

Previous topic - Next topic

vpod

I created a jsp page that allows selecting different payment methods. When the user changes his address the payment methods must be changed according to that.

I'm having troubles to make these works. When I change the address, the payment methods don't change. I made the following example. what am I making wrong?

<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="
java.util.*,
java.text.*,
java.lang.*,
com.konakart.ws.*,
com.konakart.wsapp.*,
com.konakart.app.*" %>


<%


KKWSEngIf eng = new KKWSEngIfServiceLocator().getKKWebServiceEng();


String sessionId = eng.login("konakartUserName", "konakartPassword");

Basket basket = new Basket();
basket.setProductId(30);
basket.setQuantity(1);

eng.addToBasket(sessionId, -1, basket);

Basket[] basketItems = eng.getBasketItemsPerCustomer(sessionId,-1,-1);

Order order = eng.createOrder(sessionId,basketItems,-1);

Address[] addresses = eng.getAddressesPerCustomer(sessionId);

Address address = addresses[0];

PaymentDetails[] metodosPago = eng.getPaymentGateways(order,-1);

%>
Payment methods From Argentina<p>
<%

for (int j=0; j< metodosPago.length;j++)
{
PaymentDetails mPago = metodosPago[j];
%>
<%=mPago.getDescription() %><br>
<%
}

address.setCountryName("Canada");
address.setState("Quebec");

order = eng.changeDeliveryAddress(sessionId,order,address);

metodosPago = eng.getPaymentGateways(order,-1);

%>
<p> Payment methods From Canada<p>
<%
for (int j=0; j< metodosPago.length;j++)
{
PaymentDetails mPago = metodosPago[j];
%>
<%=mPago.getDescription() %><br>
<%
}

%>

vpod

More information... perhaps someone can help me...

I debug the payment method when is invoked:

Inside the method "public PaymentDetails getPaymentDetails(Order order, PaymentInfo info)"

- order object:

deliveryCountry   = "Aruba"   
deliveryState   "test"   
deliveryZoneObject null   

- info object:
  deliveryGeoZoneArray = null   (I expected to be the geo_zone 7)

If a check inside the database the geo_zone_id=7:

SELECT
zone_country_id,
zone_id,
geo_zone_id,
countries_name
FROM
zones_to_geo_zones z,
countries c
where
z.geo_zone_id=7
and c.countries_id = z.zone_country_id


Result:


























zone_country_idzone_idgeo_zone_idcountries_name
1107Armenia
1207Aruba
3007Brazil


As final response I get on the log:

QuoteWARN  (?:getPaymentGatewaysPrivate:?) Called the getPaymentDetails method on module com.konakart.bl.modules.payment.westernunion.Westernunion. The module isn't available because of the following problem: The delivery address of the order is not within the GeoZone, id = 7


Clues?