Git Product home page Git Product logo

pietrogirardi / mobile-buy-sdk-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shopify/mobile-buy-sdk-android

0.0 2.0 0.0 2.24 MB

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using their credit card.

License: MIT License

Shell 0.53% Java 99.47%

mobile-buy-sdk-android's Introduction

Mobile Buy SDK

GitHub license Build status GitHub release

Mobile Buy SDK for Android

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using their credit card.

Documentation

Please find all documentation on the Mobile Buy SDK for Android page.

Requirements

  • ** Android SDK Level 14 (Ice Cream Sandwich 4.0) or higher
  • ** JDK 1.7 **
  • Android studio 1.3.x or greater recommended
  • The Mobile App sales channel added to your Shopify store

Building the SDK

Clone this repo or download as .zip and import the build.gradle file into Android Studio.

The workspace includes the Mobile Buy SDK project and a sample app which demonstrates all of the features of the SDK.

Modules

The Mobile Buy SDK includes a two modules.

  • buy: This is the Mobile Buy SDK framework. This is an Android library project.
  • sample: This is an Android app module which demonstrates how to use the SDK. For more details please refer to the Sample App Guide.

Gradle Targets

There are a number of custom gradle targets defined in the buy module. These can be invoked on the command line with ./gradlew

  • javadoc - generates the javadoc for the project
  • javadocJar - generates the javadoc, and wraps it in a jar
  • archiveReleasePackage - builds the release buy release aar, javadoc, and bundles it all together in a zip file ready for distribution. The output will be in buy/build/distributions
  • bintrayUpload - publishes a new release to Bintray's jCenter repository (for Shopify internal use only).

Integration

The simplest way to use the Mobile Buy SDK in your project is to add the following jCenter dependency to your build.gradle file:

compile 'com.shopify.mobilebuysdk:buy:1.2.4'

The Integration Guide also contains step-by-step instructions and sample code for integrating the Mobile Buy SDK into your application. The sample module in the Android Studio project is also a great resource.

Running the Tests

There are two ways to run the integration tests in the SDK:

  1. With mocked network responses from a pre-defined shop.
  2. With live network responses from a shop of your choosing.

In either case, you will need to create a shop.properties file in the MobileBuy project directory with this format:

SHOP_DOMAIN=myshop.myshopify.com
API_KEY=0123456789abcdefghijklmnopqrstuvwxyz
CHANNEL_ID=2345678

DO NOT CHECK THE shop.properties FILE INTO GIT

You can start the tests by running the Tests in 'com.shopify.buy' target in Android Studio. You can also right-click on the buy module in the Project hierarchy and select Run -> Tests in 'buy'.

Testing with mocked network responses

The integration tests with the mocked network responses do not require any internet connection and run very quickly. To use this mode, simply remove the values from your shop.properties file:

SHOP_DOMAIN=
API_KEY=
CHANNEL_ID=

Testing with live network responses

To run the integration tests against an actual shop, you will need a Shopify shop that is publicly accessible (not password protected). Please note that the integration tests will create an order on that shop. This is to validate that the SDK works properly with Shopify. Modify the test_shop_data.json file to contain your shop's credentials and the required product IDs, gift cards, and discounts as necessary. Also, make sure that your shop.properties file has the correct credentials for your shop.

Some notes about test_shop_data.json:

  • The gift_cards array contains three valid gift cards, one expired gift card, and one invalid gift card. Make sure that the value field contains the correct dollar amount for each gift card.
  • The discounts array contains one expired discount code and one valid discount code. Make sure that the value field contains the correct dollar amount (or percentage amount) for each discount.

How Can I Contribute?

We welcome contributions. Follow the steps in the CONTRIBUTING file.

License

The Mobile Buy SDK is provided under an MIT Licence. See the LICENSE file.

mobile-buy-sdk-android's People

Contributors

krisorr avatar dave-pelletier avatar sander-m avatar see-mack avatar joshubrown avatar joshuaching avatar

Watchers

James Cloos avatar Pietro Girardi avatar

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.