-
Notifications
You must be signed in to change notification settings - Fork 659
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
Adding new PaymentSheet FormElement for Blik payment method. #7062
Conversation
…tsheet-example-pln-currency
eb3e384
to
1f6a11e
Compare
Diffuse output:
APK
DEX
ARSC
|
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.
The approach looks good to me overall. It’d be great if we can remove of the conditionals in the data flow and make things a little more generic. Added comments with some notes about that.
PaymentMethod.Type.Blik.code -> { | ||
paymentMethodOptionsParams | ||
} |
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.
We’re only passing a single value setupFutureUsage
for the other payment method types, but are now using the entire PaymentMethodOptionsParams
for Blik. Would it make sense to align the two?
This would mean that transformToPaymentMethodOptionsParams
doesn’t only produce PaymentMethodOptionsParams.Blik
, but also any other PaymentMethodOptionsParams
, and we’d then pass them into here.
I’m not quite sure yet about which other changes (if any) we’d need to make for this to work correctly, but happy to help figure it out.
payments-ui-core/src/main/java/com/stripe/android/ui/core/FieldValuesToParamsMapConverter.kt
Outdated
Show resolved
Hide resolved
stripe-ui-core/src/main/java/com/stripe/android/uicore/elements/IdentifierSpec.kt
Outdated
Show resolved
Hide resolved
stripe-ui-core/src/main/java/com/stripe/android/uicore/elements/IdentifierSpec.kt
Outdated
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/ui/AddPaymentMethod.kt
Outdated
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/IntentConfirmationInterceptor.kt
Outdated
Show resolved
Hide resolved
/** | ||
* This function will convert fieldValuePairs to PaymentMethodOptionsParams. | ||
*/ | ||
fun transformToPaymentMethodOptionsParams( |
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.
Can you annotate this with @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
so we hide it from the public API?
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.
The companion object
that wraps this function is already annotated with @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
I believe this implies that all functions and properties within it are also restricted to the library group. I could be wrong though.
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.
Unfortunately, only the class is annotated, but not the companion object
.
payments-ui-core/src/main/java/com/stripe/android/ui/core/elements/BlikConfig.kt
Outdated
Show resolved
Hide resolved
payments-ui-core/src/main/java/com/stripe/android/ui/core/elements/BlikConfig.kt
Outdated
Show resolved
Hide resolved
payments-ui-core/src/main/java/com/stripe/android/ui/core/elements/BlikSpec.kt
Outdated
Show resolved
Hide resolved
payments-ui-core/src/test/java/com/stripe/android/ui/core/elements/BlikConfigTest.kt
Show resolved
Hide resolved
paymentsheet/src/test/java/com/stripe/android/paymentsheet/PaymentSheetViewModelTest.kt
Outdated
Show resolved
Hide resolved
public final fun getBlik ()Lcom/stripe/android/uicore/elements/IdentifierSpec; | ||
public final fun getBlikCode ()Lcom/stripe/android/uicore/elements/IdentifierSpec; |
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.
Can we mark these with @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
?
For context: The entire companion object
should have been marked with it, but I guess the original author forgot. Let’s at least make sure that new fields don’t leak.
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.
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
val Blik = IdentifierSpec("blik", requestDestination = RequestDestination.Options)
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
val BlikCode = IdentifierSpec("blik[code]", requestDestination = RequestDestination.Options)
I've added the @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
but apiDump and apiCheck don't seem to care and keep trying to add them back or failing
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.
Hmm, not sure about it then 🤔 Feel free to leave as-is and we can take care of that later.
@@ -5,6 +5,11 @@ import androidx.annotation.RestrictTo | |||
import kotlinx.parcelize.Parcelize | |||
import kotlinx.serialization.Serializable | |||
|
|||
enum class RequestDestination { |
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.
I know this is my name suggestion, but maybe there’s something more descriptive 🙈
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.
how about ApiParameterDestination
?
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.
I like that!
payments-core/src/main/java/com/stripe/android/ConfirmStripeIntentParamsFactory.kt
Outdated
Show resolved
Hide resolved
…ripe-android into fionnbarrett/BLIK-form-element
…tMethodOptionsParams and fix apiCheck
Summary
Adding payment method Blik to mobile PaymentSheet.
Motivation
Testing
Screenshots
Changelog