diff --git a/ReepayCheckoutSheetDemo/build.gradle.kts b/ReepayCheckoutSheetDemo/build.gradle.kts index 70653f4..7de7ba5 100644 --- a/ReepayCheckoutSheetDemo/build.gradle.kts +++ b/ReepayCheckoutSheetDemo/build.gradle.kts @@ -40,10 +40,10 @@ dependencies { implementation("androidx.appcompat:appcompat:1.7.0") // Option 1. implement external dependency - implementation("com.github.reepay:reepay-android-checkout-sheet:1.0.9") + implementation("com.github.reepay:reepay-android-checkout-sheet:1.0.12") - // Option 2. Implement local depenency + // Option 2. Implement local dependency // implementation(project(":checkout")) implementation("com.google.android.material:material:1.12.0") diff --git a/ReepayCheckoutSheetDemo/src/main/java/com/billwerk/checkoutsheetdemo/MainActivity.kt b/ReepayCheckoutSheetDemo/src/main/java/com/billwerk/checkoutsheetdemo/MainActivity.kt index b92a6d6..ebfb76d 100644 --- a/ReepayCheckoutSheetDemo/src/main/java/com/billwerk/checkoutsheetdemo/MainActivity.kt +++ b/ReepayCheckoutSheetDemo/src/main/java/com/billwerk/checkoutsheetdemo/MainActivity.kt @@ -31,11 +31,11 @@ class MainActivity : AppCompatActivity() { // Example configuration val config = CheckoutSheetConfig( sessionId = "", - acceptURL = "", // Has to be identical to the one defined in the checkout session - cancelURL = "", sheetStyle = SheetStyle.FULL_SCREEN, dismissible = true, - hideHeader = true + hideHeader = true, + closeButtonIcon = R.drawable.button_close_icon, + closeButtonText = R.string.close_button_text ) // Open checkout sheet @@ -66,22 +66,25 @@ class MainActivity : AppCompatActivity() { } } - private fun handleEvents(message: SDKEventMessage){ + private fun handleEvents(message: SDKEventMessage) { val eventType: SDKEventType = message.event Log.d("MyApp", "Collected event: $eventType") - when(eventType){ + when (eventType) { SDKEventType.Accept -> { Log.d("MyApp", "Invoice handle: ${message.data?.invoice}") Log.d("MyApp", "Customer handle: ${message.data?.customer}") Log.d("MyApp", "Payment method id: ${message.data?.payment_method}") } + SDKEventType.Error -> { Log.d("MyApp", "Error type: ${message.data?.error}") } + SDKEventType.Cancel -> { checkoutSheet.dismiss() } + SDKEventType.Close -> {} SDKEventType.Open -> {} SDKEventType.Init -> {} diff --git a/ReepayCheckoutSheetDemo/src/main/res/drawable/button_close_icon.xml b/ReepayCheckoutSheetDemo/src/main/res/drawable/button_close_icon.xml new file mode 100644 index 0000000..02068f2 --- /dev/null +++ b/ReepayCheckoutSheetDemo/src/main/res/drawable/button_close_icon.xml @@ -0,0 +1,9 @@ + + + diff --git a/ReepayCheckoutSheetDemo/src/main/res/values/strings.xml b/ReepayCheckoutSheetDemo/src/main/res/values/strings.xml index b5c1330..4d996d0 100644 --- a/ReepayCheckoutSheetDemo/src/main/res/values/strings.xml +++ b/ReepayCheckoutSheetDemo/src/main/res/values/strings.xml @@ -1,3 +1,4 @@ Reepay Checkout SDK Demo App + Close \ No newline at end of file