Giter Site home page Giter Site logo

lognmagento's Introduction

LogN Magento

LogN Magento is an unofficial client library for Magento Service (SOAPv1). Supports Mac and iOS

Requirements

LogN Magento works on iOS5+ and ARC. It depends on the following lib(s):

You will need LLVM 3.0 or later in order to build LogN Magento.

Adding LogN Magento to your project

  1. Move inside your git tracked project.
  2. Add LogNMagento as a submodule: git submodule add git://github.com/lognllc/LogNMagento.git.
  3. Open your project in Xcode, than drag and drop Magento folder to your classes group (in the Groups & Files view).
  4. Don't select Copy items and select a suitable Reference type (relative to project should work fine most of the time).
  5. Add AFNetworking too: git submodule add git://github.com/AFNetworking/AFNetworking.git.
  6. Add frameworks: SystemConfigration, MobileCoreServices
  7. Add header search path user/include/libxml2
  8. Define your server
#define MAGENTO_BASE_URL @"http://yourserver/index.php/api/"
#define MAGENTO_USERNAME = @"xxx"
#define MAGENTO_API_KEY = @"xxx"

Usage

Best practice is to renew session when ๏ฝ€-applicationDidBecomeActive:`:

- (void)applicationDidBecomeActive:(UIApplication *)application
{
	Magento.service.storeID = @1;
	[Magento.service renewSession];
	...
}

An sample of create customer would be:

[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);
}];

License

LogN Magento is available under the Apache License (v2).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.