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

Add support for blik payment intent and payment method #3479

Merged
merged 10 commits into from
Mar 18, 2021
Merged

Conversation

ccen-stripe
Copy link
Collaborator

@ccen-stripe ccen-stripe commented Mar 17, 2021

Summary

Add support for blik Single use.

The following fields are added:

  • a new type blik when creating a payment method
  • a new payment method options blik with field code for blik mobile banking app code when confirming a payment
  • a new next_action type blik_authorize on PaymentIntent

This PR does change any SetupIntent, which is required for blik, as it's not ready yet on pay server.

Motivation

Support blik on Android mobile SDK

Testing

  • Added tests
  • Modified tests

Comment on lines 53 to 55
companion object {
const val PARAM_CODE = "code"
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private companion object

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made this internal so that test could access them, please lmk if this is necessary, happy to change otherwise :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Comment on lines 231 to 236
override fun hashCode(): Int {
return 0
}
override fun equals(other: Any?): Boolean {
return true
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems not compilable without explicitly override this as the object instance without any parameterized field won't be able to tell how to parcel itself, also tried replacing with a regular data class and get similar compilation error

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Parcelize can apply to an object

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can examine this in a future PR

stripe/src/test/java/com/stripe/android/ApiKeyFixtures.kt Outdated Show resolved Hide resolved
@@ -220,5 +222,15 @@ interface StripeIntent : StripeModel {
) : Parcelable
}
}

@Parcelize
object BlikAuthorize : NextActionData() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mshafrir-stripe

This falls into the else case in StripPaymentController as the SDK doesn't need to do anything upon seeing `"next_action": {
"type": "blik_authorize"
},
Is this correct behavior?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems fine for now.

@ccen-stripe ccen-stripe merged commit 58288c4 into master Mar 18, 2021
@ccen-stripe ccen-stripe deleted the blik_pi_pm branch March 18, 2021 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants