Skip to content

Commit 5a46980

Browse files
committed
Auto format
1 parent a258765 commit 5a46980

1 file changed

Lines changed: 40 additions & 10 deletions

File tree

android/src/main/java/com/farsitel/bazaar/PoolakeyKotlinBridge.kt

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ object PoolakeyKotlinBridge {
2222
val paymentConfig = PaymentConfiguration(localSecurityCheck = securityCheck)
2323
payment = Payment(context = context, config = paymentConfig)
2424
connection = payment.connect {
25-
connectionFailed{ throwable -> callback.onFailure(throwable.message, throwable.stackTrace.joinToString { "\n" }) }
25+
connectionFailed { throwable ->
26+
callback.onFailure(
27+
throwable.message,
28+
throwable.stackTrace.joinToString { "\n" })
29+
}
2630
connectionSucceed {
2731
callback.onConnect()
2832
}
@@ -39,26 +43,40 @@ object PoolakeyKotlinBridge {
3943

4044
fun getSkuDetails(type: String, productIds: List<String>, callback: SKUDetailsCallback) {
4145
if (connection.getState() != ConnectionState.Connected) {
42-
callback.onFailure("Connection not found.", "In order to getting ske details, connect to Poolakey!")
46+
callback.onFailure(
47+
"Connection not found.",
48+
"In order to getting ske details, connect to Poolakey!"
49+
)
4350
return
4451
}
4552
when (type) {
4653
"inApp" ->
4754
payment.getInAppSkuDetails(skuIds = productIds) {
4855
getSkuDetailsSucceed(callback::onSuccess)
49-
getSkuDetailsFailed{ throwable -> callback.onFailure(throwable.message, throwable.stackTrace.joinToString { "\n" }) }
56+
getSkuDetailsFailed { throwable ->
57+
callback.onFailure(
58+
throwable.message,
59+
throwable.stackTrace.joinToString { "\n" })
60+
}
5061
}
5162
else ->
5263
payment.getSubscriptionSkuDetails(skuIds = productIds) {
5364
getSkuDetailsSucceed(callback::onSuccess)
54-
getSkuDetailsFailed{ throwable -> callback.onFailure(throwable.message, throwable.stackTrace.joinToString { "\n" }) }
65+
getSkuDetailsFailed { throwable ->
66+
callback.onFailure(
67+
throwable.message,
68+
throwable.stackTrace.joinToString { "\n" })
69+
}
5570
}
5671
}
5772
}
5873

5974
fun getPurchases(type: String, callback: PurchasesCallback) {
6075
if (connection.getState() != ConnectionState.Connected) {
61-
callback.onFailure("Connection not found.", "In order to getting purchases, connect to Poolakey!")
76+
callback.onFailure(
77+
"Connection not found.",
78+
"In order to getting purchases, connect to Poolakey!"
79+
)
6280
return
6381
}
6482
when (type) {
@@ -87,11 +105,16 @@ object PoolakeyKotlinBridge {
87105
command: PaymentActivity.Command,
88106
callback: PaymentCallback,
89107
productId: String,
90-
payload: String?,
91-
dynamicPriceToken: String?
108+
payload: String
109+
?,
110+
dynamicPriceToken: String
111+
?
92112
) {
93113
if (connection.getState() != ConnectionState.Connected) {
94-
callback.onFailure("Connection not found.", "In order to purchasing, connect to Poolakey!")
114+
callback.onFailure(
115+
"Connection not found.",
116+
"In order to purchasing, connect to Poolakey!"
117+
)
95118
return
96119
}
97120
PaymentActivity.start(
@@ -106,12 +129,19 @@ object PoolakeyKotlinBridge {
106129

107130
fun consume(purchaseToken: String, callback: ConsumeCallback) {
108131
if (connection.getState() != ConnectionState.Connected) {
109-
callback.onFailure("Connection not found.", "In order to consumption, connect to Poolakey!")
132+
callback.onFailure(
133+
"Connection not found.",
134+
"In order to consumption, connect to Poolakey!"
135+
)
110136
return
111137
}
112138
payment.consumeProduct(purchaseToken) {
113139
consumeSucceed(callback::onSuccess)
114-
consumeFailed { throwable -> callback.onFailure(throwable.message, throwable.stackTrace.joinToString { "\n" }) }
140+
consumeFailed { throwable ->
141+
callback.onFailure(
142+
throwable.message,
143+
throwable.stackTrace.joinToString { "\n" })
144+
}
115145
}
116146
}
117147
}

0 commit comments

Comments
 (0)