-
Notifications
You must be signed in to change notification settings - Fork 46
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
Google Play store compliance fix #252
Changes from all commits
2efb48b
248b239
a969381
42fbbf3
398dd11
fb0e528
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ import io.mockk.slot | |
import io.mockk.spyk | ||
import io.mockk.unmockkAll | ||
import io.mockk.verify | ||
import java.lang.reflect.Field | ||
import kotlinx.coroutines.ExperimentalCoroutinesApi | ||
import kotlinx.coroutines.runBlocking | ||
import kotlinx.coroutines.test.StandardTestDispatcher | ||
|
@@ -40,7 +41,7 @@ import org.junit.Before | |
import org.junit.Test | ||
import strikt.api.expectThat | ||
import strikt.assertions.isEqualTo | ||
import java.lang.reflect.Field | ||
import strikt.assertions.isTrue | ||
|
||
@ExperimentalCoroutinesApi | ||
class PayPalNativeCheckoutClientTest { | ||
|
@@ -88,6 +89,27 @@ class PayPalNativeCheckoutClientTest { | |
} | ||
} | ||
|
||
@Test | ||
fun `when user location consent is set, startCheckout is called with the user location consent set`() = | ||
runTest { | ||
val userLocationConsentSlot = slot<Boolean>() | ||
every { | ||
PayPalCheckout.startCheckout(any(), capture(userLocationConsentSlot)) | ||
} answers { userLocationConsentSlot.captured } | ||
|
||
sut = getPayPalCheckoutClient(testScheduler = testScheduler) | ||
sut.startCheckout( | ||
PayPalNativeCheckoutRequest( | ||
"order_id", | ||
"[email protected]", | ||
true | ||
) | ||
) | ||
advanceUntilIdle() | ||
|
||
expectThat(userLocationConsentSlot.captured).isTrue() | ||
} | ||
|
||
@Test | ||
fun `when startCheckout is invoked with an invalid return_url, onPayPalCheckout failure is called`() = | ||
runTest { | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -77,7 +77,7 @@ buildscript { | |||||
"json" : "org.json:json:20220320", | ||||||
|
||||||
// PayPal | ||||||
"nativeCheckout" : "com.paypal.checkout:android-sdk:1.2.1", | ||||||
"nativeCheckout" : "com.paypal.checkout:android-sdk:1.3.2", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. qq here - should this be version 1.3.0, that's the latest release i'm seeing here
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmmm.. great catch. @tdchow please correct me if I'm wrong, but I believe 1.3.2 is the latest that we had to consume, correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, it looks like the latest versions have not been tagged in the GitHub releases. The correct version to use is 1.3.2. https://repo1.maven.org/maven2/com/paypal/checkout/android-sdk/1.3.2/ |
||||||
|
||||||
// Release modules | ||||||
"cardPayments" : "com.paypal.android:card-payments:${modules.sdkVersionName}", | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: same comment as below