Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
- if (requestCode == RaveConstants.RAVE_REQUEST_CODE && data != null) {
- String message = data.getStringExtra("response");
- //Handle the payment depending on the status
- if (resultCode == RavePayActivity.RESULT_SUCCESS) {
- Toast.makeText(this, "Payment successful", Toast.LENGTH_SHORT).show();
- checkoutButton.setText("Bought");
- checkoutButton.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
- checkoutButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- Toast.makeText(ProductDetailsActivity.this,
- "You have already made payment",
- Toast.LENGTH_SHORT).show();
- }
- });
- } else if (resultCode == RavePayActivity.RESULT_ERROR) {
- Toast.makeText(this,
- "There was an error processing your payment. Please try again.",
- Toast.LENGTH_SHORT).show();
- } else if (resultCode == RavePayActivity.RESULT_CANCELLED) {
- Toast.makeText(this, "Payment cancelled ", Toast.LENGTH_SHORT).show();
- }
- } else {
- super.onActivityResult(requestCode, resultCode, data);
- }
- }
Add Comment
Please, Sign In to add comment