-
-
Save hitherejoe/5078308488c8d1af23142192359f5f5e to your computer and use it in GitHub Desktop.
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
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | |
when (requestCode) { | |
LOAD_PAYMENT_DATA_REQUEST_CODE -> when (resultCode) { | |
Activity.RESULT_OK -> { | |
data?.let { | |
val paymentData = PaymentData.getFromIntent(it) | |
paymentData?.let { data -> | |
val json = data.toJson() | |
val paymentMethodData = JSONObject(json) | |
.getJSONObject("paymentMethodData") | |
val paymentToken = paymentMethodData | |
.getJSONObject("tokenizationData") | |
.getString("token") | |
} | |
} | |
} | |
Activity.RESULT_CANCELED -> { | |
// handle cancelled state | |
} | |
AutoResolveHelper.RESULT_ERROR -> { | |
val status = AutoResolveHelper.getStatusFromIntent(data) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment