Created
November 19, 2012 15:56
-
-
Save SeraphimSerapis/4111427 to your computer and use it in GitHub Desktop.
Activity result after payment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onActivityResult(int requestCode, int resultCode, Intent data) { | |
if (requestCode == REQUEST_PAY) { | |
switch (resultCode) { | |
case RESULT_OK: | |
String payKey = data | |
.getStringExtra(PayPalActivity.EXTRA_PAY_KEY); | |
showToast("Payment succeeded - Key: " + payKey); | |
break; | |
case RESULT_CANCELED: | |
showToast("Payment got canceled"); | |
break; | |
case PayPalActivity.RESULT_FAILURE: | |
String errorID = data | |
.getStringExtra(PayPalActivity.EXTRA_ERROR_ID); | |
String errorMessage = data | |
.getStringExtra(PayPalActivity.EXTRA_ERROR_MESSAGE); | |
showToast("Error (" + errorID + "): " + errorMessage); | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment