Guest User

Untitled

a guest
Dec 6th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             var params:Object = {
  2.                 customer_id: client.customer_id,
  3.                 firstname: client.firstname,
  4.                 email: client.email,
  5.                 telephone: client.telephone,
  6.                 fax: client.fax,
  7.                 address_1: client.address_1,
  8.                 address_2: client.address_2,
  9.                 city: client.city,
  10.                 postcode: client.postcode,
  11.                 country_id: client.country_id,
  12.                 zone_id: client.zone_id,
  13.                 order_product: [],
  14.                 total: order.total
  15.             };
  16.            
  17.             for each (var orderItem:OrderItem in order.items)
  18.             {
  19.                 var product:Product = orderItem.product;
  20.                 params.order_product.push({
  21.                     product_id: product.product_id,
  22.                     name: product.name,
  23.                     quantity: orderItem.quantity,
  24.                     price: product.price,
  25.                     total: orderItem.total
  26.                 });
  27.             }
  28.            
  29.             var service:HTTPService = new HTTPService();
  30.             service.url = serverBase + REST_BASE + 'addOrder';
  31.             service.resultFormat = 'text';
  32.             service.method = 'post';
  33.             service.send(params);
Add Comment
Please, Sign In to add comment