Skip to content

Commit 7404c5e

Browse files
committed
fixed ktlint issues
1 parent 7826512 commit 7404c5e

File tree

6 files changed

+21
-22
lines changed

6 files changed

+21
-22
lines changed

thepeer-android/src/main/java/co/thepeer/sdk/Thepeer.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Thepeer internal constructor(
2323
private val publicKey: String,
2424
private val userReference: String,
2525
private var resultRegistry: ActivityResultLauncher<ThepeerParam>,
26-
private val activity: AppCompatActivity,
26+
private val activity: AppCompatActivity
2727
) {
2828

2929
/**
@@ -34,14 +34,14 @@ class Thepeer internal constructor(
3434
class Initiate(
3535
private val userReference: String,
3636
private val activity: AppCompatActivity,
37-
private val resultListener: ThepeerResultListener,
37+
private val resultListener: ThepeerResultListener
3838

3939
) {
4040
private var publicKey = ""
4141

4242
val resultRegistry = activity.registerForActivityResult(
4343
ThepeerResultContract(),
44-
activity.activityResultRegistry,
44+
activity.activityResultRegistry
4545
) { chargeResult ->
4646
when (chargeResult) {
4747
is ThepeerResult.Success -> resultListener.onSuccess(chargeResult.response)
@@ -56,15 +56,15 @@ class Thepeer internal constructor(
5656
if (publicKey.isEmpty()) {
5757
error(
5858
"Add publicKey from business " +
59-
"dashboard as meta data to manifest file. Check documentation",
59+
"dashboard as meta data to manifest file. Check documentation"
6060
)
6161
}
6262
}
6363

6464
private fun getPublicKeyFromManifest(context: Context): String {
6565
val applicationInfo = context.packageManager.getApplicationInfo(
6666
context.packageName,
67-
PackageManager.GET_META_DATA,
67+
PackageManager.GET_META_DATA
6868
)
6969
return applicationInfo.metaData?.getString(ThepeerConstants.PUBLIC_KEY_FROM_MANIFEST)
7070
.orEmpty()
@@ -75,7 +75,7 @@ class Thepeer internal constructor(
7575
publicKey,
7676
userReference,
7777
resultRegistry,
78-
activity,
78+
activity
7979
)
8080
}
8181
}
@@ -85,7 +85,7 @@ class Thepeer internal constructor(
8585
* @param config is the transaction specific configurations.
8686
*/
8787
fun send(
88-
config: ThepeerConfig,
88+
config: ThepeerConfig
8989
) {
9090
val params = ThepeerParam(
9191
publicKey,
@@ -94,7 +94,7 @@ class Thepeer internal constructor(
9494
config.currency,
9595
userReference,
9696
null,
97-
config.meta,
97+
config.meta
9898
)
9999
resultRegistry.launch(params)
100100
}
@@ -106,7 +106,7 @@ class Thepeer internal constructor(
106106
*/
107107
fun checkout(
108108
emailAddress: String,
109-
config: ThepeerConfig,
109+
config: ThepeerConfig
110110
) {
111111
val params = ThepeerParam(
112112
publicKey,
@@ -115,7 +115,7 @@ class Thepeer internal constructor(
115115
config.currency,
116116
userReference,
117117
emailAddress,
118-
config.meta,
118+
config.meta
119119
)
120120

121121
resultRegistry.launch(params)
@@ -126,7 +126,7 @@ class Thepeer internal constructor(
126126
* @param config is the transaction specific configurations.
127127
*/
128128
fun directCharge(
129-
config: ThepeerConfig,
129+
config: ThepeerConfig
130130
) {
131131
val params = ThepeerParam(
132132
publicKey,
@@ -135,7 +135,7 @@ class Thepeer internal constructor(
135135
config.currency,
136136
userReference,
137137
null,
138-
config.meta,
138+
config.meta
139139
)
140140
resultRegistry.launch(params)
141141
}

thepeer-android/src/main/java/co/thepeer/sdk/model/ThePeerTransaction.kt renamed to thepeer-android/src/main/java/co/thepeer/sdk/model/ThepeerEvent.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ package co.thepeer.sdk.model
22

33
import android.os.Parcelable
44
import kotlinx.parcelize.Parcelize
5-
import java.math.BigDecimal
65

76
@Parcelize
87
data class ThepeerEvent(
98
val event: String
10-
) : Parcelable
9+
) : Parcelable

thepeer-android/src/main/java/co/thepeer/sdk/model/ThepeerParam.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ data class ThepeerParam(
1515
val currency: String,
1616
val userReference: String,
1717
val emailAddress: String? = null,
18-
val meta: Map<String, String>,
18+
val meta: Map<String, String>
1919
) : Parcelable
2020

2121
enum class ThepeerSDKType { SEND, CHECKOUT, DIRECT_CHARGE, NONE }
@@ -26,5 +26,5 @@ enum class ThepeerSDKType { SEND, CHECKOUT, DIRECT_CHARGE, NONE }
2626
data class ThepeerConfig(
2727
val amount: BigDecimal,
2828
val currency: String,
29-
val meta: Map<String, String> = emptyMap(),
29+
val meta: Map<String, String> = emptyMap()
3030
)

thepeer-android/src/main/java/co/thepeer/sdk/ui/activity/ThepeerSdkActivity.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ internal class ThepeerSdkActivity : AppCompatActivity() {
3636
params = if (Build.VERSION.SDK_INT >= 33) {
3737
intent.getParcelableExtra(
3838
ThepeerConstants.THE_PEER_PARAMS,
39-
ThepeerParam::class.java,
39+
ThepeerParam::class.java
4040
)
4141
} else {
4242
intent.getParcelableExtra<ThepeerParam>(ThepeerConstants.THE_PEER_PARAMS)
@@ -76,7 +76,7 @@ internal class ThepeerSdkActivity : AppCompatActivity() {
7676
override fun onReceivedError(
7777
view: WebView?,
7878
request: WebResourceRequest?,
79-
error: WebResourceError?,
79+
error: WebResourceError?
8080
) {
8181
if (error != null) {
8282
showNetworkErrorRetryView()
@@ -85,7 +85,7 @@ internal class ThepeerSdkActivity : AppCompatActivity() {
8585

8686
override fun shouldOverrideUrlLoading(
8787
view: WebView?,
88-
request: WebResourceRequest?,
88+
request: WebResourceRequest?
8989
): Boolean {
9090
startActivity(Intent(Intent.ACTION_VIEW, request?.url))
9191
return true
@@ -96,7 +96,7 @@ internal class ThepeerSdkActivity : AppCompatActivity() {
9696
WebInterface { results ->
9797
redirectWithResult(results)
9898
},
99-
"Android",
99+
"Android"
100100
)
101101

102102
binding.webViewPeer.loadUrl(transactionUrl)

thepeer-android/src/main/java/co/thepeer/sdk/utils/Urls.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ internal object Urls {
1515
"userReference" to data.userReference,
1616
"email" to data.emailAddress,
1717
"sdkType" to data.sdkType,
18-
"meta" to Gson().toJson(data.meta),
18+
"meta" to Gson().toJson(data.meta)
1919
)
2020

2121
for (k in params.keys) {

thepeer-android/src/main/java/co/thepeer/sdk/utils/WebInterface.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ internal class WebInterface(private val redirect: (ThepeerResult) -> Unit) {
6666
}
6767
}
6868

69-
fun handleDirectDebitEvent(event: ThepeerEvent, response: String) {
69+
fun handleDirectDebitEvent(event: ThepeerEvent, response: String) {
7070
when (event.event) {
7171
DIRECT_CHARGE_SUCCESS -> {
7272
redirect(ThepeerResult.Success(response))

0 commit comments

Comments
 (0)