Magento SOAP V_2 creates an order error: no payment allowed

I am trying to create an order for Magento 1.7.2 using SOAP API V_2 using .NET consol.

I always get the same error "Payment is not allowerd" using each payment method.

//create an order with Magento API

        MagentoService proxy = new MagentoService();
        string sessionId = proxy.login("xxx", "xxx");
        int idCarrello = proxy.shoppingCartCreate(sessionId, "1");
        proxy.UnsafeAuthenticatedConnectionSharing = false;

        shoppingCartCustomerEntity clienteMagento = new shoppingCartCustomerEntity();

        clienteMagento.firstname = "name";
        clienteMagento.lastname = "surname";
        clienteMagento.email = "xxx@mmmm.com";
        clienteMagento.mode = "guest";

        proxy.shoppingCartCustomerSet(sessionId, idCarrello, clienteMagento, "1");

        shoppingCartCustomerAddressEntity indirizzoSpedizione = new shoppingCartCustomerAddressEntity();
        shoppingCartCustomerAddressEntity indirizzoBill = new shoppingCartCustomerAddressEntity();


        indirizzoSpedizione.mode = "shipping";
        indirizzoSpedizione.firstname = clienteMagento.firstname;
        indirizzoSpedizione.lastname = clienteMagento.lastname;
        indirizzoSpedizione.street = "viale europa 32";
        indirizzoSpedizione.city = "Foggia";

        indirizzoSpedizione.region = "FG";
        indirizzoSpedizione.telephone = "111";
        indirizzoSpedizione.postcode = "71122";
        indirizzoSpedizione.country_id = "IT";
        indirizzoSpedizione.is_default_billing = 0;
        indirizzoSpedizione.is_default_shipping = 0;

        indirizzoBill.mode = "billing";
        indirizzoBill.firstname = clienteMagento.firstname;
        indirizzoBill.lastname = clienteMagento.lastname;
        indirizzoBill.street = "viale europa 32";
        indirizzoBill.city = "Foggia";

        indirizzoBill.region = "FG";
        indirizzoBill.telephone = "111";
        indirizzoBill.postcode = "71122";
        indirizzoBill.country_id = "IT";
        indirizzoBill.is_default_billing = 0;
        indirizzoBill.is_default_shipping = 0;

        shoppingCartCustomerAddressEntity[] indirizzi = new shoppingCartCustomerAddressEntity[] { indirizzoSpedizione, indirizzoBill };

        proxy.shoppingCartCustomerAddresses(sessionId, idCarrello, indirizzi, "1");
        proxy.shoppingCartShippingMethod(sessionId, idCarrello, "flatrate_flatrate", "1");

        shoppingCartPaymentMethodResponseEntity[] paymentMethods = proxy.shoppingCartPaymentList(sessionId, idCarrello, "1");

        Console.WriteLine(paymentMethods); //paymentMethods is always empty!!

        shoppingCartPaymentMethodEntity modoPagamento = new shoppingCartPaymentMethodEntity();

        modoPagamento.po_number = null;
        modoPagamento.method = "checkmo";
        modoPagamento.cc_cid = null;
        modoPagamento.cc_owner = null;
        modoPagamento.cc_number = null;
        modoPagamento.cc_type = null;
        modoPagamento.cc_exp_year = null;
        modoPagamento.cc_exp_month = null;

        proxy.shoppingCartPaymentMethod(sessionId, idCarrello, modoPagamento, "1");

Here is the Exception:

         //Payment method is not allowed (I tryed checkmo, banktransfer, etc)
        //proxy.shoppingCartOrder(sessionId, idCarrello, "1", new string[] { });

Any idea?

+3
source share
1 answer

If this is due to a saeme problem. This decision - you have forgotten the product, just add the product to the sale. You should also do this in accordance with this order (it will not work in a different order):

shoppingCartCustomerSet(guest for simplicity);
shoppingCartCustomerAddresses();
shoppingCartProductAdd();
shoppingCartShippingMethod();
shoppingCartPaymentMethod();
+2
source

All Articles