Skip to content

Commit

Permalink
switching to offline module
Browse files Browse the repository at this point in the history
  • Loading branch information
issotina committed Jun 4, 2018
1 parent 7f2586a commit c0176b1
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 15 deletions.
3 changes: 2 additions & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Expand Down
6 changes: 5 additions & 1 deletion sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="co.opensi.kkiapay_sdk">

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

<application
android:allowBackup="true"
Expand All @@ -18,6 +18,10 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Main2Activity"
android:label="@string/title_activity_main2"
android:theme="@style/AppTheme.NoActionBar"></activity>
</application>

</manifest>
34 changes: 33 additions & 1 deletion sample/src/main/java/co/opensi/kkiapay_sdk/MA.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
package co.opensi.kkiapay_sdk;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import org.jetbrains.annotations.NotNull;

import co.opensi.kkiapay.KKiapayCallback;
import co.opensi.kkiapay.KkiaPay;
import co.opensi.kkiapay.STATUS;
import co.opensi.kkiapay.Subscriber;
import kotlin.Unit;
import kotlin.jvm.functions.Function2;

/**
* Created by geecko on 6/4/18.
*/

public class MA {
public class MA extends AppCompatActivity {


@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

KkiaPay manager = new KkiaPay("");

Subscriber subscriber = new Subscriber("22967434270","ALI","SHAD");

manager.to(subscriber)
.take(1500, new KKiapayCallback() {
@Override
public void onResponse(@NotNull STATUS status, @NotNull String phone) {

}
});

}
}
33 changes: 21 additions & 12 deletions sample/src/main/java/co/opensi/kkiapay_sdk/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package co.opensi.kkiapay_sdk
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import co.opensi.kkiapay.*
import co.opensi.kkiapay.KkiaPay
import co.opensi.kkiapay.STATUS
import co.opensi.kkiapay.debit


class MainActivity : AppCompatActivity() {
Expand All @@ -14,23 +16,30 @@ class MainActivity : AppCompatActivity() {
setContentView(R.layout.activity_main)


KkiaPay("<kkiapay-api-key>")
//should be replaced with the correct api-key



//inline sample
("22967434270" debit 10) { status, _ -> Log.e("end",status.toString()) }


//Initialisation de l'API
KkiaPay("DSKGFF45VSVQFBVF2FSRVSFDX7DZ6VQ4SSV5")

// send more information about user
//usefull on dashboard.kkiapay.me
from {
phoneNumber = "222"
firstName = "ALI"
lastName = "ARC"
}.debit(10) { status: STATUS, s: String -> }
//Débit de 1500 a l'utilisateur dont le numero de téléphone est 67 43 42 70
("22967434270" debit 1500) {

status, _ -> when (status) {


STATUS.SUCCESS -> displayToUser("Bravooo")
}

}


}


fun displayToUser( a: String){

}

Expand Down
1 change: 1 addition & 0 deletions sample/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<resources>
<string name="app_name">KKIAPAY-ANDROID-SDK</string>
<string name="title_activity_main2">Main2Activity</string>
</resources>
9 changes: 9 additions & 0 deletions sample/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,13 @@
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

</resources>

0 comments on commit c0176b1

Please sign in to comment.