Skip to content

Commit

Permalink
RSA KEY now a constant fixed in library.
Browse files Browse the repository at this point in the history
Publishable key must not be null or empty and must start with pk_

TargetSdk is now 23
Robo Electric had to be updated to 3.1-SNAPSHOT (An unstable version) to continue working with it for testing
Added explanations for most parameters
  • Loading branch information
ibrahimlawal committed Jan 26, 2016
1 parent aa0345a commit 0df1adf
Show file tree
Hide file tree
Showing 46 changed files with 1,530 additions and 1,579 deletions.
6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 0 additions & 19 deletions Paystack.iml

This file was deleted.

13 changes: 7 additions & 6 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "co.paystack.example"
minSdkVersion 9
targetSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
Expand All @@ -30,18 +30,19 @@ dependencies {

testCompile 'junit:junit:4.12'
testCompile "org.assertj:assertj-core:1.7.0"
testCompile 'org.robolectric:robolectric:3.0'
testCompile 'org.robolectric:robolectric:3.1-SNAPSHOT'
testCompile 'org.mockito:mockito-core:1.9.5'

//compile 'co.paystack.android:paystack:1.0.2'
//compile 'co.paystack:paystack:1.0.1'
//compile project(':paystack')
compile project(':paystack')
}

repositories {
maven {
url 'https://dl.bintray.com/paystack/maven/'
}
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}

dependencies {
Expand Down
49 changes: 24 additions & 25 deletions example/example.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":example" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="Paystack" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<module external.linked.project.id=":example" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="paystack-android" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
Expand Down Expand Up @@ -67,62 +67,61 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/debug" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/co.paystack.android/paystack/1.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/mockable-android-23.jar" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" scope="TEST" name="asm-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-utils-3.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="shadows-core-3.1-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-annotations-3.1-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="xpp3_min-1.1.4c" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-utils-3.1-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" name="retrofit-1.6.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-library-1.3" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.1.1" level="project" />
<orderEntry type="library" exported="" name="parceler-api-0.2.13" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="protobuf-java-2.6.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="ant-1.8.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="accessibility-test-framework-1.0" level="project" />
<orderEntry type="library" exported="" name="paystack-1.0.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-3.1-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="accessibility-test-framework-2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="bcprov-jdk16-1.46" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="maven-ant-tasks-2.1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="sqlite4java-0.282" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-resources-3.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-annotations-3.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="shadows-core-3.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-commons-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="xmlpull-1.1.3.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-resources-3.1-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="vtd-xml-2.11" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-commons-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-tree-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-analysis-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="mockito-core-1.9.5" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="xstream-1.4.8" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.1.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="icu4j-53.1" level="project" />
<orderEntry type="library" exported="" name="parceler-0.2.13" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="ant-launcher-1.8.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-3.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="objenesis-1.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="guava-19.0-rc2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-util-5.0.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.0.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="assertj-core-1.7.0" level="project" />
<orderEntry type="library" exported="" name="gson-2.3" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.0" level="project" />
<orderEntry type="library" exported="" name="gson-2.4" level="project" />
<orderEntry type="module" module-name="paystack" exported="" />
</component>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
}
16 changes: 8 additions & 8 deletions example/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="co.paystack.example" >
<manifest package="co.paystack.example"
xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET"/>

<application
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:name=".App"
android:theme="@style/AppTheme" >
android:theme="@style/AppTheme">

<!-- metadata for paystack -->
<meta-data
android:name="co.paystack.android.PublishableKey"
android:value="your publishable key"/>
android:value="pk_test"/>

<activity
android:name=".MainActivity"
android:label="@string/app_name" >
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

Expand Down
40 changes: 21 additions & 19 deletions example/src/main/java/co/paystack/example/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,35 @@
import android.content.Context;

/**
* Created by Segun Famisa {[email protected]} on 9/22/15.
* The Example App
*
* This class allows us capture the application context and capture the app instance
*/
public class App extends Application {

private static Context sContext;
private static Context sContext;

private static App sInstance;
private static App sInstance;

@Override
public void onCreate() {
super.onCreate();

sInstance = this;
sContext = getApplicationContext();

setAppContext(sContext);
}

public static Context getAppContext(){
public static Context getAppContext() {
// if(sContext == null){
// return getApplica;
// }

return sContext;
}
return sContext;
}

private void setAppContext(Context context) {
sContext = context;
}

@Override
public void onCreate() {
super.onCreate();

sInstance = this;
sContext = getApplicationContext();

private void setAppContext(Context context){
sContext = context;
}
setAppContext(sContext);
}
}
Loading

0 comments on commit 0df1adf

Please sign in to comment.