Hi I've this php code:
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');
$quoteId = $proxy->call( $sessionId, 'cart.create');
$arrProducts = array(
array(
“product_id” => “1”,
“qty” => 2
);
$resultCartProductAdd = $proxy->call(
$sessionId,
“cart_product.add”,
array(
$quoteId,
$arrProducts
)
);
I need to use it in my iOS app so I'm getting the sessionId
and the quoteId
by using a library. The library that I'm using work so:
Magento gives me this api: customer.create
and I've to set in customer create the sessionId and an array in which I put the details of the customer. In objectiveC I'm getting this code:
[Magento call:@[@"customer.create", @{
@"email": email,
@"password": password,
@"firstname": firstname,
@"lastname": lastname,
@"website_id": @1,
@"store_id": Magento.service.storeID
}] success:^(AFHTTPRequestOperation *operation, id responseObject) {
Magento.service.customerID = responseObject;
NSLog(@"signUp customerID = %@", Magento.service.customerID);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"error %@", error.localizedDescription);
}];
Now I'm guessing that my library convert a php array to a NSDictionary (look the code above). How I can transform the php array of array (by using this library) in objectiveC?
I've to use the cart_product.add
magento api.
I hope you can understand what I mean and I hope you can help me.