Jump to content

Can't send "current_state" when creating order, it's always set to a value, 12, which I do not want.


Gerard G.

Recommended Posts

Greetings, Iam writing a mobile app using prestashop websevice.

 

I am able to createorders by doing the following:

 

-requesting orders/?scheme=blank

-filling all the required fields in the blank scheme

- sending POST request with the order

 

The orders are created successfully and are shown in the back office and the api.

However,they always get a state of 12 (payment approved) which is not right,because for this store that process has to be done manually.

 

      <current_state xlink:href="http://store.sofusd.com/api/order_states/12" notFilterable="true">12</current_state>

 

 

I am trying to set the state to other values before sending the order,

 

     newOrder=string.gsub(newOrder, "<current_state.-></current_state>", "<current_state>".. state .."</current_state>")

 

 

but the response to the POST reuest always contains no state

 

    <current_state xlink:href="http://store.sofusd.com/api/order_states/" notFilterable="true"></current_state>

 

(No matter what I send it continues showing a state of 12 in the back office)

 

 

 

I appreciate any help, thanks a lot.

 

 

Edit: I am able to change the current_state afterwards through a PUT request, however the user has already received an e-mail with the subject "Payment confirmed", so I still need to solve this.

Edited by Gerard G. (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 10 months later...
Hello.
 
do you found a solution? I have the same problem.
Thanks
 
 

Greetings, Iam writing a mobile app using prestashop websevice.

 

I am able to createorders by doing the following:

 

-requesting orders/?scheme=blank

-filling all the required fields in the blank scheme

- sending POST request with the order

 

The orders are created successfully and are shown in the back office and the api.

However,they always get a state of 12 (payment approved) which is not right,because for this store that process has to be done manually.

 

      <current_state xlink:href="http://store.sofusd.com/api/order_states/12" notFilterable="true">12</current_state>

 

 

I am trying to set the state to other values before sending the order,

 

     newOrder=string.gsub(newOrder, "<current_state.-></current_state>", "<current_state>".. state .."</current_state>")

 

 

but the response to the POST reuest always contains no state

 

    <current_state xlink:href="http://store.sofusd.com/api/order_states/" notFilterable="true"></current_state>

 

(No matter what I send it continues showing a state of 12 in the back office)

 

 

 

I appreciate any help, thanks a lot.

 

 

Edit: I am able to change the current_state afterwards through a PUT request, however the user has already received an e-mail with the subject "Payment confirmed", so I still need to solve this.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...