Skip to content

Commit

Permalink
Merge pull request #229 from tinkoff-mobile-tech/EACQAPW-4401_api_res…
Browse files Browse the repository at this point in the history
…ult_usage

EACQAPW-4401_api_result_usage
  • Loading branch information
jQwout authored Apr 3, 2023
2 parents 9bfb975 + 8885561 commit 6f4c9a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,7 @@ class DetailsActivity : PayableActivity() {

private val paymentContract =
registerForActivityResult(ActivityResultContracts.StartIntentSenderForResult()) { result: ActivityResult ->
when (result.resultCode) {
RESULT_OK -> {
Toast.makeText(this,
R.string.notification_payment_success,
Toast.LENGTH_SHORT).show()
}
RESULT_CANCELED -> Toast.makeText(this,
R.string.payment_cancelled,
Toast.LENGTH_SHORT).show()
TinkoffAcquiring.RESULT_ERROR -> Toast.makeText(this,
R.string.payment_failed,
Toast.LENGTH_SHORT).show()
}
handlePaymentResult(result.resultCode, result.data)
}

public override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ open class PayableActivity : AppCompatActivity() {
}
}

private fun handlePaymentResult(resultCode: Int, data: Intent?) {
protected fun handlePaymentResult(resultCode: Int, data: Intent?) {
when (resultCode) {
RESULT_OK -> onSuccessPayment()
RESULT_CANCELED -> Toast.makeText(this, R.string.payment_cancelled, Toast.LENGTH_SHORT).show()
Expand All @@ -281,7 +281,7 @@ open class PayableActivity : AppCompatActivity() {
}
}

private fun handleYandexPayResult(resultCode: Int, data: Intent?) {
protected fun handleYandexPayResult(resultCode: Int, data: Intent?) {
when (resultCode) {
RESULT_OK -> {
acqFragment?.options = createPaymentOptions()
Expand Down

0 comments on commit 6f4c9a5

Please sign in to comment.