Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove global config from card scan #4689

Merged
merged 8 commits into from
Mar 11, 2022
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
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# CHANGELOG
### xx.x.x - YYYY-MM-DD
[FIXED] [4646](https://github.com/stripe/stripe-android/pull/4646) Update 3ds2 to latest version 6.1.4, see PR for specific issues addressed.
## xx.x.x - YYYY-MM-DD
This release enables a new configuration object to be defined for StripeCardScan.

### PaymentSheet
* [FIXED] [4646](https://github.com/stripe/stripe-android/pull/4646) Update 3ds2 to latest version 6.1.4, see PR for specific issues addressed.

### CardScan
* [ADDED] [4689](https://github.com/stripe/stripe-android/pull/4689) The `CardImageVerificationSheet` initializer can now take an additional `Configuration` object.

## 19.2.2 - 2022-03-01
[FIXED] [4606](https://github.com/stripe/stripe-android/pull/4606) Keep status bar color in PaymentLauncher
Expand Down
4 changes: 4 additions & 0 deletions MIGRATING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Migration Guide
## Migrating from versions < 19.3.0
- Changes to `StripeCardScan.Configuration`
- Setting custom scan values in `Config` is no longer supported. Configuration values have been moved to the `StripeCardScan.Configuration` object. If a value was removed that you need access to, please file an issue against this repository.

## Migrating from versions < 19.0.0
- The following list of classes' package names are changed from `com.stripe.android` to `com.stripe.android.core`
- `StripeModel`
Expand Down
130 changes: 62 additions & 68 deletions stripecardscan/api/stripecardscan.api
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,75 @@ public final class com/stripe/android/stripecardscan/BuildConfig {
public fun <init> ()V
}

public final class com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationConfig {
public static final field $stable I
public static final field INSTANCE Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationConfig;
public static final fun getCARD_ONLY_SEARCH_DURATION_MILLIS ()I
public static final fun getDESIRED_CARD_COUNT ()I
public static final fun getDESIRED_OCR_AGREEMENT ()I
public static final fun getMAX_COMPLETION_LOOP_FRAMES ()I
public static final fun getMAX_SAVED_FRAMES_PER_TYPE ()I
public static final fun getNO_CARD_VISIBLE_DURATION_MILLIS ()I
public static final fun getOCR_AND_CARD_SEARCH_DURATION_MILLIS ()I
public static final fun getOCR_ONLY_SEARCH_DURATION_MILLIS ()I
public static final fun getWRONG_CARD_DURATION_MILLIS ()I
public static final fun setCARD_ONLY_SEARCH_DURATION_MILLIS (I)V
public static final fun setDESIRED_CARD_COUNT (I)V
public static final fun setDESIRED_OCR_AGREEMENT (I)V
public static final fun setMAX_COMPLETION_LOOP_FRAMES (I)V
public static final fun setMAX_SAVED_FRAMES_PER_TYPE (I)V
public static final fun setNO_CARD_VISIBLE_DURATION_MILLIS (I)V
public static final fun setOCR_AND_CARD_SEARCH_DURATION_MILLIS (I)V
public static final fun setOCR_ONLY_SEARCH_DURATION_MILLIS (I)V
public static final fun setWRONG_CARD_DURATION_MILLIS (I)V
}

public final class com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet {
public static final field $stable I
public static final field Companion Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Companion;
public synthetic fun <init> (Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public static final fun create (Landroidx/activity/ComponentActivity;Ljava/lang/String;)Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet;
public static final fun create (Landroidx/fragment/app/Fragment;Ljava/lang/String;)Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet;
public synthetic fun <init> (Ljava/lang/String;Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public static final fun create (Landroidx/activity/ComponentActivity;Ljava/lang/String;Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration;)Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet;
public static final fun create (Landroidx/fragment/app/Fragment;Ljava/lang/String;Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration;)Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet;
public final fun present (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
}

public final class com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Companion {
public final fun create (Landroidx/activity/ComponentActivity;Ljava/lang/String;)Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet;
public final fun create (Landroidx/fragment/app/Fragment;Ljava/lang/String;)Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet;
public final fun create (Landroidx/activity/ComponentActivity;Ljava/lang/String;Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration;)Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet;
public final fun create (Landroidx/fragment/app/Fragment;Ljava/lang/String;Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration;)Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet;
public static synthetic fun create$default (Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Companion;Landroidx/activity/ComponentActivity;Ljava/lang/String;Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration;ILjava/lang/Object;)Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet;
public static synthetic fun create$default (Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Companion;Landroidx/fragment/app/Fragment;Ljava/lang/String;Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration;ILjava/lang/Object;)Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet;
}

public final class com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration : android/os/Parcelable {
public static final field $stable I
public static final field CREATOR Landroid/os/Parcelable$Creator;
public fun <init> ()V
public fun <init> (Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount;)V
public synthetic fun <init> (Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount;
public final fun copy (Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount;)Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration;
public static synthetic fun copy$default (Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration;Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount;ILjava/lang/Object;)Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration;
public fun describeContents ()I
public fun equals (Ljava/lang/Object;)Z
public final fun getStrictModeFrames ()Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public fun writeToParcel (Landroid/os/Parcel;I)V
}

public abstract class com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount : android/os/Parcelable {
public static final field $stable I
public synthetic fun <init> (ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getCount ()I
}

public final class com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount$High : com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount {
public static final field $stable I
public static final field CREATOR Landroid/os/Parcelable$Creator;
public static final field INSTANCE Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount$High;
public fun describeContents ()I
public fun writeToParcel (Landroid/os/Parcel;I)V
}

public final class com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount$Low : com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount {
public static final field $stable I
public static final field CREATOR Landroid/os/Parcelable$Creator;
public static final field INSTANCE Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount$Low;
public fun describeContents ()I
public fun writeToParcel (Landroid/os/Parcel;I)V
}

public final class com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount$Medium : com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount {
public static final field $stable I
public static final field CREATOR Landroid/os/Parcelable$Creator;
public static final field INSTANCE Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount$Medium;
public fun describeContents ()I
public fun writeToParcel (Landroid/os/Parcel;I)V
}

public final class com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount$None : com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount {
public static final field $stable I
public static final field CREATOR Landroid/os/Parcelable$Creator;
public static final field INSTANCE Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheet$Configuration$StrictModeFrameCount$None;
public fun describeContents ()I
public fun writeToParcel (Landroid/os/Parcel;I)V
}

public abstract interface class com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationSheetResult : android/os/Parcelable {
Expand Down Expand Up @@ -112,17 +146,6 @@ public final class com/stripe/android/stripecardscan/cardimageverification/excep
public synthetic fun <init> (Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
}

public final class com/stripe/android/stripecardscan/cardscan/CardScanConfig {
public static final field $stable I
public static final field INSTANCE Lcom/stripe/android/stripecardscan/cardscan/CardScanConfig;
public static final fun getDESIRED_OCR_AGREEMENT ()I
public static final fun getNO_CARD_VISIBLE_DURATION_MILLIS ()I
public static final fun getOCR_SEARCH_DURATION_MILLIS ()I
public static final fun setDESIRED_OCR_AGREEMENT (I)V
public static final fun setNO_CARD_VISIBLE_DURATION_MILLIS (I)V
public static final fun setOCR_SEARCH_DURATION_MILLIS (I)V
}

public final class com/stripe/android/stripecardscan/cardscan/CardScanFragment : com/stripe/android/stripecardscan/scanui/ScanFragment, com/stripe/android/camera/scanui/SimpleScanStateful {
public static final field $stable I
public fun <init> ()V
Expand Down Expand Up @@ -273,35 +296,6 @@ public final class com/stripe/android/stripecardscan/databinding/FragmentCardsca
public static fun inflate (Landroid/view/LayoutInflater;Landroid/view/ViewGroup;Z)Lcom/stripe/android/stripecardscan/databinding/FragmentCardscanBinding;
}

public final class com/stripe/android/stripecardscan/framework/Config {
public static final field $stable I
public static final field INSTANCE Lcom/stripe/android/stripecardscan/framework/Config;
public static final fun getDisplayLogo ()Z
public static final fun getEnableCannotScanButton ()Z
public static final fun getLogTag ()Ljava/lang/String;
public static final fun isDebug ()Z
public static final fun setDebug (Z)V
public static final fun setDisplayLogo (Z)V
public static final fun setEnableCannotScanButton (Z)V
public static final fun setLogTag (Ljava/lang/String;)V
}

public final class com/stripe/android/stripecardscan/framework/NetworkConfig {
public static final field $stable I
public static final field INSTANCE Lcom/stripe/android/stripecardscan/framework/NetworkConfig;
public final fun getCARD_SCAN_RETRY_STATUS_CODES ()Ljava/lang/Iterable;
public static final fun getJson ()Lkotlinx/serialization/json/Json;
public static final fun getRetryDelayMillis ()I
public static final fun getRetryStatusCodes ()Ljava/lang/Iterable;
public static final fun getRetryTotalAttempts ()I
public static final fun getUseCompression ()Z
public static final fun setJson (Lkotlinx/serialization/json/Json;)V
public static final fun setRetryDelayMillis (I)V
public static final fun setRetryStatusCodes (Ljava/lang/Iterable;)V
public static final fun setRetryTotalAttempts (I)V
public static final fun setUseCompression (Z)V
}

public abstract class com/stripe/android/stripecardscan/payment/card/CardIssuer {
public static final field $stable I
public synthetic fun <init> (Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
Expand Down
2 changes: 1 addition & 1 deletion stripecardscan/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies {
testImplementation "junit:junit:$junitVersion"
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinCoroutinesVersion"
testImplementation "org.mockito:mockito-core:$mockitoCoreVersion"
testImplementation "org.mockito:mockito-inline:$mockitoCoreVersion"
testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
testImplementation "com.google.truth:truth:$truthVersion"
testImplementation "org.robolectric:robolectric:$robolectricVersion"
Expand Down
11 changes: 0 additions & 11 deletions stripecardscan/res/drawable/stripe_logo_dark_background.xml

This file was deleted.

11 changes: 0 additions & 11 deletions stripecardscan/res/drawable/stripe_logo_light_background.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.stripe.android.camera.Camera1Adapter
import com.stripe.android.camera.CameraAdapter
import com.stripe.android.camera.CameraErrorListener
import com.stripe.android.camera.CameraPreviewImage
import com.stripe.android.stripecardscan.framework.Config
import com.stripe.android.stripecardscan.framework.LOG_TAG

/**
* Get the appropriate camera adapter. If the customer has provided an additional camera adapter,
Expand All @@ -26,14 +26,14 @@ internal fun getCameraAdapter(
try {
getAlternateCamera(activity, previewView, minimumResolution, cameraErrorListener)
} catch (t: Throwable) {
Log.d(Config.logTag, "No alternative camera implementations, falling back to default")
Log.d(LOG_TAG, "No alternative camera implementations, falling back to default")
Camera1Adapter(activity, previewView, minimumResolution, cameraErrorListener)
}
} else {
Log.d(Config.logTag, "YUV_420_888 is not supported, falling back to default camera")
Log.d(LOG_TAG, "YUV_420_888 is not supported, falling back to default camera")
Camera1Adapter(activity, previewView, minimumResolution, cameraErrorListener)
}.apply {
Log.d(Config.logTag, "Using camera implementation ${this.implementationName}")
Log.d(LOG_TAG, "Using camera implementation ${this.implementationName}")
}

@Suppress("UNCHECKED_CAST")
Expand Down
Loading