Skip to content

Commit 85fc29e

Browse files
committed
changed naming sdk to SDK
1 parent 4569ddb commit 85fc29e

File tree

5 files changed

+28
-31
lines changed

5 files changed

+28
-31
lines changed

thepeer-android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<application>
99
<activity
10-
android:name=".ui.activity.ThepeerSdkActivity"
10+
android:name=".ui.activity.ThepeerSDKActivity"
1111
android:theme="@style/ThepeerSDKTheme"
1212
android:screenOrientation="portrait"
1313
/>

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import androidx.activity.result.ActivityResultLauncher
66
import androidx.appcompat.app.AppCompatActivity
77
import co.thepeer.sdk.model.ThepeerParam
88
import co.thepeer.sdk.model.ThepeerResult
9-
import co.thepeer.sdk.model.ThepeerSdkType
9+
import co.thepeer.sdk.model.ThepeerSDKType
1010
import co.thepeer.sdk.ui.ThepeerResultContract
1111
import co.thepeer.sdk.ui.ThepeerResultListener
1212
import co.thepeer.sdk.utils.ThepeerConstants
1313
import java.math.BigDecimal
1414

1515
/**
16-
* This is Thepeer SDk class instance
16+
* This is Thepeer SDK class instance
1717
* @param activity -> Required to launch the drop in UI activity
1818
* @param publicKey -> Required to authenticate the merchant
1919
* @param resultRegistry -> used to register the activity for result
@@ -24,7 +24,7 @@ import java.math.BigDecimal
2424
*/
2525
class Thepeer internal constructor(
2626
private var publicKey: String,
27-
private var resultRegistry: ActivityResultLauncher< ThepeerParam>,
27+
private var resultRegistry: ActivityResultLauncher<ThepeerParam>,
2828
private var activity: AppCompatActivity,
2929
private var amount: BigDecimal,
3030
private var currency: String,
@@ -49,15 +49,15 @@ class Thepeer internal constructor(
4949
) {
5050

5151
var resultRegistry = activity.registerForActivityResult(
52-
ThepeerResultContract(),
53-
activity.activityResultRegistry
54-
) { chargeResult ->
55-
when (chargeResult) {
56-
is ThepeerResult.Success -> resultListener.onSuccess(chargeResult.transaction)
57-
is ThepeerResult.Error -> resultListener.onError(chargeResult.error)
58-
ThepeerResult.Cancelled -> resultListener.onCancelled()
59-
}
60-
}
52+
ThepeerResultContract(),
53+
activity.activityResultRegistry
54+
) { chargeResult ->
55+
when (chargeResult) {
56+
is ThepeerResult.Success -> resultListener.onSuccess(chargeResult.transaction)
57+
is ThepeerResult.Error -> resultListener.onError(chargeResult.error)
58+
ThepeerResult.Cancelled -> resultListener.onCancelled()
59+
}
60+
}
6161
private var publicKey = getPublicKeyFromManifest(activity)
6262

6363
private var meta: Map<String, String> = emptyMap()
@@ -111,9 +111,9 @@ class Thepeer internal constructor(
111111
* This function will be called to launch ThePeer Send Money Widget
112112
*/
113113
fun send() {
114-
val params = ThepeerParam(
114+
val params = ThepeerParam(
115115
publicKey,
116-
getSdkType(ThepeerSdkType.SEND),
116+
getSdkType(ThepeerSDKType.SEND),
117117
amount,
118118
currency,
119119
userReference,
@@ -132,7 +132,7 @@ class Thepeer internal constructor(
132132
fun checkout(emailAddress: String) {
133133
val params = ThepeerParam(
134134
publicKey,
135-
getSdkType(ThepeerSdkType.CHECKOUT),
135+
getSdkType(ThepeerSDKType.CHECKOUT),
136136
amount,
137137
currency,
138138
userReference,
@@ -149,9 +149,9 @@ class Thepeer internal constructor(
149149
* This function will be called to launch ThePeer Direct Charge Widget
150150
*/
151151
fun directCharge() {
152-
val params = ThepeerParam(
152+
val params = ThepeerParam(
153153
publicKey,
154-
getSdkType(ThepeerSdkType.DIRECT_CHARGE),
154+
getSdkType(ThepeerSDKType.DIRECT_CHARGE),
155155
amount,
156156
currency,
157157
userReference,
@@ -165,15 +165,15 @@ class Thepeer internal constructor(
165165
}
166166

167167

168-
private fun getSdkType(type: Enum<ThepeerSdkType>): String {
168+
private fun getSdkType(type: Enum<ThepeerSDKType>): String {
169169
return when (type) {
170-
ThepeerSdkType.SEND -> {
170+
ThepeerSDKType.SEND -> {
171171
return ThepeerConstants.SEND
172172
}
173-
ThepeerSdkType.CHECKOUT -> {
173+
ThepeerSDKType.CHECKOUT -> {
174174
return ThepeerConstants.CHECKOUT
175175
}
176-
ThepeerSdkType.DIRECT_CHARGE -> {
176+
ThepeerSDKType.DIRECT_CHARGE -> {
177177
return ThepeerConstants.DIRECT_CHARGE
178178
}
179179
else -> ""

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
package co.thepeer.sdk.model
22

3-
import android.os.Parcel
43
import android.os.Parcelable
5-
import androidx.appcompat.app.AppCompatActivity
64
import kotlinx.parcelize.Parcelize
7-
import kotlinx.parcelize.RawValue
85
import java.math.BigDecimal
96

107
/**
@@ -22,4 +19,4 @@ data class ThepeerParam(
2219
): Parcelable
2320

2421

25-
enum class ThepeerSdkType{SEND, CHECKOUT, DIRECT_CHARGE, NONE}
22+
enum class ThepeerSDKType{SEND, CHECKOUT, DIRECT_CHARGE, NONE}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import android.content.Intent
66
import androidx.activity.result.contract.ActivityResultContract
77
import co.thepeer.sdk.model.ThepeerResult
88
import co.thepeer.sdk.model.ThepeerParam
9-
import co.thepeer.sdk.ui.activity.ThepeerSdkActivity
9+
import co.thepeer.sdk.ui.activity.ThepeerSDKActivity
1010
import co.thepeer.sdk.utils.ThepeerConstants
1111

1212
internal class ThepeerResultContract: ActivityResultContract< ThepeerParam, ThepeerResult>() {
1313
override fun createIntent(context: Context, input: ThepeerParam): Intent {
14-
return Intent(context, ThepeerSdkActivity::class.java).apply {
15-
putExtra(ThepeerConstants.THE_PEER_PARAMS, input)
16-
}
14+
return Intent(context, ThepeerSDKActivity::class.java).apply {
15+
putExtra(ThepeerConstants.THE_PEER_PARAMS, input)
16+
}
1717
}
1818

1919
override fun parseResult(resultCode: Int, intent: Intent?): ThepeerResult {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import co.thepeer.sdk.model.ThepeerParam
77
import co.thepeer.sdk.ui.fragments.ThepeerFragment
88
import co.thepeer.sdk.utils.ThepeerConstants
99

10-
class ThepeerSdkActivity : AppCompatActivity() {
10+
class ThepeerSDKActivity : AppCompatActivity() {
1111
private var params: ThepeerParam? = null
1212
private lateinit var binding: SdkActivityBinding
1313
override fun onCreate(savedInstanceState: Bundle?) {

0 commit comments

Comments
 (0)