Skip to content

Commit

Permalink
Upgraded Android checkout sdk to beta01
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-SD committed Sep 8, 2023
1 parent 10e40a7 commit ac58d26
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 10 deletions.
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group 'com.adyen.adyen_checkout'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.9.0'
repositories {
google()
mavenCentral()
Expand All @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'

android {
namespace = "com.adyen.adyen_checkout"
compileSdkVersion 33
compileSdk 34

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -47,7 +47,7 @@ android {
}

dependencies {
implementation 'com.adyen.checkout:drop-in:5.0.0-alpha02'
implementation 'com.adyen.checkout:drop-in:5.0.0-beta01'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
testImplementation 'org.jetbrains.kotlin:kotlin-test'
testImplementation 'org.mockito:mockito-core:5.5.0'
Expand Down
5 changes: 5 additions & 0 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ class AdvancedFlowDropInService : DropInService(), LifecycleOwner {
val actionComponentJson = ActionComponentData.SERIALIZER.serialize(actionComponentData)
DropInAdditionalDetailsPlatformMessenger.sendResult(actionComponentJson)
} catch (exception: Exception) {
sendResult(DropInServiceResult.Error(errorMessage = exception.message))
sendResult(
DropInServiceResult.Error(
errorDialog = null,
reason = exception.message,
dismissDropIn = true
)
)
}
}

Expand All @@ -41,7 +47,13 @@ class AdvancedFlowDropInService : DropInService(), LifecycleOwner {
PaymentComponentData.SERIALIZER.serialize(paymentComponentState.data)
DropInServiceResultMessenger.sendResult(paymentComponentJson)
} catch (exception: Exception) {
sendResult(DropInServiceResult.Error(errorMessage = exception.message))
sendResult(
DropInServiceResult.Error(
errorDialog = null,
reason = exception.message,
dismissDropIn = true
)
)
}
}

Expand Down Expand Up @@ -74,21 +86,29 @@ class AdvancedFlowDropInService : DropInService(), LifecycleOwner {
FINISHED -> DropInServiceResult.Finished(result = "${dropInResult.result}")

ERROR -> DropInServiceResult.Error(
errorMessage = dropInResult.error?.errorMessage,
errorDialog = null,
reason = dropInResult.error?.reason,
dismissDropIn = dropInResult.error?.dismissDropIn ?: false
)

ACTION -> {
if (dropInResult.actionResponse == null) {
DropInServiceResult.Error(reason = "Action response not provided")
DropInServiceResult.Error(
errorDialog = null,
reason = "Action response not provided",
dismissDropIn = true
)
} else {
val actionJson = JSONObject(dropInResult.actionResponse)
DropInServiceResult.Action(action = Action.SERIALIZER.deserialize(actionJson))
}
}

null -> DropInServiceResult.Error(reason = "IOException")
null -> DropInServiceResult.Error(
errorDialog = null,
reason = "IOException",
dismissDropIn = true
)
}
}

Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace "com.adyen.adyen_checkout_example"
compileSdkVersion flutter.compileSdkVersion
compileSdk 34
ndkVersion flutter.ndkVersion

compileOptions {
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.9.0'
repositories {
google()
mavenCentral()
Expand Down
1 change: 1 addition & 0 deletions example/lib/repositories/drop_in_outcome_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class DropInOutcomeHandler {
if (_isError(jsonResponse)) {
return Error(
errorMessage: jsonResponse[messageKey],
reason: jsonResponse[messageKey],
dismissDropIn: true,
);
}
Expand Down

0 comments on commit ac58d26

Please sign in to comment.