Skip to content

Commit f1343a0

Browse files
committed
Code cleanup.
1 parent bcb0ffe commit f1343a0

File tree

2 files changed

+4
-33
lines changed
  • example/src/main/res/values
  • pos-client-library/src/main/java/com/globalaccelerex/globalaccelerexandroidposclientlibrary/baseAppUtils

2 files changed

+4
-33
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<resources>
22
<string name="app_name">AndroidPosClientLibrary</string>
3+
<!-- TODO: Remove or change this placeholder text -->
4+
<string name="hello_blank_fragment">Hello blank fragment</string>
35
</resources>

pos-client-library/src/main/java/com/globalaccelerex/globalaccelerexandroidposclientlibrary/baseAppUtils/TransactionRequest.kt

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,15 @@ internal class TransactionRequest {
4747
val transJson = Gson().toJson(transactionObject)
4848
val intent = Intent(TRANSACTION_REQUEST_INTENT_ADDRESS)
4949
intent.putExtra(REQUEST_DATA_TAG, transJson)
50+
51+
5052
when (callingComponent) {
5153
is Fragment -> {
5254
callingComponent.startActivityForResult(intent, CP_PURCHASE_REQUEST_CODE)
5355
}
5456
is Activity -> {
5557
callingComponent.startActivityForResult(intent, CP_PURCHASE_REQUEST_CODE)
5658
}
57-
is PreferenceFragmentCompat -> {
58-
callingComponent.startActivityForResult(intent, CP_PURCHASE_REQUEST_CODE)
59-
}
6059
else -> {
6160
throw UnsupportedCallingComponentException("Unsupported calling component.")
6261
}
@@ -86,9 +85,6 @@ internal class TransactionRequest {
8685
is Activity -> {
8786
callingComponent.startActivityForResult(intent, CP_PURCHASE_WITH_CASHBACK_REQUEST_CODE)
8887
}
89-
is PreferenceFragmentCompat -> {
90-
callingComponent.startActivityForResult(intent, CP_PURCHASE_WITH_CASHBACK_REQUEST_CODE)
91-
}
9288
else -> throw UnsupportedCallingComponentException("Unsupported calling component.")
9389
}
9490
}
@@ -118,9 +114,6 @@ internal class TransactionRequest {
118114
is Activity -> {
119115
callingComponent.startActivityForResult(intent, CNP_PURCHASE_REQUEST_CODE)
120116
}
121-
is PreferenceFragmentCompat -> {
122-
callingComponent.startActivityForResult(intent, CNP_PURCHASE_REQUEST_CODE)
123-
}
124117
else -> throw UnsupportedCallingComponentException("Unsupported calling component.")
125118
}
126119
}
@@ -152,9 +145,6 @@ internal class TransactionRequest {
152145
is Activity -> {
153146
callingComponent.startActivityForResult(intent, CNP_PURCHASE_WITH_CB_REQUEST_CODE)
154147
}
155-
is PreferenceFragmentCompat -> {
156-
callingComponent.startActivityForResult(intent, CNP_PURCHASE_WITH_CB_REQUEST_CODE)
157-
}
158148
else -> throw UnsupportedCallingComponentException("Unsupported calling component.")
159149
}
160150
}
@@ -184,9 +174,6 @@ internal class TransactionRequest {
184174
is Activity -> {
185175
callingComponent.startActivityForResult(intent, CNP_PRE_AUTH_PURCHASE_REQUEST_CODE)
186176
}
187-
is PreferenceFragmentCompat -> {
188-
callingComponent.startActivityForResult(intent, CNP_PRE_AUTH_PURCHASE_REQUEST_CODE)
189-
}
190177
else -> throw UnsupportedCallingComponentException("Unsupported calling component.")
191178
}
192179
}
@@ -218,9 +205,6 @@ internal class TransactionRequest {
218205
is Activity -> {
219206
callingComponent.startActivityForResult(intent, CNP_PRE_AUTH_COMPLETION_REQUEST_CODE)
220207
}
221-
is PreferenceFragmentCompat -> {
222-
callingComponent.startActivityForResult(intent, CNP_PRE_AUTH_COMPLETION_REQUEST_CODE)
223-
}
224208
else -> throw UnsupportedCallingComponentException("Unsupported calling component.")
225209
}
226210
}
@@ -248,9 +232,6 @@ internal class TransactionRequest {
248232
is Activity -> {
249233
callingComponent.startActivityForResult(intent, CNP_CARD_BALANCE_REQUEST_CODE)
250234
}
251-
is PreferenceFragmentCompat -> {
252-
callingComponent.startActivityForResult(intent, CNP_CARD_BALANCE_REQUEST_CODE)
253-
}
254235
else -> throw UnsupportedCallingComponentException("Unsupported calling component.")
255236
}
256237
}
@@ -280,9 +261,6 @@ internal class TransactionRequest {
280261
is Activity -> {
281262
callingComponent.startActivityForResult(intent, CNP_REFUND_REQUEST_CODE)
282263
}
283-
is PreferenceFragmentCompat -> {
284-
callingComponent.startActivityForResult(intent, CNP_REFUND_REQUEST_CODE)
285-
}
286264
else -> throw UnsupportedCallingComponentException("Unsupported calling component.")
287265
}
288266
}
@@ -314,9 +292,6 @@ internal class TransactionRequest {
314292
is Activity -> {
315293
callingComponent.startActivityForResult(intent, CNP_REFUND_REQUEST_CODE)
316294
}
317-
is PreferenceFragmentCompat -> {
318-
callingComponent.startActivityForResult(intent, CNP_REFUND_REQUEST_CODE)
319-
}
320295
else -> throw UnsupportedCallingComponentException("Unsupported calling component.")
321296
}
322297
}
@@ -344,9 +319,6 @@ internal class TransactionRequest {
344319
is Activity -> {
345320
callingComponent.startActivityForResult(intent, MOBILE_MONEY_PURCHASE_REQUEST_CODE)
346321
}
347-
is PreferenceFragmentCompat -> {
348-
callingComponent.startActivityForResult(intent, MOBILE_MONEY_PURCHASE_REQUEST_CODE)
349-
}
350322
else -> throw UnsupportedCallingComponentException("Unsupported calling component.")
351323
}
352324
}
@@ -373,9 +345,6 @@ internal class TransactionRequest {
373345
is Activity -> {
374346
callingComponent.startActivityForResult(intent, MOBILE_MONEY_STATUS_CHECK_REQUEST_CODE)
375347
}
376-
is PreferenceFragmentCompat -> {
377-
callingComponent.startActivityForResult(intent, MOBILE_MONEY_STATUS_CHECK_REQUEST_CODE)
378-
}
379348
else -> throw UnsupportedCallingComponentException("Unsupported calling component.")
380349
}
381350
}

0 commit comments

Comments
 (0)