Commit cd44d779 authored by Liquan (Max) Gu's avatar Liquan (Max) Gu Committed by Commit Bot

[PlayBilling] Rename methods

Before:
* PaymentSuccessCallback#onIsReadyToPayServiceResponse
After:
* PaymentSuccessCallback#onPaymentSuccess

Before:
* PaymentErrorCallback#onError
After:
* PaymentErrorCallback#onPaymentError

Change-Id: I5a6d3176865edf34393c63f78fd844a12b076396
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2123627Reviewed-by: default avatarSahel Sharify <sahel@chromium.org>
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755347}
parent 83915a53
...@@ -66,7 +66,7 @@ public class WebPaymentIntentHelper { ...@@ -66,7 +66,7 @@ public class WebPaymentIntentHelper {
/** Invoked to report error for {@link #parsePaymentResponse}. */ /** Invoked to report error for {@link #parsePaymentResponse}. */
public interface PaymentErrorCallback { public interface PaymentErrorCallback {
/** @param errorString The string that explains the error. */ /** @param errorString The string that explains the error. */
void onError(String errorString); void onPaymentError(String errorString);
} }
/** Invoked to receive parsed data for {@link #parsePaymentResponse}. */ /** Invoked to receive parsed data for {@link #parsePaymentResponse}. */
...@@ -75,7 +75,7 @@ public class WebPaymentIntentHelper { ...@@ -75,7 +75,7 @@ public class WebPaymentIntentHelper {
* @param methodName The method name parsed from the intent response. * @param methodName The method name parsed from the intent response.
* @param details The instrument details parsed from the intent response. * @param details The instrument details parsed from the intent response.
*/ */
void onIsReadyToPayServiceResponse(String methodName, String details); void onPaymentSuccess(String methodName, String details);
} }
/** /**
...@@ -88,13 +88,13 @@ public class WebPaymentIntentHelper { ...@@ -88,13 +88,13 @@ public class WebPaymentIntentHelper {
public static void parsePaymentResponse(int resultCode, Intent data, public static void parsePaymentResponse(int resultCode, Intent data,
PaymentErrorCallback errorCallback, PaymentSuccessCallback successCallback) { PaymentErrorCallback errorCallback, PaymentSuccessCallback successCallback) {
if (data == null) { if (data == null) {
errorCallback.onError(ErrorStrings.MISSING_INTENT_DATA); errorCallback.onPaymentError(ErrorStrings.MISSING_INTENT_DATA);
} else if (data.getExtras() == null) { } else if (data.getExtras() == null) {
errorCallback.onError(ErrorStrings.MISSING_INTENT_EXTRAS); errorCallback.onPaymentError(ErrorStrings.MISSING_INTENT_EXTRAS);
} else if (resultCode == Activity.RESULT_CANCELED) { } else if (resultCode == Activity.RESULT_CANCELED) {
errorCallback.onError(ErrorStrings.RESULT_CANCELED); errorCallback.onPaymentError(ErrorStrings.RESULT_CANCELED);
} else if (resultCode != Activity.RESULT_OK) { } else if (resultCode != Activity.RESULT_OK) {
errorCallback.onError(String.format( errorCallback.onPaymentError(String.format(
Locale.US, ErrorStrings.UNRECOGNIZED_ACTIVITY_RESULT, resultCode)); Locale.US, ErrorStrings.UNRECOGNIZED_ACTIVITY_RESULT, resultCode));
} else { } else {
String details = data.getExtras().getString(EXTRA_RESPONSE_DETAILS); String details = data.getExtras().getString(EXTRA_RESPONSE_DETAILS);
...@@ -106,7 +106,7 @@ public class WebPaymentIntentHelper { ...@@ -106,7 +106,7 @@ public class WebPaymentIntentHelper {
if (methodName == null) methodName = ""; if (methodName == null) methodName = "";
// TODO(crbug.com/1026667): Support payer data delegation for native apps instead of // TODO(crbug.com/1026667): Support payer data delegation for native apps instead of
// returning empty PayerData. // returning empty PayerData.
successCallback.onIsReadyToPayServiceResponse( successCallback.onPaymentSuccess(
/*methodName=*/methodName, /*details=*/details); /*methodName=*/methodName, /*details=*/details);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment