-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from VictorKabata/feat/android-sample
Added android sample for M-Pesa Express
- Loading branch information
Showing
7 changed files
with
108 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
samples/android/app/src/main/java/com/vickbt/daraja/android/DarajaAndroidApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.vickbt.daraja.android | ||
|
||
import android.app.Application | ||
import com.vickbt.daraja.android.di.appModule | ||
import org.koin.android.ext.koin.androidContext | ||
import org.koin.core.context.startKoin | ||
|
||
class DarajaAndroidApplication:Application() { | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
|
||
startKoin { | ||
androidContext(this@DarajaAndroidApplication) | ||
modules(appModule) | ||
} | ||
|
||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
samples/android/app/src/main/java/com/vickbt/daraja/android/di/AppModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.vickbt.daraja.android.di | ||
|
||
import com.vickbt.darajakmp.Daraja | ||
import org.koin.dsl.module | ||
|
||
val appModule = module { | ||
// Provide a single instance of Daraja | ||
single { | ||
Daraja.Builder() | ||
.setConsumerKey("consumer_key") | ||
.setConsumerSecret("consumer_secret") | ||
.setPassKey("pass_key") | ||
.isSandbox() | ||
.build() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters