├── ShopifyAPITests ├── assets │ ├── fixtures │ │ ├── myshopifyresources │ │ │ ├── skip │ │ │ ├── expectedMyShopifyRequest.json │ │ │ ├── myShopifyResource.json │ │ │ └── severalShopifyResources.json │ │ ├── ProductImage │ │ │ ├── expectedImageTestResultFromFile.json │ │ │ └── singleProductImage.json │ │ ├── Redirect │ │ │ └── singleRedirect.json │ │ ├── Country │ │ │ └── singleCountry.json │ │ ├── ProductSearchEngine │ │ │ └── listProductSearchEngines.json │ │ ├── Province │ │ │ └── singleProvince.json │ │ ├── Theme │ │ │ └── singleTheme.json │ │ ├── Collect │ │ │ └── singleCollect.json │ │ ├── ScriptTag │ │ │ └── singleScriptTag.json │ │ ├── CustomerGroup │ │ │ └── singleCustomerGroup.json │ │ ├── Webhook │ │ │ └── singleWebhook.json │ │ ├── Event │ │ │ └── singleEvent.json │ │ ├── Metafield │ │ │ └── singleMetafield.json │ │ ├── Blog │ │ │ └── singleBlog.json │ │ ├── Transaction │ │ │ └── singleTransaction.json │ │ ├── CustomCollection │ │ │ └── singleCustomCollection.json │ │ ├── Page │ │ │ └── singlePage.json │ │ ├── Article │ │ │ ├── singleArticle.json │ │ │ ├── article.json │ │ │ └── articles.json │ │ ├── SmartCollection │ │ │ └── singleSmartCollection.json │ │ ├── ProductVariant │ │ │ └── singleProductVariant.json │ │ ├── Comment │ │ │ └── singleComment.json │ │ ├── Customer │ │ │ └── singleCustomer.json │ │ ├── Shop │ │ │ └── singleShop.json │ │ ├── Fulfillment │ │ │ └── singleFulfillment.json │ │ └── Asset │ │ │ └── singleAsset.json │ └── images │ │ └── shopify.jpg ├── libs │ ├── httpmime-4.1.2.jar │ ├── jackson-mrbean-1.8.5.jar │ ├── codegist-crest-1.0.1-all.jar │ ├── jackson-core-asl-1.8.5.jar │ ├── jackson-mapper-asl-1.8.5.jar │ └── codegist-crest-1.0.1-javadoc.jar ├── res │ ├── drawable-hdpi │ │ └── icon.png │ ├── drawable-ldpi │ │ └── icon.png │ ├── drawable-mdpi │ │ └── icon.png │ ├── values │ │ └── strings.xml │ └── layout │ │ └── main.xml ├── src │ └── com │ │ └── shopify │ │ ├── api │ │ ├── test │ │ │ └── mocks │ │ │ │ ├── MockAPIAuthorization.java │ │ │ │ └── MyShopifyResource.java │ │ ├── endpoints │ │ │ ├── AuthAPITest.java │ │ │ ├── OrdersAPIEndpointTest.java │ │ │ └── ProductImagesAPITest.java │ │ ├── resources │ │ │ ├── FixturesTestCase.java │ │ │ ├── AssetTest.java │ │ │ ├── ImageTest.java │ │ │ ├── json │ │ │ │ ├── ShopifyRequestWriterTest.java │ │ │ │ └── ShopifyResponseReaderTest.java │ │ │ ├── CommentTest.java │ │ │ └── ArticleTest.java │ │ └── APIAuthorizationTest.java │ │ ├── assets │ │ └── AssetLoader.java │ │ └── credentials │ │ └── JsonDirectoryCredentialsStoreTest.java ├── .classpath ├── gen │ └── com │ │ └── shopify │ │ └── api │ │ ├── R.java │ │ └── test │ │ └── R.java ├── AndroidManifest.xml └── proguard.cfg ├── ShopifyAPI ├── libs │ ├── httpmime-4.1.2.jar │ ├── jackson-mrbean-1.8.5.jar │ ├── codegist-crest-1.0.1-all.jar │ ├── jackson-core-asl-1.8.5.jar │ ├── jackson-mapper-asl-1.8.5.jar │ └── codegist-crest-1.0.1-javadoc.jar ├── res │ ├── drawable-hdpi │ │ └── icon.png │ ├── drawable-ldpi │ │ └── icon.png │ ├── drawable-mdpi │ │ └── icon.png │ ├── values │ │ └── strings.xml │ └── layout │ │ └── main.xml ├── src │ └── com │ │ ├── shopify │ │ └── api │ │ │ ├── endpoints │ │ │ ├── BaseShopifyService.java │ │ │ ├── EndpointImpl.java │ │ │ ├── APIPageable.java │ │ │ ├── JsonPipeService.java │ │ │ ├── AuthAPI.java │ │ │ ├── BlogsService.java │ │ │ ├── PagesService.java │ │ │ ├── ShopsService.java │ │ │ ├── ThemesService.java │ │ │ ├── ProductsService.java │ │ │ ├── CollectsService.java │ │ │ ├── CommentsService.java │ │ │ ├── WebhooksService.java │ │ │ ├── CountriesService.java │ │ │ ├── CustomersService.java │ │ │ ├── RedirectsService.java │ │ │ ├── OrdersService.java │ │ │ ├── MetafieldsService.java │ │ │ ├── ScriptTagsService.java │ │ │ ├── CustomerGroupsService.java │ │ │ ├── SmartCollectionsService.java │ │ │ ├── CustomCollectionsService.java │ │ │ ├── AssetsService.java │ │ │ ├── ArticlesService.java │ │ │ ├── ProductSearchEnginesService.java │ │ │ ├── FulfillmentsService.java │ │ │ ├── EventsService.java │ │ │ └── ProvincesService.java │ │ │ ├── resources │ │ │ ├── Blog.java │ │ │ ├── Page.java │ │ │ ├── Shop.java │ │ │ ├── Asset.java │ │ │ ├── Event.java │ │ │ ├── Order.java │ │ │ ├── Theme.java │ │ │ ├── Collect.java │ │ │ ├── Comment.java │ │ │ ├── Country.java │ │ │ ├── Product.java │ │ │ ├── Webhook.java │ │ │ ├── Customer.java │ │ │ ├── Metafield.java │ │ │ ├── Province.java │ │ │ ├── Redirect.java │ │ │ ├── ScriptTag.java │ │ │ ├── Fulfillment.java │ │ │ ├── CustomerGroup.java │ │ │ ├── SmartCollection.java │ │ │ ├── CustomCollection.java │ │ │ ├── Rule.java │ │ │ ├── Address.java │ │ │ ├── Article.java │ │ │ ├── Option.java │ │ │ ├── Receipt.java │ │ │ ├── TaxLine.java │ │ │ ├── Variant.java │ │ │ ├── LineItem.java │ │ │ ├── ShippingLine.java │ │ │ ├── BillingAddress.java │ │ │ ├── NoteAttribute.java │ │ │ ├── PaymentDetails.java │ │ │ ├── ShippingAddress.java │ │ │ ├── ProductSearchEngine.java │ │ │ ├── Transaction.java │ │ │ ├── MGOption.java │ │ │ ├── MGProductSearchEngine.java │ │ │ ├── MGTheme.java │ │ │ ├── MGScriptTag.java │ │ │ ├── MGRedirect.java │ │ │ ├── MGCustomerGroup.java │ │ │ ├── MGNoteAttribute.java │ │ │ ├── Image.java │ │ │ ├── MGReceipt.java │ │ │ ├── MGPaymentDetails.java │ │ │ ├── MGShippingLine.java │ │ │ ├── MGAsset.java │ │ │ ├── MGCountry.java │ │ │ ├── MGWebhook.java │ │ │ ├── MGTaxLine.java │ │ │ ├── MGRule.java │ │ │ ├── json │ │ │ │ ├── ShopifyRequestWriter.java │ │ │ │ └── ShopifyResponseReader.java │ │ │ ├── MGImage.java │ │ │ ├── MGProvince.java │ │ │ ├── MGCollect.java │ │ │ ├── MGMetafield.java │ │ │ ├── MGEvent.java │ │ │ ├── MGTransaction.java │ │ │ ├── MGCustomCollection.java │ │ │ ├── MGBlog.java │ │ │ ├── MGFulfillment.java │ │ │ └── MGPage.java │ │ │ ├── credentials │ │ │ ├── ShopifyCredentialsStore.java │ │ │ ├── Credential.java │ │ │ └── JsonDirectoryCredentialsStore.java │ │ │ ├── interceptors │ │ │ ├── ShopifyResponseInterceptor.java │ │ │ └── ShopifyRequestInterceptor.java │ │ │ ├── android │ │ │ ├── AuthorizationHelper.java │ │ │ └── GenericShopifyCallbackActivity.java │ │ │ └── handlers │ │ │ └── ShopifyResponseHandler.java │ │ └── apache │ │ └── commons │ │ └── codec │ │ ├── language │ │ └── package.html │ │ ├── digest │ │ └── package.html │ │ ├── net │ │ ├── package.html │ │ └── Utils.java │ │ ├── binary │ │ └── package.html │ │ ├── overview.html │ │ ├── StringDecoder.java │ │ ├── StringEncoder.java │ │ ├── BinaryEncoder.java │ │ ├── BinaryDecoder.java │ │ ├── Encoder.java │ │ └── Decoder.java ├── AndroidManifest.xml ├── assets │ └── fixtures │ │ └── makeFixtures.rb ├── .classpath ├── gen │ └── com │ │ └── shopify │ │ └── api │ │ └── R.java ├── .project └── proguard.cfg ├── ShopifyProductsListDemo ├── libs │ ├── .DS_Store │ ├── httpmime-4.1.jar │ ├── jackson-mrbean-1.8.5.jar │ ├── jackson-core-asl-1.8.5.jar │ ├── codegist-crest-1.0.1-all.jar │ ├── jackson-mapper-asl-1.8.5.jar │ └── codegist-crest-1.0.1-javadoc.jar ├── res │ ├── drawable-hdpi │ │ └── icon.png │ ├── drawable-ldpi │ │ └── icon.png │ ├── drawable-mdpi │ │ └── icon.png │ ├── layout │ │ ├── main.xml │ │ └── add_shop_screen.xml │ └── values │ │ └── strings.xml ├── src │ └── com │ │ └── shopify │ │ └── android │ │ └── productlistdemo │ │ ├── ShopifyFinalizeAuthActivity.java │ │ └── ShopifyAddShopActivity.java ├── .classpath ├── proguard.cfg ├── AndroidManifest.xml └── gen │ └── com │ └── shopify │ ├── api │ └── R.java │ └── android │ └── productlistdemo │ └── R.java ├── .gitignore └── LICENSE /ShopifyAPITests/assets/fixtures/myshopifyresources/skip: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/myshopifyresources/expectedMyShopifyRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "a" : "gaz" 3 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/ProductImage/expectedImageTestResultFromFile.json: -------------------------------------------------------------------------------- 1 | {"image":{"position":1,"image"}} -------------------------------------------------------------------------------- /ShopifyAPI/libs/httpmime-4.1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPI/libs/httpmime-4.1.2.jar -------------------------------------------------------------------------------- /ShopifyAPI/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPI/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /ShopifyAPI/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPI/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /ShopifyAPI/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPI/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /ShopifyAPITests/libs/httpmime-4.1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPITests/libs/httpmime-4.1.2.jar -------------------------------------------------------------------------------- /ShopifyProductsListDemo/libs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyProductsListDemo/libs/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .metadata/ 2 | .settings/ 3 | .project 4 | default.properties 5 | bin/ 6 | /*/build.xml 7 | /*/local.properties 8 | *.swp 9 | *~ -------------------------------------------------------------------------------- /ShopifyAPI/libs/jackson-mrbean-1.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPI/libs/jackson-mrbean-1.8.5.jar -------------------------------------------------------------------------------- /ShopifyAPITests/assets/images/shopify.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPITests/assets/images/shopify.jpg -------------------------------------------------------------------------------- /ShopifyAPI/libs/codegist-crest-1.0.1-all.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPI/libs/codegist-crest-1.0.1-all.jar -------------------------------------------------------------------------------- /ShopifyAPI/libs/jackson-core-asl-1.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPI/libs/jackson-core-asl-1.8.5.jar -------------------------------------------------------------------------------- /ShopifyAPI/libs/jackson-mapper-asl-1.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPI/libs/jackson-mapper-asl-1.8.5.jar -------------------------------------------------------------------------------- /ShopifyAPITests/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPITests/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /ShopifyAPITests/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPITests/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /ShopifyAPITests/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPITests/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /ShopifyAPITests/libs/jackson-mrbean-1.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPITests/libs/jackson-mrbean-1.8.5.jar -------------------------------------------------------------------------------- /ShopifyProductsListDemo/libs/httpmime-4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyProductsListDemo/libs/httpmime-4.1.jar -------------------------------------------------------------------------------- /ShopifyAPI/libs/codegist-crest-1.0.1-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPI/libs/codegist-crest-1.0.1-javadoc.jar -------------------------------------------------------------------------------- /ShopifyAPITests/libs/codegist-crest-1.0.1-all.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPITests/libs/codegist-crest-1.0.1-all.jar -------------------------------------------------------------------------------- /ShopifyAPITests/libs/jackson-core-asl-1.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPITests/libs/jackson-core-asl-1.8.5.jar -------------------------------------------------------------------------------- /ShopifyAPITests/libs/jackson-mapper-asl-1.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPITests/libs/jackson-mapper-asl-1.8.5.jar -------------------------------------------------------------------------------- /ShopifyProductsListDemo/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyProductsListDemo/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /ShopifyProductsListDemo/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyProductsListDemo/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /ShopifyProductsListDemo/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyProductsListDemo/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/endpoints/BaseShopifyService.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.endpoints; 2 | 3 | public interface BaseShopifyService { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /ShopifyAPITests/libs/codegist-crest-1.0.1-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyAPITests/libs/codegist-crest-1.0.1-javadoc.jar -------------------------------------------------------------------------------- /ShopifyProductsListDemo/libs/jackson-mrbean-1.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyProductsListDemo/libs/jackson-mrbean-1.8.5.jar -------------------------------------------------------------------------------- /ShopifyProductsListDemo/libs/jackson-core-asl-1.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyProductsListDemo/libs/jackson-core-asl-1.8.5.jar -------------------------------------------------------------------------------- /ShopifyProductsListDemo/libs/codegist-crest-1.0.1-all.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyProductsListDemo/libs/codegist-crest-1.0.1-all.jar -------------------------------------------------------------------------------- /ShopifyProductsListDemo/libs/jackson-mapper-asl-1.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyProductsListDemo/libs/jackson-mapper-asl-1.8.5.jar -------------------------------------------------------------------------------- /ShopifyProductsListDemo/libs/codegist-crest-1.0.1-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csaunders/Shopify4J/HEAD/ShopifyProductsListDemo/libs/codegist-crest-1.0.1-javadoc.jar -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Redirect/singleRedirect.json: -------------------------------------------------------------------------------- 1 | { 2 | "redirect": { 3 | "id": 668809255, 4 | "path": "/leopard", 5 | "target": "/pages/macosx" 6 | } 7 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Country/singleCountry.json: -------------------------------------------------------------------------------- 1 | { 2 | "country": { 3 | "tax": 0.05, 4 | "name": "Canada", 5 | "code": "CA", 6 | "id": 879921427 7 | } 8 | } -------------------------------------------------------------------------------- /ShopifyAPI/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World! 4 | ShopifyAPI 5 | 6 | -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/myshopifyresources/myShopifyResource.json: -------------------------------------------------------------------------------- 1 | { 2 | "myshopifyresource" : { 3 | "id" : 1, 4 | "created_at": "not important, yet", 5 | "updated_at": "not important, yet", 6 | "a": "foo" 7 | } 8 | } -------------------------------------------------------------------------------- /ShopifyAPITests/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, ShopifyAPITestsActivity! 4 | ShopifyAPITests 5 | 6 | -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/ProductSearchEngine/listProductSearchEngines.json: -------------------------------------------------------------------------------- 1 | { 2 | "product_search_engines": [ 3 | { 4 | "name": "Google Product Search", 5 | "created_at": "2011-09-13T15:17:05-04:00" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Province/singleProvince.json: -------------------------------------------------------------------------------- 1 | { 2 | "province": { 3 | "tax": 0.09, 4 | "name": "Quebec", 5 | "tax_name": null, 6 | "code": "QC", 7 | "id": 224293623, 8 | "tax_type": null 9 | } 10 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Theme/singleTheme.json: -------------------------------------------------------------------------------- 1 | { 2 | "theme": { 3 | "name": "Comfort", 4 | "created_at": "2011-08-15T13:54:43-04:00", 5 | "updated_at": "2011-08-15T13:54:43-04:00", 6 | "role": "main", 7 | "id": 828155753 8 | } 9 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Collect/singleCollect.json: -------------------------------------------------------------------------------- 1 | { 2 | "collect": { 3 | "position": 1, 4 | "created_at": null, 5 | "product_id": 632910392, 6 | "updated_at": null, 7 | "featured": false, 8 | "id": 841564295, 9 | "collection_id": 841564295 10 | } 11 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/ScriptTag/singleScriptTag.json: -------------------------------------------------------------------------------- 1 | { 2 | "script_tag": { 3 | "created_at": "2011-08-15T13:54:42-04:00", 4 | "updated_at": "2011-08-15T13:54:42-04:00", 5 | "src": "http://js-aplenty.com/foo.js", 6 | "id": 596726825, 7 | "event": "onload" 8 | } 9 | } -------------------------------------------------------------------------------- /ShopifyAPI/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/CustomerGroup/singleCustomerGroup.json: -------------------------------------------------------------------------------- 1 | { 2 | "customer_group": { 3 | "name": "Accepts Marketing", 4 | "created_at": "2011-08-08T09:51:04-04:00", 5 | "updated_at": "2011-08-08T09:51:04-04:00", 6 | "id": 789629109, 7 | "query": "accepts_marketing:1" 8 | } 9 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Webhook/singleWebhook.json: -------------------------------------------------------------------------------- 1 | { 2 | "webhook": { 3 | "address": "http://apple.com", 4 | "format": "xml", 5 | "created_at": "2011-08-15T13:54:43-04:00", 6 | "updated_at": "2011-08-15T13:54:43-04:00", 7 | "topic": "orders/create", 8 | "id": 4759306 9 | } 10 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Blog.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Blog extends MGBlog { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Page.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Page extends MGPage { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Shop.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Shop extends MGShop { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Asset.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Asset extends MGAsset { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Event.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Event extends MGEvent { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Order.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Order extends MGOrder { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Theme.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Theme extends MGTheme { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Collect.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Collect extends MGCollect { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Comment.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Comment extends MGComment { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Country.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Country extends MGCountry { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Product.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Product extends MGProduct { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Webhook.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Webhook extends MGWebhook { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Customer.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Customer extends MGCustomer { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Metafield.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Metafield extends MGMetafield { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Province.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Province extends MGProvince { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Redirect.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Redirect extends MGRedirect { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/ScriptTag.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class ScriptTag extends MGScriptTag { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Event/singleEvent.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": { 3 | "verb": "create", 4 | "created_at": "2007-12-31T19:00:00-05:00", 5 | "body": null, 6 | "subject_id": 921728736, 7 | "id": 677313116, 8 | "subject_type": "Product", 9 | "message": "New product: IPod Touch 8GB." 10 | } 11 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/ProductImage/singleProductImage.json: -------------------------------------------------------------------------------- 1 | { 2 | "image": { 3 | "position": 1, 4 | "created_at": "2011-08-15T13:54:42-04:00", 5 | "product_id": 632910392, 6 | "updated_at": "2011-08-15T13:54:42-04:00", 7 | "src": "http://static.shopify.com/s/files/1/6909/3384/products/ipod-nano.png?0", 8 | "id": 850703190 9 | } 10 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Fulfillment.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class Fulfillment extends MGFulfillment { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/CustomerGroup.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class CustomerGroup extends MGCustomerGroup { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/SmartCollection.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class SmartCollection extends MGSmartCollection { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/CustomCollection.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | /** 6 | * This code has been machine generated by processing the single entry 7 | * fixtures found from the Shopify API Documentation 8 | */ 9 | 10 | public class CustomCollection extends MGCustomCollection { 11 | 12 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Metafield/singleMetafield.json: -------------------------------------------------------------------------------- 1 | { 2 | "metafield": { 3 | "created_at": "2011-08-15T13:51:05-04:00", 4 | "updated_at": "2011-08-15T13:51:05-04:00", 5 | "namespace": "translations", 6 | "id": 845366454, 7 | "value": "produit", 8 | "description": "French product title", 9 | "key": "title_fr", 10 | "value_type": "string" 11 | } 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Rule.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-25T23:29:48-04:00 2 | package com.shopify.api.resources; 3 | 4 | import org.codehaus.jackson.annotate.JsonProperty; 5 | 6 | /** 7 | * This code has been machine generated by processing the single entry 8 | * fixtures found from the Shopify API Documentation 9 | */ 10 | 11 | public class Rule extends MGRule { 12 | 13 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Blog/singleBlog.json: -------------------------------------------------------------------------------- 1 | { 2 | "blog": { 3 | "handle": "apple-blog", 4 | "created_at": "2011-08-15T13:51:05-04:00", 5 | "title": "Mah Blog", 6 | "template_suffix": null, 7 | "updated_at": "2006-02-01T19:00:00-05:00", 8 | "feedburner_location": null, 9 | "id": 241253187, 10 | "feedburner": null, 11 | "commentable": "no" 12 | } 13 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/credentials/ShopifyCredentialsStore.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.credentials; 2 | 3 | import java.util.Set; 4 | 5 | public interface ShopifyCredentialsStore { 6 | public Credential loadCredential(String shop) throws Exception; 7 | public void saveCredential(Credential credential) throws Exception; 8 | public Set getAvailableShops() throws Exception; 9 | } 10 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Address.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-25T23:29:48-04:00 2 | package com.shopify.api.resources; 3 | 4 | import org.codehaus.jackson.annotate.JsonProperty; 5 | 6 | /** 7 | * This code has been machine generated by processing the single entry 8 | * fixtures found from the Shopify API Documentation 9 | */ 10 | 11 | public class Address extends MGAddress { 12 | 13 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Article.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-26T01:13:43-04:00 2 | package com.shopify.api.resources; 3 | 4 | import org.codehaus.jackson.annotate.JsonProperty; 5 | 6 | /** 7 | * This code has been machine generated by processing the single entry 8 | * fixtures found from the Shopify API Documentation 9 | */ 10 | 11 | public class Article extends MGArticle { 12 | 13 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Option.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-25T23:29:48-04:00 2 | package com.shopify.api.resources; 3 | 4 | import org.codehaus.jackson.annotate.JsonProperty; 5 | 6 | /** 7 | * This code has been machine generated by processing the single entry 8 | * fixtures found from the Shopify API Documentation 9 | */ 10 | 11 | public class Option extends MGOption { 12 | 13 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Receipt.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-25T23:29:48-04:00 2 | package com.shopify.api.resources; 3 | 4 | import org.codehaus.jackson.annotate.JsonProperty; 5 | 6 | /** 7 | * This code has been machine generated by processing the single entry 8 | * fixtures found from the Shopify API Documentation 9 | */ 10 | 11 | public class Receipt extends MGReceipt { 12 | 13 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/TaxLine.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-25T23:29:48-04:00 2 | package com.shopify.api.resources; 3 | 4 | import org.codehaus.jackson.annotate.JsonProperty; 5 | 6 | /** 7 | * This code has been machine generated by processing the single entry 8 | * fixtures found from the Shopify API Documentation 9 | */ 10 | 11 | public class TaxLine extends MGTaxLine { 12 | 13 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Variant.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-25T23:29:48-04:00 2 | package com.shopify.api.resources; 3 | 4 | import org.codehaus.jackson.annotate.JsonProperty; 5 | 6 | /** 7 | * This code has been machine generated by processing the single entry 8 | * fixtures found from the Shopify API Documentation 9 | */ 10 | 11 | public class Variant extends MGVariant { 12 | 13 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/LineItem.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-25T23:29:48-04:00 2 | package com.shopify.api.resources; 3 | 4 | import org.codehaus.jackson.annotate.JsonProperty; 5 | 6 | /** 7 | * This code has been machine generated by processing the single entry 8 | * fixtures found from the Shopify API Documentation 9 | */ 10 | 11 | public class LineItem extends MGLineItem { 12 | 13 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Transaction/singleTransaction.json: -------------------------------------------------------------------------------- 1 | { 2 | "transaction": { 3 | "kind": "authorization", 4 | "created_at": "2005-08-01T11:57:11-04:00", 5 | "order_id": 450789469, 6 | "amount": "210.94", 7 | "authorization": "authorization-key", 8 | "receipt": { 9 | "testcase": true, 10 | "authorization": "123456" 11 | }, 12 | "status": "success" 13 | } 14 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/ShippingLine.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-25T23:29:48-04:00 2 | package com.shopify.api.resources; 3 | 4 | import org.codehaus.jackson.annotate.JsonProperty; 5 | 6 | /** 7 | * This code has been machine generated by processing the single entry 8 | * fixtures found from the Shopify API Documentation 9 | */ 10 | 11 | public class ShippingLine extends MGShippingLine { 12 | 13 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/CustomCollection/singleCustomCollection.json: -------------------------------------------------------------------------------- 1 | { 2 | "custom_collection": { 3 | "handle": "ipods", 4 | "body_html": "

The best selling ipod ever

", 5 | "title": "IPods", 6 | "template_suffix": null, 7 | "updated_at": "2008-02-01T19:00:00-05:00", 8 | "sort_order": "manual", 9 | "id": 841564295, 10 | "published_at": "2008-02-01T19:00:00-05:00" 11 | } 12 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/BillingAddress.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-25T23:29:48-04:00 2 | package com.shopify.api.resources; 3 | 4 | import org.codehaus.jackson.annotate.JsonProperty; 5 | 6 | /** 7 | * This code has been machine generated by processing the single entry 8 | * fixtures found from the Shopify API Documentation 9 | */ 10 | 11 | public class BillingAddress extends MGBillingAddress { 12 | 13 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/NoteAttribute.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-25T23:29:48-04:00 2 | package com.shopify.api.resources; 3 | 4 | import org.codehaus.jackson.annotate.JsonProperty; 5 | 6 | /** 7 | * This code has been machine generated by processing the single entry 8 | * fixtures found from the Shopify API Documentation 9 | */ 10 | 11 | public class NoteAttribute extends MGNoteAttribute { 12 | 13 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/PaymentDetails.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-25T23:29:48-04:00 2 | package com.shopify.api.resources; 3 | 4 | import org.codehaus.jackson.annotate.JsonProperty; 5 | 6 | /** 7 | * This code has been machine generated by processing the single entry 8 | * fixtures found from the Shopify API Documentation 9 | */ 10 | 11 | public class PaymentDetails extends MGPaymentDetails { 12 | 13 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/ShippingAddress.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-25T23:29:48-04:00 2 | package com.shopify.api.resources; 3 | 4 | import org.codehaus.jackson.annotate.JsonProperty; 5 | 6 | /** 7 | * This code has been machine generated by processing the single entry 8 | * fixtures found from the Shopify API Documentation 9 | */ 10 | 11 | public class ShippingAddress extends MGShippingAddress { 12 | 13 | } -------------------------------------------------------------------------------- /ShopifyAPI/assets/fixtures/makeFixtures.rb: -------------------------------------------------------------------------------- 1 | resources = ["Asset", "Blog", "Collect", "Comment", "Country", "CustomCollection", "Customer", "CustomerGroup", "Event", "Fulfillment", "Metafield", "Order", "Page", "Product", "ProductSearchEngine", "Province", "Redirect", "ScriptTag", "Shop", "SmartCollection", "Theme", "Transactions", "Webhook"] 2 | 3 | resources.each do |res| 4 | File.open("#{res}/single#{res}.json", 'wb'){|f| f.write("")} 5 | end 6 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/ProductSearchEngine.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-26T01:08:43-04:00 2 | package com.shopify.api.resources; 3 | 4 | import org.codehaus.jackson.annotate.JsonProperty; 5 | 6 | /** 7 | * This code has been machine generated by processing the single entry 8 | * fixtures found from the Shopify API Documentation 9 | */ 10 | 11 | public class ProductSearchEngine extends MGProductSearchEngine { 12 | 13 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Transaction.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-09-01T17:44:48-04:00 2 | package com.shopify.api.resources; 3 | 4 | import java.util.List; 5 | import org.codehaus.jackson.annotate.JsonProperty; 6 | 7 | /** 8 | * This code has been machine generated by processing the single entry 9 | * fixtures found from the Shopify API Documentation 10 | */ 11 | 12 | public class Transaction extends MGTransaction { 13 | 14 | } -------------------------------------------------------------------------------- /ShopifyAPITests/src/com/shopify/api/test/mocks/MockAPIAuthorization.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.test.mocks; 2 | 3 | import com.shopify.api.APIAuthorization; 4 | import com.shopify.api.credentials.Credential; 5 | 6 | public class MockAPIAuthorization extends APIAuthorization{ 7 | 8 | public MockAPIAuthorization() { 9 | super(new Credential("invoice-api-key", "hush", "some-shop", "36b29a08b3113077f14777570c0577ed")); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/endpoints/EndpointImpl.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.endpoints; 2 | 3 | import org.apache.http.client.HttpClient; 4 | 5 | public interface EndpointImpl extends BaseShopifyService{ 6 | 7 | public void setEndpoint(String endpoint); 8 | 9 | public void setHttpClient(HttpClient client); 10 | 11 | public void setServiceInterface(BaseShopifyService service); 12 | 13 | public Class getServiceClass(); 14 | } 15 | -------------------------------------------------------------------------------- /ShopifyAPI/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /ShopifyAPITests/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /ShopifyAPITests/src/com/shopify/api/test/mocks/MyShopifyResource.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.test.mocks; 2 | 3 | import org.codehaus.jackson.annotate.JsonProperty; 4 | 5 | import com.shopify.api.resources.ShopifyResource; 6 | 7 | public class MyShopifyResource extends ShopifyResource { 8 | @JsonProperty("a") 9 | public String getA() { return (String)getAttribute("a"); } 10 | @JsonProperty("a") 11 | public void setA(String newA) { setAttribute("a", newA); } 12 | } 13 | -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Page/singlePage.json: -------------------------------------------------------------------------------- 1 | { 2 | "page": { 3 | "handle": "tos", 4 | "created_at": "2008-07-15T20:00:00-04:00", 5 | "body_html": "

We make perfect stuff, we don't need a warranty.

", 6 | "title": "Terms of Services", 7 | "template_suffix": null, 8 | "author": "Dennis", 9 | "updated_at": "2008-07-16T20:00:00-04:00", 10 | "shop_id": 690933842, 11 | "id": 131092082, 12 | "published_at": "2008-07-15T20:00:00-04:00" 13 | } 14 | } -------------------------------------------------------------------------------- /ShopifyProductsListDemo/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 13 | 14 | -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Article/singleArticle.json: -------------------------------------------------------------------------------- 1 | { 2 | "article": { 3 | "created_at": "2008-07-31T20:00:00-04:00", 4 | "body_html": "

Do you have an IPod yet?

", 5 | "title": "get on the train now", 6 | "author": "Dennis", 7 | "updated_at": "2008-07-31T20:00:00-04:00", 8 | "summary_html": null, 9 | "blog_id": 241253187, 10 | "tags": "Announcing", 11 | "id": 134645308, 12 | "user_id": 799407056, 13 | "published_at": "2008-07-31T20:00:00-04:00" 14 | } 15 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Article/article.json: -------------------------------------------------------------------------------- 1 | { 2 | "article" : { 3 | "created_at": "2008-07-31T20:00:00-04:00", 4 | "body_html": "

Do you have an IPod yet?

", 5 | "title": "get on the train now", 6 | "author": "Dennis", 7 | "updated_at": "2008-07-31T20:00:00-04:00", 8 | "summary_html": null, 9 | "blog_id": 241253187, 10 | "tags": "Announcing", 11 | "id": 134645308, 12 | "user_id": 799407056, 13 | "published_at": "2008-07-31T20:00:00-04:00" 14 | } 15 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/myshopifyresources/severalShopifyResources.json: -------------------------------------------------------------------------------- 1 | { 2 | "myshopifyresources" : [ 3 | { 4 | "id" : 1, 5 | "created_at": "not important, yet", 6 | "updated_at": "not important, yet", 7 | "a": "foo" 8 | }, 9 | { 10 | "id" : 2, 11 | "created_at": "not important, yet", 12 | "updated_at": "not important, yet", 13 | "a": "bar" 14 | }, 15 | { 16 | "id" : 3, 17 | "created_at": "not important, yet", 18 | "updated_at": "not important, yet", 19 | "a": "baz" 20 | } 21 | 22 | ] 23 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/SmartCollection/singleSmartCollection.json: -------------------------------------------------------------------------------- 1 | { 2 | "smart_collection": { 3 | "handle": "smart-ipods", 4 | "body_html": "

The best selling ipod ever

", 5 | "title": "Smart iPods", 6 | "template_suffix": null, 7 | "rules": [ 8 | { 9 | "relation": "equals", 10 | "column": "type", 11 | "condition": "Cult Products" 12 | } 13 | ], 14 | "updated_at": "2008-02-01T19:00:00-05:00", 15 | "sort_order": "manual", 16 | "id": 482865238, 17 | "published_at": "2008-02-01T19:00:00-05:00" 18 | } 19 | } -------------------------------------------------------------------------------- /ShopifyAPI/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/ProductVariant/singleProductVariant.json: -------------------------------------------------------------------------------- 1 | { 2 | "variant": { 3 | "price": "199.00", 4 | "position": 1, 5 | "created_at": "2011-08-15T13:54:42-04:00", 6 | "title": "Pink", 7 | "requires_shipping": true, 8 | "inventory_quantity": 10, 9 | "updated_at": "2011-08-15T13:54:42-04:00", 10 | "inventory_policy": "continue", 11 | "compare_at_price": null, 12 | "inventory_management": "shopify", 13 | "taxable": true, 14 | "id": 808950810, 15 | "grams": 200, 16 | "sku": "IPOD2008PINK", 17 | "option1": "Pink", 18 | "option2": null, 19 | "fulfillment_service": "manual", 20 | "option3": null 21 | } 22 | } -------------------------------------------------------------------------------- /ShopifyAPITests/src/com/shopify/api/endpoints/AuthAPITest.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.endpoints; 2 | 3 | import java.net.URI; 4 | 5 | import junit.framework.TestCase; 6 | 7 | import com.shopify.api.test.mocks.MockAPIAuthorization; 8 | 9 | public class AuthAPITest extends TestCase { 10 | private AuthAPI authApi; 11 | 12 | public void setUp() throws Exception { 13 | super.setUp(); 14 | authApi = new AuthAPI(new MockAPIAuthorization()); 15 | } 16 | 17 | public void testGetAuthRequestURI() { 18 | URI authURI = authApi.getAuthRequestURI(); 19 | String expected = "http://some-shop.myshopify.com/admin/api/auth?api_key=invoice-api-key"; 20 | assertEquals(expected, authURI.toString()); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Comment/singleComment.json: -------------------------------------------------------------------------------- 1 | { 2 | "comment": { 3 | "created_at": "2011-08-15T13:51:05-04:00", 4 | "body_html": "

Hi author, I really like what you're doing there.

", 5 | "body": "Hi author, I really _like_ what you're doing there.", 6 | "author": "Soleone", 7 | "updated_at": "2011-08-15T13:51:05-04:00", 8 | "blog_id": 241253187, 9 | "id": 118373535, 10 | "article_id": 134645308, 11 | "ip": "127.0.0.1", 12 | "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", 13 | "published_at": null, 14 | "status": "published", 15 | "email": "sole@one.de" 16 | } 17 | } -------------------------------------------------------------------------------- /ShopifyAPI/gen/com/shopify/api/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package com.shopify.api; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class drawable { 14 | public static final int icon=0x7f020000; 15 | } 16 | public static final class layout { 17 | public static final int main=0x7f030000; 18 | } 19 | public static final class string { 20 | public static final int app_name=0x7f040001; 21 | public static final int hello=0x7f040000; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ShopifyAPITests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ShopifyAPITests/gen/com/shopify/api/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package com.shopify.api; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class drawable { 14 | public static final int icon=0x7f020000; 15 | } 16 | public static final class layout { 17 | public static final int main=0x7f030000; 18 | } 19 | public static final class string { 20 | public static final int app_name=0x7f040001; 21 | public static final int hello=0x7f040000; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ShopifyProductsListDemo/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, ShopifyProductListDemoActivity! 4 | ShopifyProductListDemo 5 | 522bae089dc2a4ec2b95abe3993edb55 6 | 88e75ad76fbedc6510a0f88a3749f896 7 | Shop Name 8 | .myshopify.com 9 | snowdevil 10 | Authorize 11 | Shop name is missing 12 | 13 | -------------------------------------------------------------------------------- /ShopifyAPITests/gen/com/shopify/api/test/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package com.shopify.api.test; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class drawable { 14 | public static final int icon=0x7f020000; 15 | } 16 | public static final class layout { 17 | public static final int main=0x7f030000; 18 | } 19 | public static final class string { 20 | public static final int app_name=0x7f040001; 21 | public static final int hello=0x7f040000; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ShopifyProductsListDemo/src/com/shopify/android/productlistdemo/ShopifyFinalizeAuthActivity.java: -------------------------------------------------------------------------------- 1 | package com.shopify.android.productlistdemo; 2 | 3 | import java.io.IOException; 4 | import java.util.HashMap; 5 | 6 | import android.app.Activity; 7 | import android.content.Intent; 8 | import android.net.Uri; 9 | import android.os.Bundle; 10 | 11 | import com.shopify.api.APIAuthorization; 12 | import com.shopify.api.android.GenericShopifyCallbackActivity; 13 | import com.shopify.api.credentials.JsonDirectoryCredentialsStore; 14 | 15 | public class ShopifyFinalizeAuthActivity extends GenericShopifyCallbackActivity { 16 | 17 | @Override 18 | public Class getOnSuccessActivity(){ 19 | return ShopifyProductListDemoActivity.class; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /ShopifyAPITests/src/com/shopify/api/resources/FixturesTestCase.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import com.shopify.api.resources.json.ShopifyRequestWriter; 4 | import com.shopify.api.resources.json.ShopifyResponseReader; 5 | import com.shopify.assets.AssetLoader; 6 | 7 | import android.test.InstrumentationTestCase; 8 | 9 | public class FixturesTestCase extends InstrumentationTestCase { 10 | protected String fixturesDir = "fixtures/"; 11 | protected ShopifyResponseReader reader; 12 | protected ShopifyRequestWriter writer; 13 | 14 | public void setUp() throws Exception { 15 | super.setUp(); 16 | AssetLoader.instrumentation = getInstrumentation(); 17 | reader = new ShopifyResponseReader(); 18 | writer = new ShopifyRequestWriter(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /ShopifyAPITests/src/com/shopify/api/resources/AssetTest.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import com.shopify.assets.AssetLoader; 4 | 5 | public class AssetTest extends FixturesTestCase { 6 | 7 | public void testReadingInSingleAsset() { 8 | String singleAsset = AssetLoader.loadAsset(fixturesDir, "Asset/singleAsset.json"); 9 | 10 | Asset result = reader.read(singleAsset, Asset.class).get(0); 11 | { 12 | assertEquals("2010-07-12T15:31:50-04:00", result.getCreatedAt()); 13 | assertEquals("2010-07-12T15:31:50-04:00", result.getUpdatedAt()); 14 | assertEquals(null, result.getPublicUrl()); 15 | assertTrue(result.getValue().startsWith("")); 16 | assertEquals("templates/index.liquid", result.getKey()); 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ShopifyProductsListDemo/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Customer/singleCustomer.json: -------------------------------------------------------------------------------- 1 | { 2 | "customer": { 3 | "accepts_marketing": false, 4 | "orders_count": 0, 5 | "addresses": [ 6 | { 7 | "name": null, 8 | "address1": "Chestnut Street 92", 9 | "city": "Louisville", 10 | "company": null, 11 | "address2": "", 12 | "zip": "40202", 13 | "country_code": null, 14 | "country": "US", 15 | "province_code": null, 16 | "last_name": null, 17 | "phone": "555-625-1199", 18 | "province": "KY", 19 | "first_name": null 20 | } 21 | ], 22 | "tags": "", 23 | "id": 207119551, 24 | "note": null, 25 | "last_name": "Norman", 26 | "total_spent": "0.00", 27 | "first_name": "Bob", 28 | "email": "bob.norman@hostmail.com" 29 | } 30 | } -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Shop/singleShop.json: -------------------------------------------------------------------------------- 1 | { 2 | "shop": { 3 | "name": "Apple Computers", 4 | "city": "Cupertino", 5 | "address1": "1 Infinite Loop", 6 | "plan_name": "enterprise", 7 | "zip": "95014", 8 | "created_at": "2007-12-31T19:00:00-05:00", 9 | "shop_owner": "Steve Jobs", 10 | "public": false, 11 | "country": "US", 12 | "money_with_currency_format": "$ {{amount}} USD", 13 | "money_format": "$ {{amount}}", 14 | "domain": "shop.apple.com", 15 | "taxes_included": null, 16 | "id": 690933842, 17 | "timezone": "(GMT-05:00) Eastern Time (US & Canada)", 18 | "tax_shipping": null, 19 | "phone": null, 20 | "currency": "USD", 21 | "myshopify_domain": "apple.myshopify.com", 22 | "source": null, 23 | "province": "CA", 24 | "email": "steve@apple.com" 25 | } 26 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/interceptors/ShopifyResponseInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.interceptors; 2 | 3 | import java.io.IOException; 4 | 5 | import org.apache.http.HttpException; 6 | import org.apache.http.HttpResponse; 7 | import org.apache.http.HttpResponseInterceptor; 8 | import org.apache.http.protocol.HttpContext; 9 | 10 | public class ShopifyResponseInterceptor implements HttpResponseInterceptor { 11 | 12 | public void process(HttpResponse response, HttpContext context) 13 | throws HttpException, IOException { 14 | /* CRest 1.0.1 throws an exception is the status code != 200, 15 | * even on 201 Created, just translate all 200 responses to error code 200. */ 16 | int code = response.getStatusLine().getStatusCode(); 17 | if (code >= 200 && code < 300) { 18 | response.setStatusCode(200); 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGOption.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in Option.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGOption extends ShopifyResource { 21 | 22 | @JsonProperty("name") 23 | public String getName() { 24 | return (String)getAttribute("name"); 25 | } 26 | @JsonProperty("name") 27 | public void setName(String _name) { 28 | setAttribute("name", _name); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGProductSearchEngine.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in ProductSearchEngine.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGProductSearchEngine extends ShopifyResource { 21 | 22 | @JsonProperty("name") 23 | public String getName() { 24 | return (String)getAttribute("name"); 25 | } 26 | @JsonProperty("name") 27 | public void setName(String _name) { 28 | setAttribute("name", _name); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /ShopifyAPITests/src/com/shopify/assets/AssetLoader.java: -------------------------------------------------------------------------------- 1 | package com.shopify.assets; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStreamReader; 5 | 6 | import android.app.Instrumentation; 7 | 8 | public class AssetLoader { 9 | public static Instrumentation instrumentation; 10 | 11 | public static String loadAsset(String dir, String filename) { 12 | return loadAsset(dir + filename); 13 | } 14 | 15 | public static String loadAsset(String filename) { 16 | StringBuilder builder = new StringBuilder(); 17 | char[] buffer = new char[1024]; 18 | int lettersRead = 0; 19 | try { 20 | InputStreamReader dataStream = new InputStreamReader(instrumentation.getTargetContext().getAssets().open(filename)); 21 | while( (lettersRead = dataStream.read(buffer)) > 0) { 22 | builder.append(buffer, 0, lettersRead); 23 | } 24 | } catch (IOException e) { 25 | return ""; 26 | } 27 | return builder.toString(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /ShopifyAPI/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ShopifyAPI 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /ShopifyAPITests/src/com/shopify/api/resources/ImageTest.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources; 2 | 3 | import java.io.File; 4 | 5 | import android.content.Context; 6 | import android.util.Log; 7 | 8 | import com.shopify.assets.AssetLoader; 9 | 10 | public class ImageTest extends FixturesTestCase { 11 | Context ctx; 12 | 13 | public void setUp() throws Exception { 14 | super.setUp(); 15 | ctx = AssetLoader.instrumentation.getTargetContext(); 16 | } 17 | 18 | public void tearDown() throws Exception { 19 | super.tearDown(); 20 | } 21 | 22 | public void testCreateAnImageFromFile() throws Exception{ 23 | Image image = new Image(); 24 | image.setPosition(1); 25 | image.setImage(new File("/dev/null")); 26 | image.setFilename("shopify.png"); 27 | String result = image.toString(); 28 | 29 | assertTrue(result.contains("position")); 30 | assertTrue(result.contains("filename")); 31 | assertTrue(result.contains("attachment")); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /ShopifyAPITests/src/com/shopify/api/resources/json/ShopifyRequestWriterTest.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources.json; 2 | 3 | import com.shopify.api.test.mocks.MyShopifyResource; 4 | import com.shopify.assets.AssetLoader; 5 | 6 | import android.test.InstrumentationTestCase; 7 | import android.util.Log; 8 | 9 | public class ShopifyRequestWriterTest extends InstrumentationTestCase { 10 | private static String DIR = "fixtures/myshopifyresources/"; 11 | 12 | public void setUp() throws Exception { 13 | super.setUp(); 14 | AssetLoader.instrumentation = getInstrumentation(); 15 | } 16 | 17 | public void testRequestWriterOutput() throws Exception{ 18 | MyShopifyResource res = new MyShopifyResource(); 19 | res.setA("gaz"); 20 | 21 | String result = res.toString(); 22 | Log.d("RAWR!!!!!", result); 23 | 24 | String expected = AssetLoader.loadAsset(DIR, "expectedMyShopifyRequest.json").replaceAll("\\s+", ""); 25 | assertEquals(expected, result); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/apache/commons/codec/language/package.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | Language and phonetic encoders. 20 | 21 | 22 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/apache/commons/codec/digest/package.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | Simplifies common {@link java.security.MessageDigest} tasks. 20 | 21 | 22 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/apache/commons/codec/net/package.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 |

20 | Network related encoding and decoding. 21 |

22 | 23 | 24 | -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Fulfillment/singleFulfillment.json: -------------------------------------------------------------------------------- 1 | { 2 | "fulfillment": { 3 | "tracking_company": null, 4 | "created_at": "2011-08-15T13:51:05-04:00", 5 | "line_items": [ 6 | { 7 | "name": "IPod Nano - 8gb - green", 8 | "price": "199.00", 9 | "product_id": 632910392, 10 | "quantity": 1, 11 | "requires_shipping": true, 12 | "title": "IPod Nano - 8gb", 13 | "id": 466157049, 14 | "grams": 200, 15 | "sku": "IPOD2008GREEN", 16 | "fulfillment_status": null, 17 | "variant_title": "green", 18 | "vendor": null, 19 | "fulfillment_service": "manual", 20 | "variant_id": 39072856 21 | } 22 | ], 23 | "updated_at": "2011-08-15T13:51:05-04:00", 24 | "order_id": 450789469, 25 | "id": 255858046, 26 | "receipt": { 27 | "testcase": true, 28 | "authorization": "123456" 29 | }, 30 | "tracking_number": "1Z2345", 31 | "status": "failed" 32 | } 33 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/apache/commons/codec/binary/package.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | Base64, Base32, Binary, and Hexadecimal String encoding and decoding. 20 | 21 | 22 | -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Article/articles.json: -------------------------------------------------------------------------------- 1 | { 2 | "articles": [ 3 | { 4 | "created_at": "2008-12-31T19:00:00-05:00", 5 | "body_html": "I have no idea what to write about, but it's going to rock!", 6 | "title": "Some crazy article I'm coming up with", 7 | "author": "John", 8 | "updated_at": "2009-01-31T19:00:00-05:00", 9 | "summary_html": null, 10 | "blog_id": 241253187, 11 | "tags": "Mystery", 12 | "id": 989034056, 13 | "user_id": null, 14 | "published_at": null 15 | }, 16 | { 17 | "created_at": "2008-07-31T20:00:00-04:00", 18 | "body_html": "

Do you have an IPod yet?

", 19 | "title": "get on the train now", 20 | "author": "Dennis", 21 | "updated_at": "2008-07-31T20:00:00-04:00", 22 | "summary_html": null, 23 | "blog_id": 241253187, 24 | "tags": "Announcing", 25 | "id": 134645308, 26 | "user_id": 799407056, 27 | "published_at": "2008-07-31T20:00:00-04:00" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011 by Shopify 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGTheme.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in Theme.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGTheme extends ShopifyResource { 21 | 22 | @JsonProperty("name") 23 | public String getName() { 24 | return (String)getAttribute("name"); 25 | } 26 | @JsonProperty("name") 27 | public void setName(String _name) { 28 | setAttribute("name", _name); 29 | } 30 | 31 | @JsonProperty("role") 32 | public String getRole() { 33 | return (String)getAttribute("role"); 34 | } 35 | @JsonProperty("role") 36 | public void setRole(String _role) { 37 | setAttribute("role", _role); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGScriptTag.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in ScriptTag.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGScriptTag extends ShopifyResource { 21 | 22 | @JsonProperty("event") 23 | public String getEvent() { 24 | return (String)getAttribute("event"); 25 | } 26 | @JsonProperty("event") 27 | public void setEvent(String _event) { 28 | setAttribute("event", _event); 29 | } 30 | 31 | @JsonProperty("src") 32 | public String getSrc() { 33 | return (String)getAttribute("src"); 34 | } 35 | @JsonProperty("src") 36 | public void setSrc(String _src) { 37 | setAttribute("src", _src); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/endpoints/APIPageable.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.endpoints; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | 6 | import com.shopify.api.APIAuthorization; 7 | import com.shopify.api.resources.ShopifyResource; 8 | 9 | 10 | public abstract class APIPageable extends API { 11 | public APIPageable(APIAuthorization auth) { super(auth); } 12 | private static final String PAGE = "page"; 13 | //private static final String 14 | 15 | private static final int DEFAULT_PAGE_SIZE = 50; 16 | 17 | private int pageSize = DEFAULT_PAGE_SIZE; 18 | 19 | public int getPageCount() { 20 | return -1; 21 | } 22 | 23 | public ArrayList resourcesForPage(int page){ 24 | return resourcesForPage(page, new HashMap()); 25 | } 26 | 27 | public ArrayList resourcesForPage(int page, HashMap additionalParams){ 28 | //additionalParams.put(key, value) 29 | return null; 30 | } 31 | 32 | public int getPageSize() { 33 | return pageSize; 34 | } 35 | 36 | public void setPageSize(int pageSize) { 37 | this.pageSize = pageSize; 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/endpoints/JsonPipeService.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.endpoints; 2 | 3 | import static org.codegist.crest.HttpMethod.DELETE; 4 | import static org.codegist.crest.HttpMethod.POST; 5 | import static org.codegist.crest.HttpMethod.PUT; 6 | import static org.codegist.crest.config.Destination.BODY; 7 | 8 | import java.io.InputStream; 9 | 10 | import org.codegist.crest.annotate.ContextPath; 11 | import org.codegist.crest.annotate.Destination; 12 | import org.codegist.crest.annotate.EndPoint; 13 | import org.codegist.crest.annotate.HttpMethod; 14 | import org.codegist.crest.annotate.Path; 15 | 16 | @EndPoint("") 17 | @ContextPath("/admin/") 18 | public interface JsonPipeService extends BaseShopifyService{ 19 | 20 | @Path("{0}.json") 21 | InputStream read(String endpoint); 22 | 23 | @Path("{0}.json") 24 | @HttpMethod(POST) 25 | InputStream create(String endpoint, @Destination(BODY) String data); 26 | 27 | @Path("{0}.json") 28 | @HttpMethod(PUT) 29 | InputStream update(String endpoint, @Destination(BODY) String data); 30 | 31 | @Path("{0}.json") 32 | @HttpMethod(DELETE) 33 | InputStream destroy(String endpoint); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGRedirect.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in Redirect.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGRedirect extends ShopifyResource { 21 | 22 | @JsonProperty("path") 23 | public String getPath() { 24 | return (String)getAttribute("path"); 25 | } 26 | @JsonProperty("path") 27 | public void setPath(String _path) { 28 | setAttribute("path", _path); 29 | } 30 | 31 | @JsonProperty("target") 32 | public String getTarget() { 33 | return (String)getAttribute("target"); 34 | } 35 | @JsonProperty("target") 36 | public void setTarget(String _target) { 37 | setAttribute("target", _target); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGCustomerGroup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in CustomerGroup.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGCustomerGroup extends ShopifyResource { 21 | 22 | @JsonProperty("name") 23 | public String getName() { 24 | return (String)getAttribute("name"); 25 | } 26 | @JsonProperty("name") 27 | public void setName(String _name) { 28 | setAttribute("name", _name); 29 | } 30 | 31 | @JsonProperty("query") 32 | public String getQuery() { 33 | return (String)getAttribute("query"); 34 | } 35 | @JsonProperty("query") 36 | public void setQuery(String _query) { 37 | setAttribute("query", _query); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGNoteAttribute.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in NoteAttribute.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGNoteAttribute extends ShopifyResource { 21 | 22 | @JsonProperty("name") 23 | public String getName() { 24 | return (String)getAttribute("name"); 25 | } 26 | @JsonProperty("name") 27 | public void setName(String _name) { 28 | setAttribute("name", _name); 29 | } 30 | 31 | @JsonProperty("value") 32 | public String getValue() { 33 | return (String)getAttribute("value"); 34 | } 35 | @JsonProperty("value") 36 | public void setValue(String _value) { 37 | setAttribute("value", _value); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /ShopifyProductsListDemo/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -keep class * implements android.os.Parcelable { 33 | public static final android.os.Parcelable$Creator *; 34 | } 35 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/Image.java: -------------------------------------------------------------------------------- 1 | // Last Generated: 2011-08-25T23:29:48-04:00 2 | package com.shopify.api.resources; 3 | 4 | import java.io.File; 5 | 6 | import org.codehaus.jackson.annotate.JsonIgnore; 7 | 8 | /** 9 | * This code has been machine generated by processing the single entry 10 | * fixtures found from the Shopify API Documentation 11 | */ 12 | 13 | public class Image extends MGImage { 14 | private static final String FILENAME = "filename"; 15 | private static final String ATTACHMENT = "attachment"; 16 | private static final String POSITION = "position"; 17 | 18 | private File image; 19 | 20 | @JsonIgnore 21 | public void setImage(File image) { 22 | this.image = image; 23 | } 24 | 25 | @JsonIgnore 26 | public File getImage() { 27 | return image; 28 | } 29 | 30 | public void setFilename(String filename) { 31 | setAttribute(FILENAME, filename); 32 | } 33 | 34 | public String getFilename() { return (String) getAttribute(FILENAME); } 35 | 36 | public void setPosition(int position) { 37 | setAttribute(POSITION, new Integer(position)); 38 | } 39 | 40 | public int getPosition() { 41 | return ((Integer) getAttribute(POSITION)).intValue(); 42 | } 43 | } -------------------------------------------------------------------------------- /ShopifyAPITests/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGReceipt.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in Receipt.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGReceipt extends ShopifyResource { 21 | 22 | @JsonProperty("authorization") 23 | public String getAuthorization() { 24 | return (String)getAttribute("authorization"); 25 | } 26 | @JsonProperty("authorization") 27 | public void setAuthorization(String _authorization) { 28 | setAttribute("authorization", _authorization); 29 | } 30 | 31 | @JsonProperty("testcase") 32 | public boolean getTestcase() { 33 | Boolean value = (Boolean)getAttribute("testcase"); 34 | return value != null ? value : false; 35 | } 36 | @JsonProperty("testcase") 37 | public void setTestcase(boolean _testcase) { 38 | setAttribute("testcase", _testcase); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/apache/commons/codec/overview.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 |

21 | This document is the API specification for the Apache Commons Codec Library, version 1.3. 22 |

23 |

24 | This library requires a JRE version of 1.2.2 or greater. 25 | The hypertext links originating from this document point to Sun's version 1.3 API as the 1.2.2 API documentation 26 | is no longer on-line. 27 |

28 | 29 | 30 | -------------------------------------------------------------------------------- /ShopifyAPITests/assets/fixtures/Asset/singleAsset.json: -------------------------------------------------------------------------------- 1 | { 2 | "asset": { 3 | "created_at": "2010-07-12T15:31:50-04:00", 4 | "updated_at": "2010-07-12T15:31:50-04:00", 5 | "public_url": null, 6 | "value": "\n

Featured Products

\n\n{% tablerow product in collections.frontpage.products cols:3 %}\n {{ product.featured_image | product_img_url: 'small' | img_tag }}\n

{{product.title}}

\n
    \n
  • {{product.price_min | money}}
  • \n
\n{% endtablerow %}\n
\n\n\n
\n \t{% assign article = pages.frontpage %}\n\n
\n {% if article.content != \"\" %}\n\t\t

{{ article.title }}

\n
\n \t\t {{ article.content }}\n \t\t
\n \t{% else %}\n
\n \t In Admin > Blogs & Pages, create a page with the handle frontpage and it will show up here.
\n \t {{ \"Learn more about handles\" | link_to \"http://wiki.shopify.com/Handle\" }}\n
\n \t{% endif %}\n
\n\n
\n\n", 7 | "key": "templates/index.liquid" 8 | } 9 | } -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGPaymentDetails.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in PaymentDetails.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGPaymentDetails extends ShopifyResource { 21 | 22 | @JsonProperty("credit_card_company") 23 | public String getCreditCardCompany() { 24 | return (String)getAttribute("credit_card_company"); 25 | } 26 | @JsonProperty("credit_card_company") 27 | public void setCreditCardCompany(String _credit_card_company) { 28 | setAttribute("credit_card_company", _credit_card_company); 29 | } 30 | 31 | @JsonProperty("credit_card_number") 32 | public String getCreditCardNumber() { 33 | return (String)getAttribute("credit_card_number"); 34 | } 35 | @JsonProperty("credit_card_number") 36 | public void setCreditCardNumber(String _credit_card_number) { 37 | setAttribute("credit_card_number", _credit_card_number); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/credentials/Credential.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.credentials; 2 | 3 | public class Credential { 4 | 5 | private String shopName; 6 | private String apiKey; 7 | private String password; 8 | private String sharedSecret; 9 | 10 | public Credential(String apiKey, String sharedSecret, String shopName) { 11 | this(apiKey, sharedSecret, shopName, null); 12 | } 13 | 14 | public Credential(String apiKey, String sharedSecret, String shopName, String password) { 15 | this.apiKey = apiKey; 16 | this.sharedSecret = sharedSecret; 17 | this.shopName = shopName; 18 | this.password = password; 19 | } 20 | 21 | // Beans nead null constructors 22 | public Credential() {} 23 | 24 | public String getApiKey() { 25 | return apiKey; 26 | } 27 | 28 | public void setApiKey(String apiKey) { 29 | this.apiKey = apiKey; 30 | } 31 | 32 | public String getShopName() { 33 | return shopName; 34 | } 35 | 36 | public void setShopName(String shopName) { 37 | this.shopName = shopName; 38 | } 39 | 40 | public String getPassword() { 41 | return password; 42 | } 43 | 44 | public void setPassword(String password) { 45 | this.password = password; 46 | } 47 | 48 | public String getSharedSecret() { 49 | return sharedSecret; 50 | } 51 | 52 | public void setSharedSecret(String sharedSecret) { 53 | this.sharedSecret = sharedSecret; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGShippingLine.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in ShippingLine.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGShippingLine extends ShopifyResource { 21 | 22 | @JsonProperty("code") 23 | public String getCode() { 24 | return (String)getAttribute("code"); 25 | } 26 | @JsonProperty("code") 27 | public void setCode(String _code) { 28 | setAttribute("code", _code); 29 | } 30 | 31 | @JsonProperty("price") 32 | public String getPrice() { 33 | return (String)getAttribute("price"); 34 | } 35 | @JsonProperty("price") 36 | public void setPrice(String _price) { 37 | setAttribute("price", _price); 38 | } 39 | 40 | @JsonProperty("title") 41 | public String getTitle() { 42 | return (String)getAttribute("title"); 43 | } 44 | @JsonProperty("title") 45 | public void setTitle(String _title) { 46 | setAttribute("title", _title); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/android/AuthorizationHelper.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.android; 2 | 3 | import java.net.URI; 4 | 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.net.Uri; 8 | 9 | import com.shopify.api.APIAuthorization; 10 | import com.shopify.api.credentials.Credential; 11 | import com.shopify.api.credentials.ShopifyCredentialsStore; 12 | 13 | public class AuthorizationHelper { 14 | ShopifyCredentialsStore store; 15 | String apiKey, sharedSecret; 16 | 17 | public AuthorizationHelper(Context ctx, ShopifyCredentialsStore store, int apiKeyId, int apiSecretId) { 18 | this(ctx, store, ctx.getString(apiKeyId), ctx.getString(apiSecretId)); 19 | } 20 | 21 | public AuthorizationHelper(Context ctx, ShopifyCredentialsStore store, String apiKey, String apiSecret) { 22 | this.apiKey = apiKey; 23 | this.sharedSecret = apiSecret; 24 | this.store = store; 25 | } 26 | 27 | public void sendAuthRequest(Context ctx, String shopname) throws Exception{ 28 | Credential cred = new Credential(apiKey, sharedSecret, shopname); 29 | store.saveCredential(cred); 30 | 31 | APIAuthorization auth = new APIAuthorization(cred); 32 | URI authRequest = auth.generateAuthRequest(); 33 | Intent launchBrowser = new Intent(Intent.ACTION_VIEW); 34 | launchBrowser.setData(Uri.parse(authRequest.toString())); 35 | ctx.startActivity(launchBrowser); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/endpoints/AuthAPI.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.endpoints; 2 | 3 | import java.net.URI; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | 7 | import com.shopify.api.APIAuthorization; 8 | import com.shopify.api.resources.ShopifyResource; 9 | 10 | public class AuthAPI extends API { 11 | private static final String AUTH_API_ENDPOINT = "api/auth"; 12 | 13 | public AuthAPI(APIAuthorization auth) { 14 | super(auth); 15 | setContentTypeExtension(APIResponseContent.NONE); 16 | } 17 | 18 | @Override 19 | public ShopifyResource findById(int id) { 20 | // TODO Auto-generated method stub 21 | return null; 22 | } 23 | 24 | @Override 25 | public List findByQuery(HashMap queryParams) { 26 | // TODO Auto-generated method stub 27 | return null; 28 | } 29 | 30 | @Override 31 | public List getAll() { 32 | // TODO Auto-generated method stub 33 | return null; 34 | } 35 | 36 | @Override 37 | public int getCount() { 38 | // TODO Auto-generated method stub 39 | return 0; 40 | } 41 | 42 | public String getAPIEndpoint() { 43 | return AUTH_API_ENDPOINT; 44 | } 45 | 46 | public URI getAuthRequestURI() { 47 | HashMap params = new HashMap(){{ 48 | put("api_key", getApiAuth().getCredential().getApiKey()); 49 | }}; 50 | return constructURI(params); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGAsset.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in Asset.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGAsset extends ShopifyResource { 21 | 22 | @JsonProperty("key") 23 | public String getKey() { 24 | return (String)getAttribute("key"); 25 | } 26 | @JsonProperty("key") 27 | public void setKey(String _key) { 28 | setAttribute("key", _key); 29 | } 30 | 31 | @JsonProperty("public_url") 32 | public String getPublicUrl() { 33 | return (String)getAttribute("public_url"); 34 | } 35 | @JsonProperty("public_url") 36 | public void setPublicUrl(String _public_url) { 37 | setAttribute("public_url", _public_url); 38 | } 39 | 40 | @JsonProperty("value") 41 | public String getValue() { 42 | return (String)getAttribute("value"); 43 | } 44 | @JsonProperty("value") 45 | public void setValue(String _value) { 46 | setAttribute("value", _value); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGCountry.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in Country.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGCountry extends ShopifyResource { 21 | 22 | @JsonProperty("code") 23 | public String getCode() { 24 | return (String)getAttribute("code"); 25 | } 26 | @JsonProperty("code") 27 | public void setCode(String _code) { 28 | setAttribute("code", _code); 29 | } 30 | 31 | @JsonProperty("name") 32 | public String getName() { 33 | return (String)getAttribute("name"); 34 | } 35 | @JsonProperty("name") 36 | public void setName(String _name) { 37 | setAttribute("name", _name); 38 | } 39 | 40 | @JsonProperty("tax") 41 | public double getTax() { 42 | Double value = (Double)getAttribute("tax"); 43 | return value != null ? value : 0.0; 44 | } 45 | @JsonProperty("tax") 46 | public void setTax(double _tax) { 47 | setAttribute("tax", _tax); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGWebhook.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in Webhook.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGWebhook extends ShopifyResource { 21 | 22 | @JsonProperty("address") 23 | public String getAddress() { 24 | return (String)getAttribute("address"); 25 | } 26 | @JsonProperty("address") 27 | public void setAddress(String _address) { 28 | setAttribute("address", _address); 29 | } 30 | 31 | @JsonProperty("format") 32 | public String getFormat() { 33 | return (String)getAttribute("format"); 34 | } 35 | @JsonProperty("format") 36 | public void setFormat(String _format) { 37 | setAttribute("format", _format); 38 | } 39 | 40 | @JsonProperty("topic") 41 | public String getTopic() { 42 | return (String)getAttribute("topic"); 43 | } 44 | @JsonProperty("topic") 45 | public void setTopic(String _topic) { 46 | setAttribute("topic", _topic); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /ShopifyAPI/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class * extends android.app.backup.BackupAgentHelper 14 | -keep public class * extends android.preference.Preference 15 | -keep public class com.android.vending.licensing.ILicensingService 16 | 17 | -keepclasseswithmembernames class * { 18 | native ; 19 | } 20 | 21 | -keepclasseswithmembers class * { 22 | public (android.content.Context, android.util.AttributeSet); 23 | } 24 | 25 | -keepclasseswithmembers class * { 26 | public (android.content.Context, android.util.AttributeSet, int); 27 | } 28 | 29 | -keepclassmembers class * extends android.app.Activity { 30 | public void *(android.view.View); 31 | } 32 | 33 | -keepclassmembers enum * { 34 | public static **[] values(); 35 | public static ** valueOf(java.lang.String); 36 | } 37 | 38 | -keep class * implements android.os.Parcelable { 39 | public static final android.os.Parcelable$Creator *; 40 | } 41 | -------------------------------------------------------------------------------- /ShopifyAPITests/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class * extends android.app.backup.BackupAgentHelper 14 | -keep public class * extends android.preference.Preference 15 | -keep public class com.android.vending.licensing.ILicensingService 16 | 17 | -keepclasseswithmembernames class * { 18 | native ; 19 | } 20 | 21 | -keepclasseswithmembers class * { 22 | public (android.content.Context, android.util.AttributeSet); 23 | } 24 | 25 | -keepclasseswithmembers class * { 26 | public (android.content.Context, android.util.AttributeSet, int); 27 | } 28 | 29 | -keepclassmembers class * extends android.app.Activity { 30 | public void *(android.view.View); 31 | } 32 | 33 | -keepclassmembers enum * { 34 | public static **[] values(); 35 | public static ** valueOf(java.lang.String); 36 | } 37 | 38 | -keep class * implements android.os.Parcelable { 39 | public static final android.os.Parcelable$Creator *; 40 | } 41 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGTaxLine.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in TaxLine.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGTaxLine extends ShopifyResource { 21 | 22 | @JsonProperty("price") 23 | public String getPrice() { 24 | return (String)getAttribute("price"); 25 | } 26 | @JsonProperty("price") 27 | public void setPrice(String _price) { 28 | setAttribute("price", _price); 29 | } 30 | 31 | @JsonProperty("rate") 32 | public double getRate() { 33 | Double value = (Double)getAttribute("rate"); 34 | return value != null ? value : 0.0; 35 | } 36 | @JsonProperty("rate") 37 | public void setRate(double _rate) { 38 | setAttribute("rate", _rate); 39 | } 40 | 41 | @JsonProperty("title") 42 | public String getTitle() { 43 | return (String)getAttribute("title"); 44 | } 45 | @JsonProperty("title") 46 | public void setTitle(String _title) { 47 | setAttribute("title", _title); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /ShopifyProductsListDemo/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGRule.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in Rule.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGRule extends ShopifyResource { 21 | 22 | @JsonProperty("column") 23 | public String getColumn() { 24 | return (String)getAttribute("column"); 25 | } 26 | @JsonProperty("column") 27 | public void setColumn(String _column) { 28 | setAttribute("column", _column); 29 | } 30 | 31 | @JsonProperty("condition") 32 | public String getCondition() { 33 | return (String)getAttribute("condition"); 34 | } 35 | @JsonProperty("condition") 36 | public void setCondition(String _condition) { 37 | setAttribute("condition", _condition); 38 | } 39 | 40 | @JsonProperty("relation") 41 | public String getRelation() { 42 | return (String)getAttribute("relation"); 43 | } 44 | @JsonProperty("relation") 45 | public void setRelation(String _relation) { 46 | setAttribute("relation", _relation); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/json/ShopifyRequestWriter.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.resources.json; 2 | 3 | import java.io.IOException; 4 | import java.io.StringWriter; 5 | import java.io.Writer; 6 | 7 | import org.codegist.crest.serializer.Serializer; 8 | import org.codehaus.jackson.JsonFactory; 9 | import org.codehaus.jackson.JsonGenerator; 10 | import org.codehaus.jackson.map.ObjectMapper; 11 | 12 | import com.shopify.api.resources.ShopifyResource; 13 | 14 | public class ShopifyRequestWriter implements Serializer{ 15 | ObjectMapper mapper; 16 | JsonFactory factory; 17 | 18 | public ShopifyRequestWriter() { 19 | this(new ObjectMapper()); 20 | } 21 | 22 | public ShopifyRequestWriter(ObjectMapper mapper) { 23 | this.mapper = mapper; 24 | this.factory = mapper.getJsonFactory(); 25 | } 26 | 27 | public void write(Writer output, ShopifyResource resource) throws IOException{ 28 | JsonGenerator generator = factory.createJsonGenerator(output); 29 | 30 | generator.writeStartObject(); 31 | generator.writeObjectField(resource.getClass().getSimpleName().toLowerCase(), resource); 32 | generator.writeEndObject(); 33 | 34 | generator.close(); 35 | output.flush(); 36 | } 37 | 38 | public String serialize(ShopifyResource value) { 39 | StringWriter w = new StringWriter(); 40 | try { 41 | write(w, value); 42 | } catch (IOException e) { 43 | return "COULD NOT SERIALIZE!"; 44 | } 45 | return w.toString(); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/handlers/ShopifyResponseHandler.java: -------------------------------------------------------------------------------- 1 | package com.shopify.api.handlers; 2 | 3 | import java.io.InputStream; 4 | import java.util.Map; 5 | 6 | import org.codegist.crest.CRestException; 7 | import org.codegist.crest.ResponseContext; 8 | import org.codegist.crest.handler.ResponseHandler; 9 | import org.codehaus.jackson.JsonNode; 10 | import org.codehaus.jackson.map.ObjectMapper; 11 | 12 | import com.shopify.api.resources.ShopifyResource; 13 | 14 | public class ShopifyResponseHandler implements ResponseHandler { 15 | 16 | private ObjectMapper mapper; 17 | 18 | public ShopifyResponseHandler(Map parameters) { 19 | mapper = new ObjectMapper(); 20 | } 21 | 22 | public Object handle(ResponseContext context) throws CRestException { 23 | if (context.getExpectedType() == void.class) { 24 | return null; 25 | } 26 | try { 27 | InputStream stream = context.getResponse().asStream(); 28 | JsonNode node = mapper.readValue(stream, JsonNode.class); 29 | Object deserialized = mapper.readValue(node.iterator().next(), context.getExpectedType()); 30 | if(deserialized instanceof ShopifyResource) { 31 | ((ShopifyResource) deserialized).clean(); 32 | } 33 | return deserialized; 34 | } catch (Exception e) { 35 | CRestException newexc = new CRestException(e.getMessage(), e.getCause()); 36 | newexc.setStackTrace(e.getStackTrace()); 37 | throw newexc; 38 | } finally { 39 | context.getResponse().close(); 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGImage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in Image.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGImage extends ShopifyResource { 21 | 22 | @JsonProperty("position") 23 | public int getPosition() { 24 | Integer value = (Integer)getAttribute("position"); 25 | return value != null ? value : 0; 26 | } 27 | @JsonProperty("position") 28 | public void setPosition(int _position) { 29 | setAttribute("position", _position); 30 | } 31 | 32 | @JsonProperty("product_id") 33 | public int getProductId() { 34 | Integer value = (Integer)getAttribute("product_id"); 35 | return value != null ? value : 0; 36 | } 37 | @JsonProperty("product_id") 38 | public void setProductId(int _product_id) { 39 | setAttribute("product_id", _product_id); 40 | } 41 | 42 | @JsonProperty("src") 43 | public String getSrc() { 44 | return (String)getAttribute("src"); 45 | } 46 | @JsonProperty("src") 47 | public void setSrc(String _src) { 48 | setAttribute("src", _src); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /ShopifyProductsListDemo/res/layout/add_shop_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 13 | 19 | 25 |