Novo override
@OverRide
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// Check which request we're responding to
if (requestCode == COLLECT_PAYMENT_REQUEST) {
// Make sure the request was successful
if (resultCode == Activity.RESULT_OK) {
if (data != null) {
Payment payment = data.getParcelableExtra(Intents.INTENT_EXTRAS_PAYMENT);
Log.d(TAG, "Received onPaymentAction from PaymentFragment w/ Status("
+ payment.getStatus() + ")");
if (payment.getStatus().equals(PaymentStatus.COMPLETED)) {
Toast.makeText(this, "Pagamento Concluído", Toast.LENGTH_LONG).show();
} else if (payment.getStatus().equals(PaymentStatus.AUTHORIZED)) {
Toast.makeText(this, "Pagamento Autorizado", Toast.LENGTH_LONG).show();
} else if (payment.getStatus().equals(PaymentStatus.CANCELED)) {
Toast.makeText(this, "Pagamento Cancelado", Toast.LENGTH_LONG).show();
} else if (payment.getStatus().equals(PaymentStatus.FAILED)) {
Toast.makeText(this, "Pagamento Falhou", Toast.LENGTH_LONG).show();
} else if (payment.getStatus().equals(PaymentStatus.REFUNDED)) {
Toast.makeText(this, "Pagamento Reembolsado", Toast.LENGTH_LONG).show();
} else if (payment.getStatus().equals(PaymentStatus.VOIDED)) {
Toast.makeText(this, "Pagamento Anulado", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "Pagamento Concluído", Toast.LENGTH_LONG).show();
}
}
} else if (resultCode == Activity.RESULT_CANCELED) {
Toast.makeText(this, "Pagamento Cancelado", Toast.LENGTH_LONG).show();
}
}
}
Novo override
@OverRide public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); // Check which request we're responding to if (requestCode == COLLECT_PAYMENT_REQUEST) { // Make sure the request was successful if (resultCode == Activity.RESULT_OK) { if (data != null) { Payment payment = data.getParcelableExtra(Intents.INTENT_EXTRAS_PAYMENT); Log.d(TAG, "Received onPaymentAction from PaymentFragment w/ Status(" + payment.getStatus() + ")"); if (payment.getStatus().equals(PaymentStatus.COMPLETED)) { Toast.makeText(this, "Pagamento Concluído", Toast.LENGTH_LONG).show(); } else if (payment.getStatus().equals(PaymentStatus.AUTHORIZED)) { Toast.makeText(this, "Pagamento Autorizado", Toast.LENGTH_LONG).show(); } else if (payment.getStatus().equals(PaymentStatus.CANCELED)) { Toast.makeText(this, "Pagamento Cancelado", Toast.LENGTH_LONG).show(); } else if (payment.getStatus().equals(PaymentStatus.FAILED)) { Toast.makeText(this, "Pagamento Falhou", Toast.LENGTH_LONG).show(); } else if (payment.getStatus().equals(PaymentStatus.REFUNDED)) { Toast.makeText(this, "Pagamento Reembolsado", Toast.LENGTH_LONG).show(); } else if (payment.getStatus().equals(PaymentStatus.VOIDED)) { Toast.makeText(this, "Pagamento Anulado", Toast.LENGTH_LONG).show(); } else { Toast.makeText(this, "Pagamento Concluído", Toast.LENGTH_LONG).show(); } } } else if (resultCode == Activity.RESULT_CANCELED) { Toast.makeText(this, "Pagamento Cancelado", Toast.LENGTH_LONG).show(); } } }