Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Support. While redistributing
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
Expand Down
23 changes: 7 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Spreedly Checkout — Android Example

> **This project is for demonstration and reference purposes only.** It is not intended for use in production environments. The code, configuration, and architecture shown here illustrate SDK integration patterns — adapt them to your own security requirements, backend infrastructure, and key management practices before shipping to production.

This sample app demonstrates the [Spreedly Android Checkout SDK](https://github.com/spreedly/checkout-android-sdk) at version **1.0.1** (tag `v1.0.1`).
This sample app demonstrates the [Spreedly Android Checkout SDK](https://github.com/spreedly/checkout-android-sdk) at version **1.1.0** (tag `v1.1.0`).

## Setup

1. Clone this repository
2. Add your GitHub Packages credentials to `~/.gradle/gradle.properties`. Even though [checkout-android-maven](https://github.com/spreedly/checkout-android-maven) is public, GitHub Packages still requires authentication to download Maven artifacts. Create a PAT with `read:packages` scope and add:
2. Add your GitHub Packages credentials to `~/.gradle/gradle.properties`:

```properties
gpr.usr=YOUR_GITHUB_USERNAME
Expand All @@ -22,10 +20,10 @@ gpr.key=YOUR_GITHUB_TOKEN
All SDK modules are resolved from GitHub Packages:

```kotlin
implementation("com.spreedly:checkout-paymentsheet:1.0.1")
implementation("com.spreedly:checkout-braintree-apm:1.0.1")
implementation("com.spreedly:checkout-stripe-apm:1.0.1")
implementation("com.spreedly:checkout-threeds:1.0.1")
implementation("com.spreedly:checkout-paymentsheet:1.1.0")
implementation("com.spreedly:checkout-braintree-apm:1.1.0")
implementation("com.spreedly:checkout-stripe-apm:1.1.0")
implementation("com.spreedly:checkout-threeds:1.1.0")
```

## SDK Documentation
Expand All @@ -35,11 +33,4 @@ implementation("com.spreedly:checkout-threeds:1.0.1")

## Support

- **Spreedly Documentation**: [docs.spreedly.com](https://docs.spreedly.com/)
- **Support Portal**: [spreedly.com/support](https://spreedly.com/support/)

## Legal

- [Terms of Service](https://legal.spreedly.com/#terms)
- [Privacy Policy](https://legal.spreedly.com/#privacy-policy)
- [License](LICENSE) (Apache 2.0)
For questions or issues, please contact the Spreedly team or create an issue in the [SDK repository](https://github.com/spreedly/checkout-android-sdk/issues).
15 changes: 11 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ android {
excludes += "META-INF/NOTICE.md"
}
}

testOptions {
unitTests {
isIncludeAndroidResources = true
}
}
}

kotlin {
Expand All @@ -137,10 +143,11 @@ kotlin {

dependencies {
// ✅ Use paymentsheet which includes payments-core and hosted-fields
implementation("com.spreedly:checkout-paymentsheet:1.0.1")
implementation("com.spreedly:checkout-braintree-apm:1.0.1")
implementation("com.spreedly:checkout-stripe-apm:1.0.1")
implementation("com.spreedly:checkout-threeds:1.0.1")
implementation("com.spreedly:checkout-paymentsheet:1.1.0")
implementation("com.spreedly:checkout-braintree-apm:1.1.0")
implementation("com.spreedly:checkout-stripe-apm:1.1.0")
implementation("com.spreedly:checkout-stripe-radar:1.1.0")
implementation("com.spreedly:checkout-threeds:1.1.0")

implementation(libs.kotlinx.serialization.json)
implementation(platform(libs.androidx.compose.bom))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.spreedly.example.paymenttypes

import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.hasContentDescription
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.spreedly.example.screens.basiccheckout.BasicCheckoutScreen
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class BasicCheckoutMaskToggleTest {
@get:Rule
val composeTestRule = createComposeRule()

@Test
fun basicCheckout_hasMerchantMaskToggle_andNoSdkPanEye() {
composeTestRule.setContent {
BasicCheckoutScreen()
}

composeTestRule.waitForIdle()
composeTestRule.onNodeWithText("Pretty").assertIsDisplayed()
composeTestRule.onNodeWithText("Plain").assertIsDisplayed()
composeTestRule.onNodeWithText("Masked").assertIsDisplayed()
composeTestRule.onNodeWithText("toggleMask()").assertIsDisplayed()

composeTestRule.onNode(hasContentDescription("Show card number")).assertDoesNotExist()
composeTestRule.onNode(hasContentDescription("Hide card number")).assertDoesNotExist()
}

@Test
fun basicCheckout_formatSegmentsAreClickable() {
composeTestRule.setContent {
BasicCheckoutScreen()
}

composeTestRule.waitForIdle()
composeTestRule.onNodeWithText("Plain").performClick()
composeTestRule.waitForIdle()
composeTestRule.onNodeWithText("Masked").performClick()
composeTestRule.waitForIdle()
composeTestRule.onNodeWithText("Card Number").assertIsDisplayed()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.spreedly.example.paymenttypes

import androidx.activity.ComponentActivity
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.compose.ui.test.onNodeWithText
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.spreedly.example.TestConfiguration
import com.spreedly.example.screens.basiccheckout.BasicCheckoutScreen
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class BasicCheckoutRotationInstrumentedTest {
@get:Rule
val composeTestRule = createAndroidComposeRule<ComponentActivity>()

@Test
fun basicCheckout_recreate_preserves_screen() {
composeTestRule.setContent {
BasicCheckoutScreen()
}
composeTestRule.waitForIdle()
composeTestRule.onNodeWithText(TestConfiguration.UIElements.BASIC_CHECKOUT_TITLE).assertIsDisplayed()
composeTestRule.activityRule.scenario.recreate()
composeTestRule.waitForIdle()
composeTestRule.onNodeWithText(TestConfiguration.UIElements.BASIC_CHECKOUT_TITLE).assertIsDisplayed()
}
}
Loading