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

Refactor session complete payment #1067

Merged
merged 13 commits into from
Jun 11, 2019
Merged

Refactor session complete payment #1067

merged 13 commits into from
Jun 11, 2019

Conversation

jemerick-stripe
Copy link
Contributor

Summary

Removed payment completion provider and payment result listener.

Also fixed a few bugs with the totals in the sample store app.

Motivation

MOBILE3DS2-382
Confusion around the usage of paymentSession.completePayment.

Testing

Automated tests, sample store app.

@@ -315,7 +318,7 @@ private void processPaymentIntent(@NonNull PaymentIntent paymentIntent) {
confirmPaymentIntent(Objects.requireNonNull(paymentIntent.getId()));
return;
}

mPaymentSession.onCompleted();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are there states the PaymentIntent can be in where we shouldn't call onCompleted? In other words, should we only do this if PaymentIntent's status is succeeded? Also, should we move this call into finishPayment()?

build.gradle Outdated
@@ -18,6 +18,7 @@ allprojects {
repositories {
google()
jcenter()
mavenLocal()
Copy link
Collaborator

Choose a reason for hiding this comment

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

revert

@@ -26,7 +26,7 @@
* You can get your key here: https://dashboard.stripe.com/account/apikeys
*/
private static final String PUBLISHABLE_KEY =
"put your key here";
"pk_test_pWjWlOKXD13QQ1o31awb0IM000u9Xq3Hxd";
Copy link
Collaborator

Choose a reason for hiding this comment

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

revert

@@ -19,7 +19,7 @@

// Put your Base URL here. Unless you customized it, the URL will be something like
// https://hidden-beach-12345.herokuapp.com/
private static final String BASE_URL = "put your url here";
private static final String BASE_URL = "https://jemerick-stripe-3ds2.herokuapp.com/";
Copy link
Collaborator

Choose a reason for hiding this comment

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

revert

@@ -19,7 +19,7 @@

// Put your Base URL here. Unless you customized it, the URL will be something like
// https://hidden-beach-12345.herokuapp.com/
private static final String BASE_URL = "put your base url here";
private static final String BASE_URL = "https://jemerick-stripe-3ds2.herokuapp.com/";
Copy link
Collaborator

Choose a reason for hiding this comment

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

revert

@@ -40,7 +40,7 @@
* You can get your key here: https://dashboard.stripe.com/account/apikeys
*/
private static final String PUBLISHABLE_KEY =
"put your publishable key here";
"pk_test_pWjWlOKXD13QQ1o31awb0IM000u9Xq3Hxd";
Copy link
Collaborator

Choose a reason for hiding this comment

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

revert

*/
public void completePayment(@NonNull PaymentCompletionProvider provider) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we still need to call onPaymentSessionDataChanged()? Probably not because this is not an async task, but worth calling out.

@mshafrir-stripe mshafrir-stripe merged commit cb06ce7 into master Jun 11, 2019
@mshafrir-stripe mshafrir-stripe deleted the complete-payment branch June 11, 2019 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants