Create Order to Spree ecommerce using iOS app -


In my app, I want to order a product by the iPhone app in e-commerce Holi. I easily get the name of the products and their information, but when creating an order for the products, it returns an error in the HTML page:

  & lt; H1 & gt; Spree :: Api :: V1 :: Order Controller # and create & lt; / H1> & Lt; Pre & gt; Can not change symbol in integer & lt; / Pre & gt;   

I post I am sending request:

  NSString * str = [NSString stringWithFormat: @ "http: // localhost: 3000 / api / order" ]; NSURL * urlForBuy = [NSURL URL with strings: [unstar Stringbaaedingprsent Skepasuping Encoding Anstif 8 string encoding]]; ASIFormDataRequest * Request = [ASIFormDataRequest requestWithURL: urlForBuy]; NSString * idVariant = [NSString stringWithFormat: @ "command [line_items] [% d] [variant_id]", 0]; NSString * qnty = [NSString stringWithFormat: @ "order [line_items] [% d] [volume]", 0]; NSString * idVariantValue = @ "" 123456 "; [request Setpost value: [NSString stringWithFormat: @"% d ", [idVariantValue intValue]] forKey: idVariant]; [request Setpost value: [NSString stringWithFormat: @"% d ", 1] forKey: qnty]; [Request Setpost Value: @ "& lt; My administrator token & gt; "forKey: @" token "] [request Security Law: @" Post "] [request set Diliget: self]; [Request bought @ selector (Setidfinishscilः Response :) [request Setdedfail Selektor: @ selector (Kriddarspeshn_fail :)] [Netvrkkuchchu Jodopreshn request] [Netvrkkyuuu];   

Also, let me get Rist API documentation of URL: < P> Another thing I want to know And what is [line_items] in this URL ... Also, if there is any tutorial besides URL ...? Thanks in advance.

according to the order made shown through the API to pass through the line items.

  api_post: create, order = & gt; {: Lain_itm = An array of hashs in [[Variant_id = & gt; Variant.to_param, volume = & gt; 5}]}   

line_items parameter Hope to be, in which a variant_id and quantity fields are called Request looks like this:

  POST / api / order? Order [line_items] [0] [variant_id] = 1 more command [line_items [0] [volume] = 5   

I hope this will help you to understand better!

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -